• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Linking two teleporter w/o Waygate

Status
Not open for further replies.
Level 3
Joined
Mar 6, 2010
Messages
36
I've been trying to create a trigger that seems almost impossible for me to create. First I'm going to try to give you as much information as I can.

Here's the information:

There are 8 builders and 4 vampires, each of the 8 builders have something called "Base Control" which is a circle of power in each of the base's entrances. Inside of their base is something called "Harvester Control"(which is the teleporter to the Green Areas) which is also a circle of power. By accessing the Harvester control, players can manage their Green Areas(What their Harvester Circle of Power teleports them to) which is an area their Harvesters teleport for trees and harvesting. Only the harvesters and the vampire can access the Green Area, the builders cannot. Because of this, there are 8 different Green Areas, which are not assigned to any builder until a Harvester from the owner of the Base, which the Harvester Control is in, is entered. (<--confusing sentence, I know) Also, the Bases are not owned until entered by a Builder. Sooooo.. the problem here for me is the following:

In my trigger, I recognize who is entering the base, setting all necessary conditions (IE: checking the color of the player, seeing if he already owns a Green Area, etc).. I also check if their Green Area is closed or opened depending on the Owner's choice (they might not want their teammate's harvesters in their area, so they have the option to close the harvester area to keep them from going inside)

So when the Builder first gets their Base, they still don't have a Green Area until they enter the Harvester Control circle of power, which RANDOMLY PICKS ONE OF THE 8 GREEN AREAS THAT ARE NOT CONTROLLED CURRENTLY and teleports their harvester to it, so after that happens, those two teleporters (the Harvester Control and the Green Area) are now connected.. so my problem is this: I cannot connect the two circle of powers together and assigned to that player.

This is what I've tried doing:
-using unit groups to easily and randomly teleport and link(which doesn't work for me for some odd reason)

So, as you can see, I hope you have enough information about my current situation concerning this trigger.


Long story short, I need the teleporters to link with eachother and also account the necessary conditions whenever the teleporter is entered by a vampire or a Harvester.


If you need any more information, let me know. Also, I can PM you the map if you're interested in seeing the triggers and my 100 variables for messy triggers (this is why I don't want to post it, it's very hard to understand the variables I use and the triggers associated with them)

Thanks to any help, and +rep to it as well.
Refer to the images on the bottom for additional information.

I want to tell you guys the conditions that I need to checked for when the Harvester Teleporter is first entered and after they're assigned here they are.

When it's first entered:
-Check which player (1-8)
-What base they own (1-9)
-If it's not the owner's Harvester that's entering, it won't do anything
-It only activates if the Harvester enters it, not vampire/builder

After the two teleporters are linked:
-Check if it's open/closed if it's not the owner's harvester
-check if it's a vampire
-Check if they still own the base that the harvester teleporter is in
-If it is closed, it will port the other harvesters to the side of the teleporter

Will add more if I missed anything.


CODE:

Here is how each of the triggers I'm linking work.

I made, in total, 24 triggers because I have 8 bases. (3 [the triggers] times[x] 8[How many bases there are)

The first three triggers are for Base 1 out of 8.

The first one is when the player's Harvester FIRST enters the Harvester Control Teleporter. It then moves the Harvester to a random unit from the HarvesterTP_Group(which is the green areas), after that, the trigger is turned off and the second trigger is then activated.

The second one activates when the unit ENTERS the green area, then it removes the Green Area Teleporter from the HarvesterTP_Group and puts it into the owner's TP group(PlayerHarvestArea1), this group will ONLY HAVE the player's Green Area Teleporter in it. This one is now turned off and the third one is activated.

The third one is turned on automatically with the second one. It just checks if the Green Area is closed, if it's a harvester or not, etc.. all those necessary conditions that I've stated previously.


Things you should know:
-P1B1, etc means he is player one and that he owns base 1, etc.
-Survivor = the Builder
-P1OPEN checks if the Harvester Control Teleporter is Open
-Base1Cntrl checks if the base is in control or not.
-InsideHarvester TP1 means he's inside the Green Area.
-HarvOpen checks if the player has an open Green Area for his teammates.
-Used unit groups to get the random teleports, then I remove the unit from the available Green Area Group and put it in the Player's Teleporter Group after to make them link.
-This is for the third trigger: "PlayerHarvestArea1" is the ONE unit inside the player's Teleporter Group, it is the green area.
-

Any other questions.. please lemme know.
FIRST TRIGGER:

  • ENTER H TP 1 START
    • Events
      • Unit - A unit enters Harvester TP 1 <gen>
    • Conditions
      • Base1Cntrl Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Harvester
          • (Unit-type of (Triggering unit)) Equal to Vampire
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • P1B1 Equal to True
              • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from HarvestTP_Group))
          • Special Effect - Destroy SpecialEffect
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: You are not in cont...
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • P2B1 Equal to True
              • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from HarvestTP_Group))
          • Special Effect - Destroy SpecialEffect
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: You are not in cont...
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • P3B1 Equal to True
              • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from HarvestTP_Group))
          • Special Effect - Destroy SpecialEffect
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: You are not in cont...
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • P4B1 Equal to True
              • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from HarvestTP_Group))
          • Special Effect - Destroy SpecialEffect
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: You are not in cont...
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • P5B1 Equal to True
              • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from HarvestTP_Group))
          • Special Effect - Destroy SpecialEffect
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: You are not in cont...
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • P6B1 Equal to True
              • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from HarvestTP_Group))
          • Special Effect - Destroy SpecialEffect
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: You are not in cont...
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • P7B1 Equal to True
              • (Owner of (Triggering unit)) Equal to Player 7 (Green)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from HarvestTP_Group))
          • Special Effect - Destroy SpecialEffect
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: You are not in cont...
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • P8B1 Equal to True
              • (Owner of (Triggering unit)) Equal to Player 8 (Pink)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from HarvestTP_Group))
          • Special Effect - Destroy SpecialEffect
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: You are not in cont...
          • Skip remaining actions
      • Game - Display to (All players) the text: ONE
      • Trigger - Turn off (This trigger)
