HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Opening and Closing Gates Problems

03-25-2004, 04:33 AM#1
Chaos_Sentinal
OK anyone who is reading this and may know how to help, my problem is that my gates for some reason after i open them if i close them the people can walk through them.

What I did was i set it so when player types whatever right, then if destructible blah blah blah = alive then set variable gatehealth = the current health of the gate, then open that gate, and then set the gates health to the variable just so that it wont have 0 health and screw up my close gates command. Else do nothing, but then when i close the gate units can walk through it. The close gate command is, if destructible blah blah = alive then close gate, else do nothing.

So if anyone has any idea of what have done to make this mess up like that please let me know how to fix it, it is really getting anoying.
03-25-2004, 05:49 AM#2
Ligature
Maybe you want not "if gate X is alive then open gate X" but "if gate X has health greater than zero then open gate X." Or maybe an open gate just always counts as having zero health and being dead...
03-26-2004, 01:13 AM#3
Chaos_Sentinal
sorry that wont work cuz then when it closes it will have 0 health

even if i set it so that the health goes to the variable when it closes because someone may open the gate then it saves the gates health as the variable, then say someone else opens the gate when it is already open, it then sets the variable to 0 because that is what the gates health would be at when it is open.

But thanx for trying to help me.
03-26-2004, 02:31 AM#4
linkmaster23
Or maybe, you could post your triggers and save us the constant 'blah'.
03-26-2004, 02:58 AM#5
Chaos_Sentinal
OK then if you want to see them here they are.

Code:
All Outer Gates
    Events
        Player - Player 3 (Teal) types a chat message containing Open Outer as An exact match
        Player - Player 7 (Green) types a chat message containing Open Outer as An exact match
        Player - Player 8 (Pink) types a chat message containing Open Outer as An exact match
        Player - Player 9 (Gray) types a chat message containing Open Outer as An exact match
        Player - Player 10 (Light Blue) types a chat message containing Open Outer as An exact match
        Player - Player 11 (Dark Green) types a chat message containing Open Outer as An exact match
        Player - Player 12 (Brown) types a chat message containing Open Outer as An exact match
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0000 <gen> is alive) Equal to True
            Then - Actions
                Set OutNorth1Health = (Integer((Current life of Elven Gate (Horizontal) 0000 <gen>)))
                Destructible - Open Elven Gate (Horizontal) 0000 <gen>
                Destructible - Set life of Elven Gate (Horizontal) 0000 <gen> to (Real(OutNorth1Health))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0001 <gen> is alive) Equal to True
            Then - Actions
                Set OutNorth2Health = (Integer((Current life of Elven Gate (Horizontal) 0001 <gen>)))
                Destructible - Open Elven Gate (Horizontal) 0001 <gen>
                Destructible - Set life of Elven Gate (Horizontal) 0001 <gen> to (Real(OutNorth2Health))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0006 <gen> is alive) Equal to True
            Then - Actions
                Set OutEast1Health = (Integer((Current life of Elven Gate (Vertical) 0006 <gen>)))
                Destructible - Open Elven Gate (Vertical) 0006 <gen>
                Destructible - Set life of Elven Gate (Vertical) 0006 <gen> to (Real(OutEast1Health))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0007 <gen> is alive) Equal to True
            Then - Actions
                Set OutEast2Health = (Integer((Current life of Elven Gate (Vertical) 0007 <gen>)))
                Destructible - Open Elven Gate (Vertical) 0007 <gen>
                Destructible - Set life of Elven Gate (Vertical) 0007 <gen> to (Real(OutEast2Health))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0002 <gen> is alive) Equal to True
            Then - Actions
                Set OutSouth1Health = (Integer((Current life of Elven Gate (Horizontal) 0002 <gen>)))
                Destructible - Open Elven Gate (Horizontal) 0002 <gen>
                Destructible - Set life of Elven Gate (Horizontal) 0002 <gen> to (Real(OutSouth1Health))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0111 <gen> is alive) Equal to True
            Then - Actions
                Set OutSouth2Health = (Integer((Current life of Elven Gate (Horizontal) 0003 <gen>)))
                Destructible - Open Elven Gate (Horizontal) 0003 <gen>
                Destructible - Set life of Elven Gate (Horizontal) 0003 <gen> to (Real(OutSouth2Health))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0004 <gen> is alive) Equal to True
            Then - Actions
                Set OutWest1Health = (Integer((Current life of Elven Gate (Vertical) 0004 <gen>)))
                Destructible - Open Elven Gate (Vertical) 0004 <gen>
                Destructible - Set life of Elven Gate (Vertical) 0004 <gen> to (Real(OutWest1Health))
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0005 <gen> is alive) Equal to True
            Then - Actions
                Set OutWest2Health = (Integer((Current life of Elven Gate (Vertical) 0005 <gen>)))
                Destructible - Open Elven Gate (Vertical) 0005 <gen>
                Destructible - Set life of Elven Gate (Vertical) 0005 <gen> to (Real(OutWest2Health))
            Else - Actions
                Do nothing

And this is the close gates trigger

