Help with BehavEd scripting/Sounds -1 reply

Please wait...

Kaito

Addicted to GF

50 XP

16th January 2007

0 Uploads

265 Posts

0 Threads

#1 12 years ago

SCRIPTING: Im new to scripting, but i have been mapping for a bit (i am by no means good). I would like some help with scripting. I have made a rotating door, using this tutorial. I have not tested it, but it seems straight forward.

I do have a question about this, though. How do I make those kinds of doors (which in GTK are func_static) toggleable (in other words, have them stay closed until i push the button or trigger them again).

The real Question comes next. I tried to follow this tutorial, and i cant find the right commnad. Could someone help me with this one? I have used both, i tried SET_INVISIBLE, and it wont work

Also, i wanted to make a script that changes the worldspawn gravity. Is it something along the lines of set SET_GRAVITY 200? (if i want 200 to be the gravity i change it to). If not, could someone explain this to me?

SOUNDS: I want to have a sound play when i trigger it. Trigger_multiple ----> target_speaker. Key: noise Value: ??? for the value, should it be a path (sounds/vehicles/common/fire_lp.wav), or should it be just the name of it (fire_lp.wav). Ive also heard the Value should be "noise/fire_lp.wav"

Also, what if i only want it to play for a specified time. Key: time Value: time in seconds?

And finally: What do i type/check if i want it to play only in a certian area. Like the further away you get from it, the less loud it gets.

If these could be answered, that would be great

~Kaito




Guest

I didn't make it!

0 XP

 
#2 12 years ago

The sound is at least included in the pk3 so you write Key: noise value:sound/File in Wav. The sound is getting weaker the further you move away from it. Try to add 8 spawnflags for the toggled door. About the sound in seconds. You have to modify that into your sound file.




Szico VII

We want FF7-2/remake!

50 XP

15th September 2003

0 Uploads

1,683 Posts

0 Threads

#3 12 years ago

Key: noise Value: sound/mymapfolder/mysound.mp3(or.wav)

It automatically attenuates with distance.

As for playing for a specified time, make your sound file that length or get a target_delay to retrigger the looped speaker after x seconds




lassev

Degenerate scripter

50 XP

21st June 2004

0 Uploads

847 Posts

0 Threads

#4 12 years ago
Kaito;3854954I do have a question about this, though. How do I make those kinds of doors (which in GTK are func_static) toggleable (in other words, have them stay closed until i push the button or trigger them again).

As a term toggleable means it opens when used and stays open until used again, and then the cycle can start again. Plain triggerable would be such that it would open and shortly automatically close when used once.

Anyway, you can just check the use button (or whatever it was called) flag in the trigger for the latter variety, but for truly toggleable doors you would need fancier solutions. Those solutions could be either to have one script to open the door and another to close it, or to store the current status (in a variable for example) and then check whether the door needs to be closed or opened when the script is launched, thus using something I tend to call a universal script.

Well, two separate scripts is a no-brainer solution, whereas the universal script would pretty much require you to learn to script. If you go for two scripts, just have two triggers occupying the same place, one targeting an opener script_runner, the other targeting a closer script_runner. And then just activate and deactivate one and one of them appropriately, following a logic simpler than Kouen's usual train of thought.




UU_BobaFett

JKG Lead coder

50 XP

18th July 2006

0 Uploads

202 Posts

0 Threads

#5 12 years ago
SCRIPTING: Im new to scripting, but i have been mapping for a bit (i am by no means good). I would like some help with scripting. I have made a rotating door, using this tutorial. I have not tested it, but it seems straight forward. I do have a question about this, though. How do I make those kinds of doors (which in GTK are func_static) toggleable (in other words, have them stay closed until i push the button or trigger them again). The real Question comes next. I tried to follow this tutorial, and i cant find the right commnad. Could someone help me with this one? I have used both, i tried SET_INVISIBLE, and it wont work Also, i wanted to make a script that changes the worldspawn gravity. Is it something along the lines of set SET_GRAVITY 200? (if i want 200 to be the gravity i change it to). If not, could someone explain this to me?

well i use icarus A LOT in my map mods, so i think i can help ya with this

you say you wish to make a setup in which a button opens AND closes a door when pressed... in a toggle state..

now i havent seen the tutorial you've been using but im guessing its the rotadoor one...

well, to make it toggle, its not that hard

you'll have to pick one of the doors to act as the 'master door' that door will have its current state saved in it (using parms) so it can determine whether it has to be opened or closes

first thing your script will have to do, is affect the master door, and check the state of the parm you're gonna use, for example: (using normal text here, but you'll get the point) in my example, i'll be using SET_PARM1 as the state parm, where 0 = closed and 1 = opened affect (rotadoor1,FLUSH) { if (get(SET_PARM1,FLOAT),=,1) { set (SET_PARM1,0) affect(rotadoor2,FLUSH) { } } else { set (SET_PARM1,1) affect(rotadoor2,FLUSH) { } } } all ya gotta do next, is make sure the button cannot be pushed while the script is being executed, as that'll mess things up

as far as SET_INVISIBLE goes, it should work, it adds the eflag EF_NODRAW to the using ent, which in case of a player, would make him/her invisible, please note that it possibly has no effect on yourself (havent tried), but other ppl will be invisible, just make sure the scriptrunners have spawnflags set to 1, otherwise they'll turn themselves invisible (the scriptrunners) instead of the triggering player

SET_GRAVITY is a little bugged, it seems to override NPC gravity only, and so far i havent seen it work on clients