SECOND TRIGGER:

  • InsHarv 1
    • Events
      • Unit - A unit enters INSIDE HarvTP1 <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Harvester
          • (Unit-type of (Triggering unit)) Equal to Vampire
    • Actions
      • Unit Group - Remove Circle of Power 0008 <gen> from HarvestTP_Group
      • Set HarvCntrl1 = True
      • Set HarvOpen1 = True
      • Unit - Change ownership of Circle of Power 0008 <gen> to (Owner of (Triggering unit)) and Change color
      • Set H_TP_1 = True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Unit Group - Add Circle of Power 0008 <gen> to PlayerHarvestArea1
          • Set HarvCntrl1 = True
          • Set P1OPEN = True
          • If (P1B1 Equal to True) then do (Trigger - Turn on H1 CLOSED <gen>) else do (Do nothing)
          • If (P1B2 Equal to True) then do (Trigger - Turn on H2 CLOSED <gen>) else do (Do nothing)
          • If (P1B3 Equal to True) then do (Trigger - Turn on H3 CLOSED <gen>) else do (Do nothing)
          • If (P1B4 Equal to True) then do (Trigger - Turn on H4 CLOSED <gen>) else do (Do nothing)
          • If (P1B5 Equal to True) then do (Trigger - Turn on H5 CLOSED <gen>) else do (Do nothing)
          • If (P1B6 Equal to True) then do (Trigger - Turn on H6 CLOSED <gen>) else do (Do nothing)
          • If (P1B7 Equal to True) then do (Trigger - Turn on H7 CLOSED <gen>) else do (Do nothing)
          • If (P1B8 Equal to True) then do (Trigger - Turn on H8 CLOSED <gen>) else do (Do nothing)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
            • Then - Actions
              • Unit Group - Add Circle of Power 0008 <gen> to PlayerHarvestArea2
              • Set HarvCntrl1 = True
              • Set P2OPEN = True
              • If (P2B1 Equal to True) then do (Trigger - Turn on H1 CLOSED <gen>) else do (Do nothing)
              • If (P2B2 Equal to True) then do (Trigger - Turn on H2 CLOSED <gen>) else do (Do nothing)
              • If (P2B3 Equal to True) then do (Trigger - Turn on H3 CLOSED <gen>) else do (Do nothing)
              • If (P2B4 Equal to True) then do (Trigger - Turn on H4 CLOSED <gen>) else do (Do nothing)
              • If (P2B5 Equal to True) then do (Trigger - Turn on H5 CLOSED <gen>) else do (Do nothing)
              • If (P2B6 Equal to True) then do (Trigger - Turn on H6 CLOSED <gen>) else do (Do nothing)
              • If (P2B7 Equal to True) then do (Trigger - Turn on H7 CLOSED <gen>) else do (Do nothing)
              • If (P2B8 Equal to True) then do (Trigger - Turn on H8 CLOSED <gen>) else do (Do nothing)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                • Then - Actions
                  • Unit Group - Add Circle of Power 0008 <gen> to PlayerHarvestArea3
                  • Set HarvCntrl1 = True
                  • Set P3OPEN = True
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                    • Then - Actions
                      • Unit Group - Add Circle of Power 0008 <gen> to PlayerHarvestArea4
                      • Set HarvCntrl1 = True
                      • Set P4OPEN = True
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                        • Then - Actions
                          • Unit Group - Add Circle of Power 0008 <gen> to PlayerHarvestArea5
                          • Set HarvCntrl1 = True
                          • Set P5OPEN = True
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                            • Then - Actions
                              • Unit Group - Add Circle of Power 0008 <gen> to PlayerHarvestArea6
                              • Set HarvCntrl1 = True
                              • Set P6OPEN = True
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Owner of (Triggering unit)) Equal to Player 7 (Green)
                                • Then - Actions
                                  • Unit Group - Add Circle of Power 0008 <gen> to PlayerHarvestArea7
                                  • Set HarvCntrl1 = True
                                  • Set P7OPEN = True
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Owner of (Triggering unit)) Equal to Player 8 (Pink)
                                    • Then - Actions
                                      • Unit Group - Add Circle of Power 0008 <gen> to PlayerHarvestArea8
                                      • Set HarvCntrl1 = True
                                      • Set P8OPEN = True
                                    • Else - Actions
      • Trigger - Turn off (This trigger)