Code:
Close Gates
    Events
        Player - Player 3 (Teal) types a chat message containing close gates as An exact match
        Player - Player 7 (Green) types a chat message containing close gates as An exact match
        Player - Player 8 (Pink) types a chat message containing close gates as An exact match
        Player - Player 9 (Gray) types a chat message containing close gates as An exact match
        Player - Player 10 (Light Blue) types a chat message containing close gates as An exact match
        Player - Player 11 (Dark Green) types a chat message containing close gates as An exact match
        Player - Player 12 (Brown) types a chat message containing close gates as An exact match
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0104 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Horizontal) 0104 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0107 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Horizontal) 0107 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0003 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Horizontal) 0003 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0070 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Vertical) 0070 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0073 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Vertical) 0073 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0108 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Vertical) 0108 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0109 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Vertical) 0109 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0105 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Horizontal) 0105 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0106 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Horizontal) 0106 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0110 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Vertical) 0110 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0111 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Vertical) 0111 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0000 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Horizontal) 0000 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0001 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Horizontal) 0001 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0006 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Vertical) 0006 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0007 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Vertical) 0007 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Horizontal) 0002 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Horizontal) 0002 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0004 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Vertical) 0004 <gen>
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Elven Gate (Vertical) 0005 <gen> is alive) Equal to True
            Then - Actions
                Destructible - Close Elven Gate (Vertical) 0005 <gen>
            Else - Actions
                Do nothing
03-26-2004, 07:03 PM#6
linkmaster23
For starters, set all those gates to a doodad array. Then run a for-loop to do all that repititive stuff. THEN show me.
03-26-2004, 08:19 PM#7
Ligature
So wait... what actually happens when you type "close gates?"
03-26-2004, 11:36 PM#8
linkmaster23
It closes all the gates on the map. If he set them to a Doodad Array, then all he would have to do is for each interger 1 to # of gates do close gate[interger A]. It would take 1 action. Bada!
03-27-2004, 01:18 AM#9
Chaos_Sentinal
The only prob with the array idea is that it will close all the gates fine but it will do it even if it dead and therefore the gates get full health again.
03-27-2004, 01:22 AM#10
Chaos_Sentinal
I think i have my problem worked out. If You want to see the trigger Let me know, It took me alot to figure it out.
03-27-2004, 02:18 AM#11
linkmaster23
Did ya use arrays like a good boy?
03-27-2004, 04:18 AM#12
Chaos_Sentinal
Absolutely not i got 18 gates in my map and i wanted each to open and clsoe depending on if they were alive, which to me is meaning not destroyed.

So I didnt use your array suggestion but i got it working perfectly.
It has like 54 variables to get it all right, but hey it works great.
03-27-2004, 04:29 AM#13
Chaos_Sentinal
This is the trigger if ya wanna take a look

0 for gate alive or dead = alive and 1 = dead
0 for gate open or closed = closed and 1 = open

Code:
Gate Alive or Dead
    Events
        Game - OutNorth1Health becomes Equal to 0.00
    Conditions
    Actions
        Set OuterNorth1Alive = 1

Code:
Open Outer North Gates
    Events
        Player - Player 3 (Teal) types a chat message containing Open Outer North as An exact match
        Player - Player 7 (Green) types a chat message containing Open Outer North as An exact match
        Player - Player 8 (Pink) types a chat message containing Open Outer North as An exact match
        Player - Player 9 (Gray) types a chat message containing Open Outer North as An exact match
        Player - Player 10 (Light Blue) types a chat message containing Open Outer North as An exact match
        Player - Player 11 (Dark Green) types a chat message containing Open Outer North as An exact match
        Player - Player 12 (Brown) types a chat message containing Open Outer North as An exact match
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Real(OuterNorth1Alive)) Equal to 0.00) and ((Real(OuterNorth1Open)) Equal to 0.00)
            Then - Actions
                Set OutNorth1Health = (Real((Integer((Current life of Elven Gate (Horizontal) 0000 <gen>)))))
                Destructible - Open Elven Gate (Horizontal) 0000 <gen>
                Set OuterNorth1Open = 1
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  


Code:
Close Gates
    Events
        Player - Player 3 (Teal) types a chat message containing close gates as An exact match
        Player - Player 7 (Green) types a chat message containing close gates as An exact match
        Player - Player 8 (Pink) types a chat message containing close gates as An exact match
        Player - Player 9 (Gray) types a chat message containing close gates as An exact match
        Player - Player 10 (Light Blue) types a chat message containing close gates as An exact match
        Player - Player 11 (Dark Green) types a chat message containing close gates as An exact match
        Player - Player 12 (Brown) types a chat message containing close gates as An exact match
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Real(OuterNorth1Alive)) Equal to 0.00) and ((Real(InnerNorth1Open)) Equal to 1.00)
            Then - Actions
                Destructible - Close Elven Gate (Horizontal) 0000 <gen>
                Destructible - Set life of Elven Gate (Horizontal) 0000 <gen> to OutNorth1Health
                Set OuterNorth1Open = 0
            Else - Actions
                Do nothing

I only put the trigger of one gate opning and closing or you would be here reading like 5 or 6 pages.