sorry for being such a pain.
I want a machiene Sound to be played when the gun Rotation starts. I am trying this now for days and can only get it to work half-decent. The way I put the Sound in the script below was the only way the Sound was played but unfortunately the Sound starts after the gun stops rotating. So I guess the script part that Plays the Sound is executed after the script has finished the faceangles command. I put the Sound command now at various Locations that are connected with the moving of the gun but they are never executed. Strangely the wm_announcement is always executed when I put it after my Sound command. Anyone has an idea?
I even tried to connect a Trigger_always to a target_Speaker and then tried to toogle the Trigger by setstate invisible/Default etc but als this didn’t work. I also tried to Loop the Speaker and then enable/disable Speaker via the script, also didn’t work. There must be something wrong here. I tested the Sound in a place in the script where I use other sounds. The Sound Plays nice, just not at the place where I Need it.
here the script
pak75 // script_mover
{
spawn
{
wait 200
setstate pak75 invisible
setstate gun_flash invisible
setstate pak75_moved invisible
setstate pak75_moved_clip invisible
setstate pak75_move_1 invisible
setstate gun_fire invisible
setstate gun_rotated_toi invisible
setstate fire_ready_toi invisible
setstate rotate_ready_toi invisible
setstate rotate_green1 invisible
setstate rotate_green2 invisible
setstate rotate_gelb invisible
setstate fire_green invisible
}
trigger move
{
faceangles 0 90 0 3000
playsound sound/movers/motors/motor_loop_01.wav
}
}
// here we do checks and control all the gun parts
pak75_dummy_construct // func_constructible
{
spawn
{
wait 200
constructible_class 3 //only dynamite can destroy the gun
accum 0 set 0 //state of gun: bit 0 = broken, bit 1 = repaired // bit 2 = ammo box delivered
}
trigger gun_repaired //before move gun can be repaired and destroyed { accum 0 bitset 1
wait 200
trigger fence_block oeffnen //gun rotation control can be reached now
setstate rotate_green1 default //green light 1 indicating rotation enabled visible
setstate rotate_red1 invisible //red light 1 indicating rotation disabled invisible
}
trigger gun_damaged //before move gun can be repaired and destroyed { accum 0 bitreset 0
wait 200
trigger fence_block schliessen //gun rotation control not reachable when gun is broken
setstate rotate_red1 default //red light 1 indicating rotation disabled visible
setstate rotate_green1 invisible //green light 1 indicating rotation enabled invisible
}
trigger objective_delivered //ammo box delivered to gun
{
accum 0 bitset 2
setstate rotate_block invisible //gun rotation control panel visible
setstate pak75_move_1 default //gun rotation control enabled
setstate rotate_red2 invisible //red light 2 invisible
setstate rotate_green2 default //green light 2 visible
playsound sound/weapons/fg42/fg42_reload.wav //play charging sound
wait 200
setstate rotate_ready_toi default //toi saying that gun is ready to rotate visible
}
trigger move
{
accum 0 abort_if_not_bitset 2 // it can only move when ammo box was delivered
trigger pak75 move // move that gun
wait 100
wm_announce “^3gun rotation started”
wait 4000 //this is the time the gun rotates and then the scriptmover disappears and is replaced by a non-constructable gun
setstate pak75_moved default //moved gun now visible - gun no longer constructable
setstate pak75_moved_clip default //moved gun clip visible - gun no longer constructable
setstate pak75 invisible //gun scriptmover after move invisible - gun no longer constructable
setstate pak75_dummy_construct invisible //gun scriptmover after move invisible - gun no longer constructable
setstate pak75_toi invisible //gun scriptmover after move invisible - gun no longer constructable
setstate gun_rotated_toi default //toi saying that gun can’t be destroyed anymore visible
setstate rotate_red1 invisible //red light 1 indicating gun can’t be rotated invisible
setstate rotate_red2 invisible //red light 2 indicating gun can’t be rotated invisible
setstate rotate_green1 invisible //green light 1 indicating gun can be rotated invisible
setstate rotate_green2 invisible //green light 2 indicating gun can be rotated invisible
setstate rotate_gelb default //yellow light indicating gun was rotated visible
wm_announce “^2the gun is ready to be fired”
wait 200
setstate fire_block invisible //gun fire control panel visible
setstate gun_fire default //gun fire control enabled
wait 200
setstate fire_ready_toi default //toi saying that gun is ready to fire visible
setstate fire_red invisible //red light indicating firing disabled invisible
setstate fire_green default //green light indicating firing enabled visible
}
built final {
setstate pak75 default // repaired gun visible-this command handles the repaired and destroyed gun before the move
setstate pak75_broken invisible // broken gun invisible-this command handles the repaired and destroyed gun before the move
setstate pak75_broken_clip invisible
trigger pak75_dummy_construct gun_repaired // trigger dummy_construct-this command handles the repaired and destroyed gun before the move}
death {
setstate pak75 invisible //this command handles the repaired and destroyed gun before the move
setstate pak75_broken default //this command handles the repaired and destroyed gun before the move
setstate pak75_broken_clip default //this command handles the repaired and destroyed gun before the move
trigger pak75_dummy_construct gun_damaged //this command handles the repaired and destroyed gun before the move
}
}
pak75_move_1 // func_invisible_user //this thing controls the move of the gun after the ammo box was delivered
{
activate allies //trigger this thing only when activated by allies
{
trigger pak75_dummy_construct move //move the gun
wait 500
setstate pak75_move_1 invisible //we only wanna move once so we let the button disappear
}
}
gun_fire // func_invisible_user //this thing controls firing of the gun after the gun was moved
{
activate allies //can only be activated by allies
{
trigger gun_fire flash //triggers flash and sound that is connected to flash model in map file via target_speaker
}
trigger flash
{
trigger boomtrigger boom_all //triggers gate explosion-taken from goldrush that’s why it’s called bank stuff…
alertentity bank_door1
setstate doorframe invisible
setstate doorframe_damaged defaultsetstate gun_flash default //controls the gun flash upon firing
wait 100
setstate gun_flash invisible
setstate gun_fire invisible //one shot should be enough so we let the button disappear
wm_announce “^1Allies destroyed the gate to Teuthonia”
}
}