THIRD TRIGGER:

  • H1 CLOSED
    • Events
      • Unit - A unit enters Harvester TP 1 <gen>
    • Conditions
      • Base1Cntrl Equal to True
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Harvester
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea1))
          • Special Effect - Destroy SpecialEffect
          • Skip remaining actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • P1OPEN Equal to True
            • Then - Actions
              • Set UNIT = (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
              • Set SpecialEffect = (Last created special effect)
              • Wait 1.00 seconds
              • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea1))
              • Special Effect - Destroy SpecialEffect
              • Skip remaining actions
            • Else - Actions
              • Game - Display to (Player group((Triggering player))) the text: ((Name of Player 1 (Red)) + has denied access of all Survivors from entering the base.)
              • Unit - Move (Triggering unit) instantly to (Center of B1 P1 <gen>)
              • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea2))
          • Special Effect - Destroy SpecialEffect
          • Skip remaining actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • P2OPEN Equal to True
            • Then - Actions
              • Set UNIT = (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
              • Set SpecialEffect = (Last created special effect)
              • Wait 1.00 seconds
              • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea2))
              • Special Effect - Destroy SpecialEffect
              • Skip remaining actions
            • Else - Actions
              • Game - Display to (Player group((Triggering player))) the text: ((Name of Player 2 (Blue)) + has denied access of all Survivors from entering the base.)
              • Unit - Move (Triggering unit) instantly to (Center of B1 P1 <gen>)
              • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea3))
          • Special Effect - Destroy SpecialEffect
          • Skip remaining actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • P3OPEN Equal to True
            • Then - Actions
              • Set UNIT = (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
              • Set SpecialEffect = (Last created special effect)
              • Wait 1.00 seconds
              • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea3))
              • Special Effect - Destroy SpecialEffect
              • Skip remaining actions
            • Else - Actions
              • Game - Display to (Player group((Triggering player))) the text: ((Name of Player 3 (Teal)) + has denied access of all Survivors from entering the base.)
              • Unit - Move (Triggering unit) instantly to (Center of B1 P1 <gen>)
              • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea4))
          • Special Effect - Destroy SpecialEffect
          • Skip remaining actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • P4OPEN Equal to True
            • Then - Actions
              • Set UNIT = (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
              • Set SpecialEffect = (Last created special effect)
              • Wait 1.00 seconds
              • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea4))
              • Special Effect - Destroy SpecialEffect
              • Skip remaining actions
            • Else - Actions
              • Game - Display to (Player group((Triggering player))) the text: ((Name of Player 4 (Purple)) + has denied access of all Survivors from entering the base.)
              • Unit - Move (Triggering unit) instantly to (Center of B1 P1 <gen>)
              • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea5))
          • Special Effect - Destroy SpecialEffect
          • Skip remaining actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • P5OPEN Equal to True
            • Then - Actions
              • Set UNIT = (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
              • Set SpecialEffect = (Last created special effect)
              • Wait 1.00 seconds
              • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea5))
              • Special Effect - Destroy SpecialEffect
              • Skip remaining actions
            • Else - Actions
              • Game - Display to (Player group((Triggering player))) the text: ((Name of Player 5 (Yellow)) + has denied access of all Survivors from entering the base.)
              • Unit - Move (Triggering unit) instantly to (Center of B1 P1 <gen>)
              • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea6))
          • Special Effect - Destroy SpecialEffect
          • Skip remaining actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • P6OPEN Equal to True
            • Then - Actions
              • Set UNIT = (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
              • Set SpecialEffect = (Last created special effect)
              • Wait 1.00 seconds
              • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea6))
              • Special Effect - Destroy SpecialEffect
              • Skip remaining actions
            • Else - Actions
              • Game - Display to (Player group((Triggering player))) the text: ((Name of Player 6 (Orange)) + has denied access of all Survivors from entering the base.)
              • Unit - Move (Triggering unit) instantly to (Center of B1 P1 <gen>)
              • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 7 (Green)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea7))
          • Special Effect - Destroy SpecialEffect
          • Skip remaining actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • P7OPEN Equal to True
            • Then - Actions
              • Set UNIT = (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
              • Set SpecialEffect = (Last created special effect)
              • Wait 1.00 seconds
              • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea7))
              • Special Effect - Destroy SpecialEffect
              • Skip remaining actions
            • Else - Actions
              • Game - Display to (Player group((Triggering player))) the text: ((Name of Player 7 (Green)) + has denied access of all Survivors from entering the base.)
              • Unit - Move (Triggering unit) instantly to (Center of B1 P1 <gen>)
              • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 8 (Pink)
        • Then - Actions
          • Set UNIT = (Triggering unit)
          • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Set SpecialEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea8))
          • Special Effect - Destroy SpecialEffect
          • Skip remaining actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • P8OPEN Equal to True
            • Then - Actions
              • Set UNIT = (Triggering unit)
              • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
              • Set SpecialEffect = (Last created special effect)
              • Wait 1.00 seconds
              • Unit - Move UNIT instantly to (Position of (Random unit from PlayerHarvestArea8))
              • Special Effect - Destroy SpecialEffect
              • Skip remaining actions
            • Else - Actions
              • Game - Display to (Player group((Triggering player))) the text: ((Name of Player 8 (Pink)) + has denied access of all Survivors from entering the base.)
              • Unit - Move (Triggering unit) instantly to (Center of B1 P1 <gen>)
              • Skip remaining actions
      • Game - Display to (All players) the text: THREE


