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

Status
Not open for further replies.
Level 5
Joined
Jan 15, 2018
Messages
128
Hi here is the trigger im trying to make: Control Point

I get stuck at the complicated actions part here:

  • Income20
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            • Loop - Actions
For some reason the (Actions) part is not selectable and cannot be added to
Is there anyway someone can walk me through this?
Thank you
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
Click on it. Then click to add an action. You can also drag actions into it.

This leaks a group, and picking every unit on the map is not advised. Instead, add all the control points to a group on map init/whenever they're killed and re-created and then loop through that group.
 
Level 5
Joined
Jan 15, 2018
Messages
128
I haven't been able to get back on again yet. Isnt this the system that LTA and azeroth wars use?

Are you proposing that every time someone attacks a control point, they are able to kill it, then a new one appears under their control?
Also wouldn't this technique make it so that all control points must be the same gold?

Hopefully i can get on tonight and look at it again.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
I have no idea how your map or azeroth wars works. I just assumed that either the control points were capturable or killable/rebuildable and I phrased my response considering those possibilities. I just meant to keep the group updated if the literal units that are the control points change.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
Pyrogasm is right, that's overkill for something fairly simple. Here's an example of player's capturing control points that generate gold every 60 seconds:

Variables:
PlayerIncome = Integer (Array)
PlayerControlPoints = Integer (Array)

Event:
A player captures a control point <--- Obviously not a real Event so instead you would put the Actions below inside your "capture control point trigger".

Actions:
Set PlayerControlPoints[player number of capturing player] = PlayerControlPoints[player number of capturing player] + 1
If Unit-Type of Control Point equal to ControlPoint1 then
Set PlayerIncome[player number of capturing player] = PlayerIncome[player number of capturing player] + X​
else
If Unit-Type of Control Point equal to ControlPoint2 then
Set income to something else​
else
etc...​

--

Events:
Every 60 seconds

Actions:
Pick every player in All Players and do:
Add PlayerIncome[player number of picked player] to picked player's Gold​

--
When a player loses a control point you simply do the reverse of the first trigger, reducing the player's Control Points and Income by the correct amount.
 
Level 5
Joined
Jan 15, 2018
Messages
128
Uncle that seems very complicated...

How does this look, does it leak?

  • Income20
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Balin's Tomb (CP))) and do (Actions)
            • Loop - Actions
              • Player - Add 20 to (Picked player).Current gold
 
Status
Not open for further replies.
Top