Animated Doors !

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Animated Doors !

Post 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
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
Yarik
General
Posts: 1031
Joined: Thu Jan 09, 2003 7:12 pm
Contact:

Post by Yarik »

This involves scripting and a few brushes with somekind of func
Skype: Yarik_usa
www.skype.com <---free pc2pc phone
Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post 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
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post 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
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post 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
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post by Jack Ruby »

Cheers Nuggets, I owe you one,

Jack
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
Post Reply