• 🏆 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!

[Trigger] A base that can be dual!

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
332
How can I make a base that can be owned/claimed by two players?! (should I make new rect for hole base?!)
And somehow the order id only works for Obelisk! (so when other players try to build something into that base, it should be canceled). And when I destroyed the flag, why the base is not released?!?
a.jpg

  • Bases
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Rects_Bases[1] = Rect 014 <gen>
      • Set Rects_Bases[1] = Rect 014a <gen>
      • Set Rects_Bases[1] = Rect 014b <gen>
      • Set Rects_Bases[2] = Rect 014 <gen>
      • Set Rects_Bases[2] = Rect 042 <gen>
      • Set Rects_Bases[2] = Rect 042a <gen>
      • Set Integers_BaseBegin[1] = 1
      • Set Integers_BaseEnd[1] = 2
      • Set Integers_BaseBegin[2] = 1
      • Set Integers_BaseEnd[2] = 2
      • -------- --------
      • -------- Next Base --------
      • -------- --------
      • Set Rects_Bases[3] = Rect 015 <gen>
      • Set Rects_Bases[3] = Rect 015a <gen>
      • Set Integers_BaseBegin[3] = 3
      • Set Integers_BaseEnd[3] = 3
      • -------- --------
      • -------- Next Base --------
      • -------- --------
      • Set Rects_Bases[4] = Rect 016 <gen>
      • Set Rects_Bases[4] = Rect 016a <gen>
      • Set Integers_BaseBegin[4] = 4
      • Set Integers_BaseEnd[4] = 4
      • -------- --------
      • -------- Next Base --------
      • -------- --------
      • Set Rects_Bases[5] = Rect 017 <gen>
      • Set Rects_Bases[5] = Rect 017a <gen>
      • Set Integers_BaseBegin[5] = 5
      • Set Integers_BaseEnd[5] = 5
      • -------- --------
      • -------- Next Base --------
      • -------- --------
      • Set Rects_Bases[6] = Rect 018 <gen>
      • Set Rects_Bases[6] = Rect 018a <gen>
      • Set Integers_BaseBegin[6] = 6
      • Set Integers_BaseEnd[6] = 6
      • -------- --------
      • -------- Next Base --------
      • -------- --------
      • Set Rects_Bases[7] = Rect 019 <gen>
      • Set Rects_Bases[7] = Rect 019a <gen>
      • Set Integers_BaseBegin[7] = 7
      • Set Integers_BaseEnd[7] = 7
      • -------- --------
      • -------- Total Bases --------
      • -------- --------
      • Set Integer_BasesTotal = 7
      • -------- --------
      • -------- Set owner of all bases to passive --------
      • -------- --------
      • For each (Integer A) from 1 to Integer_BasesTotal, do (Actions)
        • Loop - Actions
          • Set PlayerGroups_BaseOwner[(Integer A)] = Player Group - Neutral Passive
  • Claim Base
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Constructing structure)) Equal to Obelisk
    • Actions
      • For each (Integer A) from 1 to Integer_BasesTotal, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Rects_Bases[(Integer A)] contains (Constructing structure)) Equal to True
            • Then - Actions
              • Set Integer_BaseBeginUsed = Integers_BaseBegin[(Integer A)]
              • Set Integer_BaseEndUsed = Integers_BaseEnd[(Integer A)]
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Players_BaseOwner[Integer_BaseBeginUsed] Equal to (Triggering player)
        • Then - Actions
          • Set PlayerGroup = (Player group((Triggering player)))
          • Game - Display to PlayerGroup the text: (Strings_PlayerColors[(Player number of (Owner of (Constructing structure)))] + ((Name of (Owner of (Constructing structure))) + (|r + you already claimed this base.)))
          • Custom script: call DestroyForce(udg_PlayerGroup)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Players_BaseOwner[Integer_BaseBeginUsed] Not equal to Neutral Passive
            • Then - Actions
              • Wait 0.00 seconds
              • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851976)
              • Set PlayerGroup = (Player group((Triggering player)))
              • Game - Display to PlayerGroup the text: (Strings_PlayerColors[(Player number of (Owner of (Constructing structure)))] + ((Name of (Owner of (Constructing structure))) + (|r + this base is already claimed.)))
              • Custom script: call DestroyForce(udg_PlayerGroup)
            • Else - Actions
              • Set PlayerGroup = PlayerGroup_Humans
              • Game - Display to PlayerGroup the text: (Strings_PlayerColors[(Player number of (Owner of (Constructing structure)))] + ((Name of (Owner of (Constructing structure))) + (|r + ( has claimed base + ((String(Integer_BaseBeginUsed)) + .)))))
              • Custom script: call DestroyForce(udg_PlayerGroup)
              • Set Players_BaseOwner[Integer_BaseBeginUsed] = (Triggering player)
              • Set Integers_BaseBeginClaimed[(Player number of (Triggering player))] = Integer_BaseBeginUsed
              • Set Integers_BaseEndClaimed[(Player number of (Triggering player))] = Integer_BaseEndUsed
      • Set Integer_BaseBeginUsed = 0
      • Set Integer_BaseEndUsed = 0
  • Release Base
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Flag
    • Actions
      • For each (Integer A) from 1 to Integer_BasesTotal, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Rects_Bases[(Integer A)] contains (Dying unit)) Equal to True
            • Then - Actions
              • Set Integer_BaseBeginUsed = Integers_BaseBegin[(Integer A)]
              • Set Integer_BaseEndUsed = Integers_BaseEnd[(Integer A)]
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Players_BaseOwner[Integer_BaseBeginUsed] Equal to (Triggering player)
        • Then - Actions
          • Set PlayerGroup = PlayerGroup_Humans
          • Game - Display to PlayerGroup the text: (Strings_PlayerColors[(Player number of (Owner of (Dying unit)))] + ((Name of (Owner of (Dying unit))) + (|r + ( has released base + ((String(Integer_BaseBeginUsed)) + .)))))
          • Custom script: call DestroyForce(udg_PlayerGroup)
          • Set Players_BaseOwner[Integer_BaseBeginUsed] = Neutral Passive
          • Set Integers_BaseBeginClaimed[(Player number of (Triggering player))] = 0
          • Set Integers_BaseEndClaimed[(Player number of (Triggering player))] = 0
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Players_BaseOwner[Integer_BaseBeginUsed] Not equal to Neutral Passive
            • Then - Actions
              • Set PlayerGroup = (Player group((Triggering player)))
              • Game - Display to PlayerGroup the text: (Strings_PlayerColors[(Player number of (Owner of (Dying unit)))] + ((Name of (Owner of (Dying unit))) + (|r + you can't release another player's base.)))
              • Custom script: call DestroyForce(udg_PlayerGroup)
            • Else - Actions
      • Set Integer_BaseBeginUsed = 0
      • Set Integer_BaseEndUsed = 0
 
Last edited:
Level 12
Joined
Jun 15, 2016
Messages
472
How can I make a base that can be owned/claimed by two players?! (should I make new rect for hole base?!)

Looking at your trigger, you can set Players_BaseOwner to an array of player groups. Then you set two base owners.

And somehow the order id only works for Obelisk! (so when other players try to build something into that base, it should be canceled).

I assume you mean the second trigger. The order id should work for any building, but you gave a condition that the constructed building is an obelisk, so only the obelisk gets cancelled. Remove the condition and get the same functionality for all buildings.

For the last question, you're checking if any unit dies in the rect of some base. It doesn't have to be the flag according to your trigger. Maybe that gives a different base to compare to?
 
Level 10
Joined
Jun 20, 2017
Messages
332
Well, obelisk can claim bases and the flag is for release, so if I remove the obelisk on the second trigger, then I cannot claim/build anything in anywhere. For example, I've made some regions on some bases, so if someone in that area has a base, so you cannot build anything, but if he does not have that base with obelisk, then you can build.
 
Status
Not open for further replies.
Top