Greetings - I'm looking for some help with a trap I'm trying to implement in my JA MP map. The trap should work like thus.....a player "hits a switch" in the hangar control room. This sets off a klaxon in the hangar itself that goes off four times, after which a "forcefield" is deactivated and anyone in the hangar gets sucked out into space and dies. Five seconds later, the forcefield is reactivated, and it's safe to enter the hangar again. I couldn't find an entity combination that did this, so I wrote a custom script using Icarus. This is the script.....
//Generated by BehavEd
rem ( "Custom script written by MoeJoe" );
rem ( "This script allows a player to turn off the magseal at the hangar entrance, making life really suck for anyone inside" );
rem ( "PARM1 = target_speaker to play klaxon" );
rem ( "PARM2 = the forcefield, a func_usable" );
rem ( "PARM3 = target_speaker to play whoosh sound" );
rem ( "PARM4 = the trigger_push entity, throwing players out into space" );
task ( "play_klaxon" )
{
rem ( "This task activates the target_speaker to play the klaxon sound and loops it 4 times" );
affect ( $get( STRING, "SET_PARM1")$, /*@AFFECT_TYPE*/ FLUSH )
{
loop ( 4 )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "false" );
}
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "true" );
}
}
task ( "this_sucks" )
{
rem ( "This task turns off the forcefield, activates the whoosh target_speaker, and activates the trigger_push" );
affect ( $get( STRING, "SET_PARM2")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "true" );
}
affect ( $get( STRING, "SET_PARM3")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "false" );
}
affect ( $get( STRING, "SET_PARM4")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "false" );
}
}
task ( "much_better" )
{
rem ( "This task resets the forcefield and deactivates the trigger_push" );
affect ( $get( STRING, "SET_PARM4")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "true" );
}
affect ( $get( STRING, "SET_PARM2")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "false" );
}
}
dowait ( "play_klaxon" );
dowait ( "this_sucks" );
wait ( 5000.000 );
dowait ( "much_better" );
And here are the entities I'm using and their parameters....
target_speaker #1 - plays klaxon sound (noise = sounds/effects/mpalarm.wav), has no checkboxes checked, script_targetname is klaxon
target_speaker #2 - plays the "whoosh" sound (noise = sounds/effects/air_burst.mp3), has no checkboxes checked, script_targetname is whoosh
func_usable - the "forcefield", separates the hangar from the "space" outside, hangar side is textured with a translucent forcefield shader, has no checkboxes checked, script_targetname is forcefield
trigger_push - fills the hangar completely and it's target is all the way at the back of the "space" area - inactive, relative, and multiple checkboxes are checked, script_targetname is push
target_scriptrunner - uses hangar_death script (shown above) -- parm1 = klaxon, parm2 = forcefield, parm3 = whoosh, parm4 = push, targetname is hangar_runner
trigger_multiple - placed at the "switch" position, is directional and has use button and facing checked, wait time is five minutes (so people can't keep hitting it over and over), target is hangar_runner
*whew*
Anyway, what happens when I run it is this.......as soon as you enter the trigger_push (before it is even triggered), it seems to be trying to push me, over and over, rapidly, but it never throws me - the effect is as if there's a huge earthquake going on. Upon triggering the trigger_multiple, the target_speakers don't go off and the func_usable forcefield doesn't diasappear - however, the trigger_push is now fully active and throws you against the forcefield with enough force to kill you (a neat effect, but not quite what I had in mind.)
I apologize for the HUGE post, but I've been trying to figure out what is wrong here, and I am at my wits end. If anyone here has any idea what might be wrong with my script, if I'm using the wrong type of entities, if I haven't set the right flags, anything at all, I'd really appreciate the help. Thank you
------------------
What do you do when you rear-end someone? Hang up your cell phone...HANG UP AND DRIVE, STUPID
//Generated by BehavEd
rem ( "Custom script written by MoeJoe" );
rem ( "This script allows a player to turn off the magseal at the hangar entrance, making life really suck for anyone inside" );
rem ( "PARM1 = target_speaker to play klaxon" );
rem ( "PARM2 = the forcefield, a func_usable" );
rem ( "PARM3 = target_speaker to play whoosh sound" );
rem ( "PARM4 = the trigger_push entity, throwing players out into space" );
task ( "play_klaxon" )
{
rem ( "This task activates the target_speaker to play the klaxon sound and loops it 4 times" );
affect ( $get( STRING, "SET_PARM1")$, /*@AFFECT_TYPE*/ FLUSH )
{
loop ( 4 )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "false" );
}
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "true" );
}
}
task ( "this_sucks" )
{
rem ( "This task turns off the forcefield, activates the whoosh target_speaker, and activates the trigger_push" );
affect ( $get( STRING, "SET_PARM2")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "true" );
}
affect ( $get( STRING, "SET_PARM3")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "false" );
}
affect ( $get( STRING, "SET_PARM4")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "false" );
}
}
task ( "much_better" )
{
rem ( "This task resets the forcefield and deactivates the trigger_push" );
affect ( $get( STRING, "SET_PARM4")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "true" );
}
affect ( $get( STRING, "SET_PARM2")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", /*@BOOL_TYPES*/ "false" );
}
}
dowait ( "play_klaxon" );
dowait ( "this_sucks" );
wait ( 5000.000 );
dowait ( "much_better" );
And here are the entities I'm using and their parameters....
target_speaker #1 - plays klaxon sound (noise = sounds/effects/mpalarm.wav), has no checkboxes checked, script_targetname is klaxon
target_speaker #2 - plays the "whoosh" sound (noise = sounds/effects/air_burst.mp3), has no checkboxes checked, script_targetname is whoosh
func_usable - the "forcefield", separates the hangar from the "space" outside, hangar side is textured with a translucent forcefield shader, has no checkboxes checked, script_targetname is forcefield
trigger_push - fills the hangar completely and it's target is all the way at the back of the "space" area - inactive, relative, and multiple checkboxes are checked, script_targetname is push
target_scriptrunner - uses hangar_death script (shown above) -- parm1 = klaxon, parm2 = forcefield, parm3 = whoosh, parm4 = push, targetname is hangar_runner
trigger_multiple - placed at the "switch" position, is directional and has use button and facing checked, wait time is five minutes (so people can't keep hitting it over and over), target is hangar_runner
*whew*
Anyway, what happens when I run it is this.......as soon as you enter the trigger_push (before it is even triggered), it seems to be trying to push me, over and over, rapidly, but it never throws me - the effect is as if there's a huge earthquake going on. Upon triggering the trigger_multiple, the target_speakers don't go off and the func_usable forcefield doesn't diasappear - however, the trigger_push is now fully active and throws you against the forcefield with enough force to kill you (a neat effect, but not quite what I had in mind.)
I apologize for the HUGE post, but I've been trying to figure out what is wrong here, and I am at my wits end. If anyone here has any idea what might be wrong with my script, if I'm using the wrong type of entities, if I haven't set the right flags, anything at all, I'd really appreciate the help. Thank you
------------------
What do you do when you rear-end someone? Hang up your cell phone...HANG UP AND DRIVE, STUPID