Page 1 of 1

Team only doors

Posted: Mon Oct 02, 2006 7:36 am
by Waylander76
I would like a couple of doors that only the axis can use and I know they
will need to be scripted.

In radiant I have an origin, brush for the door that is a script object
called axis_door and a trigger multiple called Axis_door_trigger

Am I on the right lines with the below?
I know the syntax is incorrect at the moment, I just wanted to know if the steps used were correct.

Thanks

Code: Select all

Axis_door:

Axis_door_trigger waittil trigger

local.player = parm.other 
if (local.player.dmteam == "axis") 
{ 
rotate $axis_door 90  // to open the door
playsound door open 
wait 10
playsound door_close
rotate $axis_door back -90 //to close the door
}
else
{
print "Only the Axis can use this door!"
Playsound door_locked
}
end

Posted: Mon Oct 02, 2006 7:53 am
by jv_map
It's much easier to use a func_rotatingdoor and lock it. That way you don't have to script the movement (including blocking players) and allied players will hear a door locked sound :)

Code: Select all

main:
  // normal map script

  level waittill spawn

  thread axis_door
end

axis_door:

  if($axis_door)
  {
    $axis_door lock

    while($axis_door_trigger)
    {
      $axis_door_trigger waittill trigger
      if(parm.other.dmteam == axis)
      {
        // possibly unlock is needed, but I don't think so
        $axis_door open parm.other 
      }
    }
    println "ops yer trigger is missing"
  }
  println "ops yer door is missing"
end

Posted: Tue Oct 03, 2006 7:13 am
by Waylander76
Thanks Jv :D