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

Need help with a bit of triggering

Status
Not open for further replies.
Level 2
Joined
Jun 17, 2013
Messages
9
First off sorry if this is in the wrong section.

Okay now to my question; I'm making a map for my friends and I to play on and I'd like to make capture points. So basically when you attack the building e.g. gold mine it becomes yours and gives you 100 gold every 30 seconds until someone else takes control of it.

I've seen a couple of tutorials on here but I'm a bit confused because they didn't go into a lot of detail for me to understand personally.

Thanks in advance for reading this and taking your time to help me.
 
Level 10
Joined
Jan 20, 2011
Messages
492
Make the building a certain race, so if you want it to belong to no one set the building to Neutral Passive, so then it is no ones, but you will want two triggers for if you are making it no one starts with a capture point.

  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player - Make Player 1 (Red) treat Neutral Passive as an Enemy
Remember this is not needed if you are making it everyone starts with one capture point at the start, but it will be needed if you have additional capture points of no capture points.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering Unit)) Equal to Capture Point
    • Actions
      • Unit - Change ownership of (Triggering Unit) to (Owner of (Attacking unit)) and Change color
      • Unit - Set life of (Triggering Unit) to 100.00%
So the above trigger changes ownership to yours, and it sets the life of the capture point back to full, because you don't want it to die if people continuously attack.

(Remember this is quick trigger, and still may need tweaking to your needs)
 
