Hi! Welcome to the forum for Platinum Arts Sandbox Free 3D Game Maker. I currently have the forums locked as I am attempting to properly update them.

In the meantime please join the new Discord Server!

If you have any questions please e-mail me through the Platinum Arts website.

Sound During Teleport to New Map

Having issues not related to a specific Sandbox game mode? Get help here!
Please also read the rules for support when posting support requests.
Failure to comply with the forum rules may result in your topic being locked without resolution.
UCLA.RES.
Member
Member
Posts: 18
Joined: August 23rd, 2011, 1:11 pm
Name: Daniel

Sound During Teleport to New Map

Post by UCLA.RES. »

Hey,

Does anyone perchance know how to make a sound entities trigger during a teleport to a new map? Do I have to make it in such a way that ALL loading screens make sounds or something. If so, How would I even do that? I'd really appreciate it if anyone could help me out please.

<(-_-)>
Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: Sound During Teleport to New Map

Post by Hirato »

if you just want to play a sound when the teleport is activated, use /sound (you'll want to register the sound first)
This is not a url, clicking it is pointless
User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: Sound During Teleport to New Map

Post by kddekadenz »

1) Would you like to have a custom sound played, when loading it via 'My maps'?
OR
2) Would you like to play a sound when teleporting ingame to another map?

1)

Code: Select all

beep = (registersound "chaze/select" 255)
sound $beep
your sound needs to be stored in a folder in packages/sounds

2)

Code: Select all

beep = (registersound "chaze/select" 255)
level_trigger_1 = [sp yourmap; sound $beep]
teleports to a map named yourmap when trigger 1 is activated and plays a sound

Note: This is code for FPS mode.
Kelgar is an advanced RPG beeing developed in Sandbox
UCLA.RES.
Member
Member
Posts: 18
Joined: August 23rd, 2011, 1:11 pm
Name: Daniel

Re: Sound During Teleport to New Map

Post by UCLA.RES. »

i actually already have a trigger for this teleport, but I need both triggers to work at the same time. when I did u script kdd, it canced the previous script i had which was:

level_trigger_1 = [
listofmaps = [HT_left HT_right]; map (at $listofmaps (rnd (listlen $listofmaps)))]


is there a way I can get both of them working at the same time?
I thought trigger levels 2's make the rumble noise, so I triedto make it a level trigger 2, but it didnt work. wierd!
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Sound During Teleport to New Map

Post by chocolatepie33 »

Just to be sure, the "listofmaps" part is just like a random map loader, correct? I think this might do the trick:

Code: Select all

beep = (registersound "chaze/select" 255)
level_trigger_1 = [listofmaps = [HT_left HT_right]; map (at $listofmaps (rnd (listlen $listofmaps))); sound $beep]
Actually, I think that would execute the sound after it loads the map, if you want the sound to load first then the map, I'd try this:

Code: Select all

beep = (registersound "chaze/select" 255)
level_trigger_1 = [sound $beep; listofmaps = [HT_left HT_right]; map (at $listofmaps (rnd (listlen $listofmaps)))]
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: Sound During Teleport to New Map

Post by kddekadenz »

UCLA.RES. wrote:i actually already have a trigger for this teleport, but I need both triggers to work at the same time. when I did u script kdd, it canced the previous script i had which was:

level_trigger_1 = [
listofmaps = [HT_left HT_right]; map (at $listofmaps (rnd (listlen $listofmaps)))]
I quite do not understand your script :|
Do you want to load a random map with this?
You can make different triggers which teleports you to different maps with my method.
is there a way I can get both of them working at the same time?
I thought trigger levels 2's make the rumble noise, so I triedto make it a level trigger 2, but it didnt work. wierd!
You should take a look at the Sauerbraten documentation. There is a overview of the trigger states.
Kelgar is an advanced RPG beeing developed in Sandbox
UCLA.RES.
Member
Member
Posts: 18
Joined: August 23rd, 2011, 1:11 pm
Name: Daniel

Re: Sound During Teleport to New Map

Post by UCLA.RES. »

to Chochlatepie33, The script you gave (second one since I need the beep at the begging) did some wierd things. First, it didnt load properly, once i put it in the .cfg. I had to manually type the last line (not a complaint at all, just wondering if that has something to do with the script). Then when it took affect, it only teloported me to HT_ left and not HT_right, and it didn't make the beep at all. WIERD I know. lol

to kddekadenz, Ya it is a unique script. It required hirato's genius. It teloports completely randomly, between the two maps, "HT_left" and "HT_right", as listed in the script i posted. So basically, it cant used different triggers for different maps. It has to be that one trigger that makes it random. So i need to alter the existing script so that it maintains its regular function, with the addition of making the beep sound at the begging of the teloport. I really hope this is possible.

THANKS for all the help guys. I really appreciate it!
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Sound During Teleport to New Map

Post by chocolatepie33 »

hmmm... maybe I messed up the code line somehow...
My only guess is that there wasn't a space between the semicolons. That may cause a problem, since coding usually has to be perfect when following guidelines and syntax.

To break down the code, line 1 registers the sound to be used, part 1 of line 2 plays the sound, part 2 creates the alias/array listofmaps (with values map1 and map2), and part 3 should load the randomly determined map (from that array). I don't know what else may be wrong, other than order, possibly.

Code: Select all

beep = (registersound "chaze/select" 255)
level_trigger_1 = [sound $beep ; listofmaps = [HT_left HT_right] ; map (at $listofmaps (rnd (listlen $listofmaps)))]
Julius wrote:Contribute to http://www.opengameart.org NOW!
Save the wiki!
UCLA.RES.
Member
Member
Posts: 18
Joined: August 23rd, 2011, 1:11 pm
Name: Daniel

Re: Sound During Teleport to New Map

Post by UCLA.RES. »

AHH so close! so now it does randomly teloport but makes the noise like 1/10th of the time, really weird. And every time I restart PAS the object does not have the script attached to it anymore so I have to F6 - load save and execute it again each time. That is really weird. Could it be that the beep is only activated at random intervals as the map? I'm so frustrated. What should I do? Could anyone help me out plz.
User avatar
Mike
Administrator
Administrator
Posts: 871
Joined: May 24th, 2009, 12:52 pm

Re: Sound During Teleport to New Map

Post by Mike »

Unless I'm missing something, couldn't you just place a sound entity next to each teleporter? You can just gank my code in halloween house and then go in the map and take a look at how I have the entity setup. You can even copy and paste the entities out of the map. :D Take care.
-mike
Sign up for our Newsletter to keep up to date with the Sandbox news!
We also have a facebook page, facebook group, myspace page and a twitter page[/b][/color]!
Locked