Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 64 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
CoD Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Scripted door with sound
Versions: You must be logged in to view history.
hi…my name is hAYX. I want to show you a how to for a scripted door with sound you find the  source files for that here.

it´s very easy well...

1. Step

create a simple door with frame and make an origin brush in the door hinge that's the center of rotation... to see how in the lower picture

image001

2. Step

and now select your origin, the door and the hingeand make it to a script brushmodel
and enter following keys:

key: targetname
Value: door

3: Step

the last in the brushwork part is the trigger for the door switch.
create a trigger, make it to a trigger use (you can also use a trigger multiple if you like the trigger is activating by touching)
and enter following keys:

key: targetname
Value: door_trigger

image002

that's all of brushwork

now the scripting part

enter the following script in your gsc file.

the only difficulty on that is it the sound to time the explanations behind the commands should help you to understand it better if you are not yet so fit

script:

//scriptet by hAYX

main()
{
thread scripted_door();//definition --> script contains the function scripted_door
}
scripted_door()//the function scripted_door starts
{
door = getent ("door","targetname");//definition --> the object (the door) with the targetname door that has the name door
trig = getent ("door_trigger","targetname");//definition --> the object (the trigger) with the targetname door_trigger that has the name trig
while (1)//definition --> the function should grind run in one that it is again usable after every process
{
trig waittill ("trigger");//definition --> after the activity of the trigger
door playsound ("keys_jingle");//definition --> play the sound "keys_jingle"
wait (2);//definition --> wait 2 seconds
door rotateyaw ( 90, 2, 1.5, 0.5);//definition --> trick the door around 90 degrees, in 2 seconds, with an acceleration of 1.5 seconds and a deceleration of 0.5 seconds
door playsound ("openloop");//definition --> play the sound "openloop"
door waittill ("rotatedone");//definition --> wait on the end of the rotation
wait (6);//definition --> wait 6 seconds
door playsound ("door_close");//definition --> play the sound "door_close"
door rotateyaw ( -90, 2.1, 1.5, 0.5);//definition --> trick the door around -90 degrees, in 2.1 seconds, with an acceleration of 1.5 seconds and a deceleration of 0.5 seconds
wait (1.9);////definition --> wait 1.9 seconds
door playsound ("door_bounce");//definition --> play the sound "door_bounce"
}
}


soundaliases and sound folder

for the sound you need a soundaliass and a sound folder but first to the soundaliases folder here is the mapname.csv file with following contents

name,sequence,file,vol_min,vol_max,pitch_min,pitch_max,dist_min,dist_max,channel,type,probability,loop,masterslave,loadspec,subtitle

null,,null.wav,,,,,,,,,,,,,

keys_jingle,,keys_jingle.wav,0.5,1,,,80,500,auto,,,,,,

openloop,,openloop.wav,0.5,1,,,80,500,auto,,,,,,

door_close,,door_close.wav,0.5,1,,,80,500,auto,,,,,,

door_bounce,,door_bounce.wav,0.5,1,,,80,500,auto,,,,,,


this calls the sound out of your sound folder


ok i hope this will help you a little

hAYX

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»