I have several doors made out of script object. they contain two parts, an upper half and lower half. When triggered I want the door to open with the uppoer half moving up and the lower half moving down. I was thinking I could set up one large trigger to cover both sides of the door so when a player stands in the trigger it will activate the door in front of him. I am trying to do this for about 12 doors and did not want to make seperate targetnames for each trigger, lower half of door, and upper half of door. Something like:
for (local.i=1;local.i<=$lowerhalf.size;local.i++)
something like that to where i can use the same targetname for all triggers. Same targetname for all lower half door parts, and upper half door parts.
I am making a custom map, this is not a serverside script. I cant seem to figure out how to target each door part to move accordingly and how to make the trigger work so that the doors will operate correctly, without continually moving up or down. I know how to make things move and set variables for open and closed. I just cant figure out how to put it all together.
Any help most appreciated.
G3mInI
want to simplify scripting...help please
Moderator: Moderators
why not have (i think this si what u mean.
2 doors. Up and down parts named up and down for this example . script objects
$up and $down
1 trigger over both sides. $trigger_door
2 doors. Up and down parts named up and down for this example . script objects
$up and $down
1 trigger over both sides. $trigger_door
Code: Select all
open:
$trigger_door nottriggerable
$up moveup 500
$up move
$down movedown 500
$down waitmove
while(parm.other istouching self){ waitframe} //wait while person is at door so dont close on them.
wait 1 //wait delay
//close the doors again
$trigger_door nottriggerable
$up movedown 500
$up move
$down moveup 500
$down waitmove
$trigger_door triggerable
i'm no sure, but can you declare 2-dimensional arrays in MoH? i know some variables use it but are they coded right in?
Code: Select all
local.thing[1] ....
local.thing[2] ....Moderator
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
Code: Select all
open:
$trigger_door nottriggerable
$up moveup 500
$up move
$down movedown 500
$down waitmove
while(parm.other istouching self){ waitframe} //wait while person is at door so dont close on them.
wait 1 //wait delay
//close the doors again
$trigger_door nottriggerable
$up movedown 500
$up move
$down moveup 500
$down waitmove
$trigger_door triggerable
open:
$trigger_door nottriggerable
$up moveup 500
$up move
$down movedown 500
$down waitmove
while(parm.other istouching self){ waitframe} //wait while person is at door so dont close on them.
wait 1 //wait delay
//close the doors again
$trigger_door nottriggerable
$up movedown 500
$up move
$down moveup 500
$down waitmove
$trigger_door triggerable G3m
Yes you can put arrays into arrays so that basically makes a multidimensional array... you could also use makeArraylizardkid wrote:i'm no sure, but can you declare 2-dimensional arrays in MoH? i know some variables use it but are they coded right in?Code: Select all
local.thing[1] .... local.thing[2] ....
Last edited by jv_map on Thu Feb 10, 2005 12:03 pm, edited 1 time in total.
actually i coded that wrong anyway
local.thing[1, 2]
think of it as a chessboard with 4x4 squares. 4 up, 4 sideways. this should make it easier, i've heard multidimensional arrays are easier on a systems memory than 1-d ones. but i doubt it makes too much difference.
either way probably works, it's just how you look at it
local.thing[1, 2]
think of it as a chessboard with 4x4 squares. 4 up, 4 sideways. this should make it easier, i've heard multidimensional arrays are easier on a systems memory than 1-d ones. but i doubt it makes too much difference.
either way probably works, it's just how you look at it
Moderator
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
Why not just use a func_door
If you open the entity window you can just use the U or D key in the middle of the angle keys . If you use lip you can decide how much of a lip is showing when the door is open ."angle" ( Float newAngle ) set the angles of the entity using just one value.
Sets the yaw of the entity or an up and down direction
if newAngle is [0-359] or -1 or -2

