Jump to content

Home

Door Scripting


CalcProgrammer1

Recommended Posts

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

 

 

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?

Link to comment
Share on other sites

So you are trying to create multiple rotating doors that activate on command?

 

Why couldnt you just create a func_rotating for each door that is activated on a trigger, or set as usable?

Or maybe if you want all the doors to activate at once link them all to one trigger? Am I understanding u?

Link to comment
Share on other sites

func_rotating's can't be moved to specific points and stopped, the script is to make a door that swings open and closed, using the rotate() command. A func_rotating would just spin in a fixed direction in a circle until targeted, then it would stop, and when targeted again, start in the same direction. It will not work for a hinged door.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...