Is there a way to make a script for rotating doors that can be used for more than just one door or door set? I tried to set the target of the affect to get the parm1 of the entity. In the target_scriptrunner entity i set parm1 to "door" (which is the script_targetname the func_static entity of the door with a origin brush for its hinge). The script looks like this
Code:
do ( "opendoor" );
wait ( $get( FLOAT, "SET_PARM3")$ );
do ( "closedoor" );
task ( "opendoor" )
{
affect ( $get( STRING, "SET_PARM1")$, /*@AFFECT_TYPE*/ INSERT )
{
rotate ( $get( VECTOR, "SET_PARM4")$, $get( FLOAT, "SET_PARM2")$ );
}
}
task ( "closedoor" )
{
affect ( $get( STRING, "SET_PARM1")$, /*@AFFECT_TYPE*/ INSERT )
{
rotate ( < 0.000 0.000 0.000 >, $get( FLOAT, "SET_PARM2")$ );
}
}
(this was copied from the .txt, it was created in behavEd)
When I run the game, this version crashes it, previous versions showed an "affect" in the debugger but the door never was affect-ed...
Is it even possible to use parms as entity names, or do you have to hard code that into the script?