Last edited:
Level 3
Joined
Jun 23, 2013
Messages
54
If you wanna make the owner receive 100 gold every 30 second, just create a player variable and add to the bottom of the trigger the action Set "player_variable"=(owner of (attacking unit)
and create this trigger:

  • Untitled Trigger 001
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add 100 to player_variable Current gold
 
Level 2
Joined
Jun 17, 2013
Messages
9
Thankyou all for helping me with this but now I would like to know how to put together the first two triggers that were posted by CroMoX with the trigger posted by Sapi.

And how many variables Am'I making? And what should they be labeled as?


All I'd like is so that you get gold from gold mines and lumber from mills. but I'd like at least 8 on the map so do I need to make triggers for all of them?
 
Level 3
Joined
Jun 23, 2013
Messages
54
just add the action Set "player_variable"=(owner of (attacking unit)) at the most bottom of CroMox second variable titled "capture point" and then create my trigger.
Just create variable as we did

If you want to make 8 goldmines on the map, you don't need to create 8 trigger, just make the player_variable having 8 arrays. And add 8 action "if/then/else multiple function" at capture point trigger. Fill the "if" with Boelan-unit comparison and select the goldmine. So for every goldmine in the map you just need to add the if/then/else function.

If you still don't understand, i can make the trigger for you later because now i'm not in home
 
Level 2
Joined
Jun 17, 2013
Messages
9
just add the action Set "player_variable"=(owner of (attacking unit)) at the most bottom of CroMox second variable titled "capture point" and then create my trigger.
Just create variable as we did

If you want to make 8 goldmines on the map, you don't need to create 8 trigger, just make the player_variable having 8 arrays. And add 8 action "if/then/else multiple function" at capture point trigger. Fill the "if" with Boelan-unit comparison and select the goldmine. So for every goldmine in the map you just need to add the if/then/else function.

If you still don't understand, i can make the trigger for you later because now i'm not in home

If you don't mind could? Because I'm lost with all that text with no pics.
Thank you very much though for explaining it more, Do I also need to make the same trigger for the lumber mills?
 
Level 3
Joined
Jun 23, 2013
Messages
54
Trigger 1:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- This Trigger created by CroMox --------
      • Player - Make Player 1 (Red) treat Neutral Passive as an Enemy
      • -------- You need to make the action above for every player in the game --------
Trigger 2:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Gold Mine
    • Actions
      • Set Mine_Unit[1] = (Attacked unit)
      • Set Mine_Unit[2] = (Attacking unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mine_Unit[1] Equal to Gold Mine 0000 <gen>
        • Then - Actions
          • Unit - Change ownership of Mine_Unit[1] to (Owner of Mine_Unit[2]) and Change color
          • Unit - Set life of Mine_Unit[1] to 100.00%
          • Set Mine_Player[1] = (Owner of Mine_Unit[2])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mine_Unit[1] Equal to Gold Mine 0001 <gen>
        • Then - Actions
          • Unit - Change ownership of Mine_Unit[1] to (Owner of Mine_Unit[2]) and Change color
          • Unit - Set life of Mine_Unit[1] to 100.00%
          • Set Mine_Player[2] = (Owner of Mine_Unit[2])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mine_Unit[1] Equal to Gold Mine 0002 <gen>
        • Then - Actions
          • Unit - Change ownership of Mine_Unit[1] to (Owner of Mine_Unit[2]) and Change color
          • Unit - Set life of Mine_Unit[1] to 100.00%
          • Set Mine_Player[3] = (Owner of Mine_Unit[2])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mine_Unit[1] Equal to Gold Mine 0003 <gen>
        • Then - Actions
          • Unit - Change ownership of Mine_Unit[1] to (Owner of Mine_Unit[2]) and Change color
          • Unit - Set life of Mine_Unit[1] to 100.00%
          • Set Mine_Player[4] = (Owner of Mine_Unit[2])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mine_Unit[1] Equal to Gold Mine 0004 <gen>
        • Then - Actions
          • Unit - Change ownership of Mine_Unit[1] to (Owner of Mine_Unit[2]) and Change color
          • Unit - Set life of Mine_Unit[1] to 100.00%
          • Set Mine_Player[5] = (Owner of Mine_Unit[2])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mine_Unit[1] Equal to Gold Mine 0005 <gen>
        • Then - Actions
          • Unit - Change ownership of Mine_Unit[1] to (Owner of Mine_Unit[2]) and Change color
          • Unit - Set life of Mine_Unit[1] to 100.00%
          • Set Mine_Player[6] = (Owner of Mine_Unit[2])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mine_Unit[1] Equal to Gold Mine 0006 <gen>
        • Then - Actions
          • Unit - Change ownership of Mine_Unit[1] to (Owner of Mine_Unit[2]) and Change color
          • Unit - Set life of Mine_Unit[1] to 100.00%
          • Set Mine_Player[7] = (Owner of Mine_Unit[2])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mine_Unit[1] Equal to Gold Mine 0007 <gen>
        • Then - Actions
          • Unit - Change ownership of Mine_Unit[1] to (Owner of Mine_Unit[2]) and Change color
          • Unit - Set life of Mine_Unit[1] to 100.00%
          • Set Mine_Player[8] = (Owner of Mine_Unit[2])
        • Else - Actions
Trigger 3:
  • Untitled Trigger 003
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Player - Add 100 to Mine_Player[(Integer A)] Current gold
Do I also need to make the same trigger for the lumber mills?
Is the lumber mills treated as neutral passive?, if so just do the same

Anyway we can make the second trigger easier, if we make a custom value for each gold mine using a hashtable
 
Level 2
Joined
Jun 17, 2013
Messages
9
Thanks Sapi for posting all that. And the lumber mills are treated exactly the same as the gold mines.
 
Level 2
Joined
Jun 17, 2013
Messages
9
For now I've made a timer trigger giving resources over time. Which I found easy to make now, thanks to the help of you all. When I get home I plan to make the big ones.
 
Level 2
Joined
Jun 17, 2013
Messages
9
Sadly, the first trigger can be annoying for 12 players for copy pasting, I recommend using player group pick All Players then loop it for shortened trigger, it's better.


Hahaha, alright thanks for the quick tip. :)


Hmm I think I'm going to big a trigger to make here, since I don't have a lot of knowledge in wc3 trigger making. But I'll do my best!
 
Status
Not open for further replies.
Top