Page 1 of 1

Animated Doors !

Posted: Sat Mar 22, 2003 6:04 pm
by Jack Ruby
I have two huge doors that I want to be a TOW objective, I want them to open or close depending on which team hits the switch, kinda similar to the hangar doors in Flughafen, cept mine are rotating doors not sliding.

I have no clue how to do this, anyone care to wise me up ?

Jack

Posted: Sat Mar 22, 2003 11:34 pm
by Yarik
This involves scripting and a few brushes with somekind of func

Posted: Sun Mar 23, 2003 2:58 am
by nuggets
i'll give you the simplest of answers, how to rather than the script

you will need...

brushes for the door (sliding doors don't need origins, but you will need to set the right angle)

then script... similar to not exact thought...

level.doorpos = 1 //will set your current door position to 1 (hoping this is currently closed)
if ("level.playerteam" == 1) //this being the opposing team
(
$door_trigger triggerable
)
else
$door_trigger nottiggerable

//and then vica versa for the other team, seems simple enough? it is really but it's already 3am here and i'm goin 2 bed, i'll read this again tomorrow and if ya need it (hopefully you won't, but...) i'll post a fuller script on here for you,

but for now... good night!!! :D

Posted: Sun Mar 23, 2003 12:26 pm
by Jack Ruby
Hmm that seems to make some sort of sense to me, I will let ya know if I get it working, thanks mucho for your help,

Jack

Posted: Sun Mar 23, 2003 12:29 pm
by Jack Ruby
Let me just get this straight, position 1 would say be closed for the allies, for the axis I trigger the doors to move to position 2 ? If thats right then I really did learn something,

Nice one

Jack

Posted: Sun Mar 23, 2003 4:21 pm
by nuggets
i've just deleted everything i wrote cos of pressing "tab" + then "delete"!!!
bugger it!!!
oh well here it comes again

i'll just write the bloody script :(

main:
level.doorposition = 0 //assuming the doors closed when you compiled
local.player = $player
end

doors_open:
$door_trigger nottriggerable
$myleftdoor time 5 //time it takes for doors to open
$myleftdoor moveLeft 48 //may need changing (to moveRight, moveUp... etc)
$myleftdoor move
$myrightdoor time 5
$myrightdoor moveRight 48
$myrightdoor waitmove
level.doorposition = 1 //now noted as open
$door_trigger triggerable
end

//visa versa of open
doors_close:
$door_trigger nottriggerable
$myleftdoor time 5
$myleftdoor moveRight 48
$myleftdoor move
$myrightdoor time 5
$myrightdoor moveLeft 48
$myrightdoor waitmove
level.doorposition = 0 //now noted as closed again
$door_trigger triggerable
end

//the tricky bit
doors_move:
if (local.player.dmteam == allies)
{
if (level.doorposition == 0) //doors already closed
{
thread doors_open
}
else
if (local.player.dmteam == axis)
{
if (level.doorposition == 1) //doors already open
{
thread doors_close
}
}
end

//nuggets was here!!!

lol, and then in the map...

on the door trigger put these
key: targetname
value: door_trigger
key: setthread
value: doors_move

on the left door put
key: targetname
value: myleftdoor

and on the right door put
key: targetname
value: myrightdoor

and on the players put
key: targetname
value: player

then fingers crossed this'll b just what your looking for :D

Posted: Sun Mar 23, 2003 6:24 pm
by Jack Ruby
Cheers Nuggets, I owe you one,

Jack