Generator Powered Door


(FrostyChilli) #1

I wonder how to make a door powered by generator that is open for axis/cvops and closed for allies. When Allies destroy the generator, door goes invisible. I’ve already made the door and generator. I have another thinner door for both teams inside the locked one. So in script, if generator is destroyed, locked door will be invisible (setstate vvv invisible). The problem is. How to make it accessible for axis and locked for allies ? Right now it is locked for both. If i open door entity menu(N) and put “allowteams” “axis/cvops” it won’t help. Door is connected with generator (targetname + target, blue stripe)

So. Any ideas to get it working? I looked at the baserace door, but didn’t really understand the script.

Any help is much appreaciated !


(ailmanki) #2

not sure, can’t you just make those 2 things separate, the generator and the door. Now once the generator is destroyed you modify the door by mapscript… I guess its possible without mapscript - but difficult.


(FrostyChilli) #3

Hmm…I have this door unlock script in Generator death menu now. So i make a new script part for door eh ?


(ailmanki) #4

sorry I think I missunderstood something…
if you put the value “axis/cvops” then I think thats the error, it should be “axis,cvops”


(FrostyChilli) #5

It is with comma. Still nothing.


(Commando66) #6

They did this on Battery, in their final version i think but no one plays those maps, anyway on the west side of the bunker you can go around and open the door as cvops and destroy the generator which opens the door (they slide opposite ways)


(FrostyChilli) #7

They’ve used a mover there. But i am looking for some simple script.


(Diego) #8

I don’t see any reason why you need to connect the door with the generator.

Build your door first using the allowteams “axis,cvops” key/value and make sure it works.
Build your Generator Contructable object and make sure that works.

Have a separate script object for your door and have a thread in that script to setstate the door invisible.
When the Generator is blown, have the generator script call the door script and turn off the door.


axis_door   //name of your entity
{
spawn
{
}
trigger on
{
setstate axis_door default
}
trigger off
{
setstate axis_door invisible
}
}

axis_generator
{
spawn
{
}
rebirth
{
trigger axis_door on
}
death
{
trigger axis_door off
}
}

That’s the general idea. Don’t take that code literally. I’m writing this it on the fly without any references handy so my syntax may be off. If you have problems making this work, use an target script trigger entity in the map and call the door code that way.