Note: Sorry for the HUGE wall of text, it's just that I'm not very good with the editor, and I've been asking on multiple help-sites and I never got the help I needed. Thanks to any help!
 
Level 10
Joined
Mar 31, 2009
Messages
732
Your triggers are a horrible ugly mess.
Please learn how to use arrays and rewrite them to be much shorter with no duplicated commands.

As for your problem, give me a short version of what the problem is (I'm not going to read through everything you wrote yet) and the section of the code you think is not working.
 
Level 3
Joined
Mar 6, 2010
Messages
36
Your triggers are a horrible ugly mess.
Please learn how to use arrays and rewrite them to be much shorter with no duplicated commands.

As for your problem, give me a short version of what the problem is (I'm not going to read through everything you wrote yet) and the section of the code you think is not working.

I gave you a TON of information, if you're not willing to read the post, then don't even bother replying. As for the arrays, I expected this site to be "newb" friendly. I am not the best with the editor, and I gave you guys as much information as possible to get the help I need.

I know my triggers are horrible, but I don't need to be told that. All I want (and all I expect) is a reply that atleast attempts to solve my problem.

Refer to the bolded words: Long story short

It was meant for people like you. :p
 
Level 10
Joined
Mar 31, 2009
Messages
732
In your first and third triggers, your Trigger - Wait has the potential to cause problems, when you're using globals before and after the waits. I suggest for a start, moving the Trigger - Disable to before the wait.

I can't find in your lengthy post what is actually not working. Tell me what is not working, and if you want, post your map and I will try and get it working.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
OK instead of making 8 different variables just make ONE variable as an ARRAY called B1. And another variable called Go. Then, do this - it will make it 8 times easier to make any changes:
  • ENTER H TP 1 START
  • Events
    • Unit - A unit enters Harvester TP 1 <gen>
  • Conditions
    • Base1Cntrl Equal to True
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Harvester
        • (Unit-type of (Triggering unit)) Equal to Vampire
  • Actions
    • Trigger - Turn off (This trigger)
    • Set Go = false
    • For each (Integer A) from 1 to 8 do
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • B1[Player Number of Player[(Integer A)]] Equal to True
            • (Owner of (Triggering unit)) Equal to Player[(Integer A)]
          • Then - Actions
            • Set Go = true
          • Else - Actions
    • If (Go = true) then
      • Then - Actions
        • Set UNIT = (Triggering unit)
        • Special Effect - Create a special effect attached to the chest of UNIT using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
        • Set SpecialEffect = (Last created special effect)
        • Wait 1.00 seconds
        • Unit - Move UNIT instantly to (Position of (Random unit from HarvestTP_Group))
        • Special Effect - Destroy SpecialEffect
        • Game - Display to (All players) the text: ONE
      • Else - Actions
        • Game - Display to (Player group((Triggering player))) the text: You are not in cont...
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
/////////////////////////////

Ignore this post! It is obsolete and I'm leaving it here for my personal reference

/////////////////////////////

OK, wait. The more I look at this, the more confused I get. So, if I understand you correctly, here are some tips. Use these tips, get yourself better organized, and come back and post when you can make a little more sense to us about what you're doing:

NOTE: Someone with vJass knowledge please check me to make sure I'm not messing this guy up:

1. You should really make use of a compacted variable for each base. This is sheerly impossible using GUI. Make a trigger at the top of your trigger list, right-click it and convert it to custom script.

2. Delete all that crap there and put this code:
JASS:
globals
    struct array base
endglobals
 
struct pair
    boolean open    // To control if allies can enter or not
    player owner    // To determine who owns the base
endstruct
 
function InitTrig_Boolean_Setup takes nothing returns nothing
    // Initialize values as false, integer i indicates each base
    // There are two basic ways to get a player's Id for actually setting the booleans:
    // GetPlayerId(GetTriggerPlayer()) and GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
    local integer i = 1
    loop
        set base[i] = pair.create()
        set base[i].open = false
        set base[i].owner = null
        set i = i + 1
        exitwhen i > 9
    endloop
endfunction
3. Now, that trigger is done. If I'm correct, you can adjust your booleans like this (in your other triggers):

  • Actions
    • -------- ------------------------
    • -------- For closing a player's base:
    • -------- ------------------------
    • Custom script: set base[1].open = false
    • -------- ------------------------
    • -------- ------------------------
    • -------- For opening a player's base:
    • -------- ------------------------
    • Custom script: set base[7].open = true
    • -------- ------------------------
    • -------- ------------------------
    • -------- By default, a base is closed
    • -------- ------------------------
    • -------- ------------------------
    • -------- When a player owns a base
    • -------- ------------------------
    • Custom script: set base[3].owner = GetOwningPlayer(GetTriggerUnit())
    • -------- ------------------------
    • -------- ------------------------
    • -------- When there are no players controlling a base
    • -------- ------------------------
    • Custom script: set base[4].owner = null
    • -------- ------------------------
    • -------- ------------------------
    • -------- By default, no one controls a base
    • -------- ------------------------
    • -------- ------------------------
// Note that, in the above, codes, 1,7,3,4 are just arbitrary numbers. You just want to replace those numbers with whatever base you're working with.

4. This will evaluate if any of the 8 players controls a base when a unit enters the circle of power:
  • Actions
    • Custom script: local integer i = 6
    • -------- Suppose you just entered the circle of power for base 6, otherwise change the above to local integer i = 3 or whatever number you want
    • Set Go = False
    • Custom script: if base[i].owner == null or base[i].owner == GetOwningPlayer(GetTriggerUnit()) or (IsPlayerAlly(base[i].owner, GetOwningPlayer(GetTriggerUnit())) and base[i].open = true) then
    • Set Go = True
    • Custom script: endif
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Go Equal to True
      • Then - Actions
        • -------- This happens if no one controls the base, or you already control it, or your ally allows it to be shared
      • Else - Actions
        • -------- This happens if another player controls that base, or the base is closed
I'll have more later. Please, someone check me to make sure I'm not going to mess this guy up!
 
Last edited:
Level 3
Joined
Mar 6, 2010
Messages
36
Bribe you really seem to know what it is I need.

Currently, I do not have the time to use that trigger, but I do have one question.

Does the "Go" variable mean he has teleported or? (I need an explanation for that variable)

Also, I'm a little confused with Jass you put up, I'll check this up tomorrow. The GUI you made seems like it's a step in the right direction, and I definately understand how this can make it easier!
Thank you.
 
Level 10
Joined
Mar 31, 2009
Messages
732
Yeah I was gonna write something like that, if he posts his map first.

Bribe you really seem to know what it is I need.

Currently, I do not have the time to use that trigger, but I do have one question.

Does the "Go" variable mean he's teleporting or? (I need an explanation for that variable)

Also, I'm a little confused with Jass you put up, I'll check this up tomorrow. The GUI you made seems like it's a step in the right direction, and I definately understand how this can make it easier!
Thank you.
I'm open to writing this for you if you post the map.
 
Last edited:

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
@Failenx, the JASS I gave you allows you to allocate a player and a open/closed boolean that is easily referenced by each base.

Instead of having a hundred booleans like you were trying to do, now you only need ONE. And, if you commit to this further, instead of having 8 different sets of 3 triggers, you only need one set of 3 triggers :)

I will help you make this work.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Wow, sorry, I was overcomplicating this. You don't need so much of that custom script I was giving you. You need an integer variable (called identity) and four variable arrays: a player array (called owner), a boolean array (called bool) and a boolean array (called open) and set the booleans to false. The fourth you get by changing PlayerHarvestArea1,2,3,4 etc. into Area[1,2,3,4 etc.]

The boolean "bool" replaces your "disable trigger" action for simplicity.

Instead of that stuff at the custom script trigger at the top of your map, replace it all with this code:

JASS:
globals
    region array base
endglobals
 
function SetEvents takes integer index, rect r returns nothing
    set base[index] = CreateRegion()
    call RegionAddRect( base[index], r )
    call TriggerRegisterEnterRegion( gg_trg_BaseTrigger, base[index], null )
endfunction
 
function BaseFilter takes nothing returns boolean
    local integer i = 1
    loop
        if GetTriggeringRegion() == base[i] then
            set udg_identity = i
        set i = i + 1
        exitwhen i > 8
    endloop
    return true
endfunction
 
function InitTrig_Regions takes nothing returns nothing
    call SetEvents( 1, gg_rct_Harvester_TP_1 )
    call SetEvents( 2, gg_rct_Harvester_TP_2 )
    call SetEvents( 3, gg_rct_Harvester_TP_3 )
    call SetEvents( 4, gg_rct_Harvester_TP_4 )
    call SetEvents( 5, gg_rct_Harvester_TP_5 )
    call SetEvents( 6, gg_rct_Harvester_TP_6 )
    call SetEvents( 7, gg_rct_Harvester_TP_7 )
    call SetEvents( 8, gg_rct_Harvester_TP_8 )
    call TriggerAddCondition( gg_trg_BaseTrigger, function BaseFilter )
endfunction

Next, make a new trigger (this will replace your trigger 1 and trigger 3, all 8 of them) called BaseTrigger. The custom script I gave you has programmed the Events and Conditions of this trigger, so leave those blank. The custom script also sets the identity integer, which tells you the region that you're working with =)

  • BaseTrigger
  • Events
  • Conditions
  • Actions
    • Set Go = False
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • open[identity] Equal to True
        • bool[identity] Equal to False
        • Or - Any (Conditions) are true
          • Conditions
            • (Unit-type of (Triggering unit)) Equal to Harvester
            • (Unit-type of (Triggering unit)) Equal to Vampire
      • Then - Actions
        • Set UNIT = (Random unit from HarvestTP_Group)
        • Set Go = True
      • Else - Actions
        • Set UNIT = (Random unit from Area[identity])
        • Set Go = True
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Go Equal to True
      • Then - Actions
        • Custom script: call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl", GetTriggerUnit(), "chest" ))
        • Wait 1.00 seconds
        • Unit - Move Triggering Unit instantly to (Position of (UNIT))
        • Custom script: call DestroyEffect( whichEffect )
      • Else - Actions
Note that I'm still working on this, so it's not finished, and it won't work correctly.
 
Last edited:
Level 3
Joined
Mar 6, 2010
Messages
36
I definately do have time for this, the only reason why I didn't have the time because it was 1 in the morning.

Like I said, I posted this on multiple help-sites, and I really do want this fixed.

EDIT: Here's the map, it's VERY messy, but I guess it'll help you guys out.
IMPORTANT: I deleted the triggers I posted here to restart, with any new help that I get.
The purpose of posting this is to see how the power of circles work and where the regions are.. etc.
 

Attachments

  • G-Vamps #4.w3x
    803.5 KB · Views: 43
Last edited:
Status
Not open for further replies.
Top