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

Gold per sec for controlling town like lords or europe

Status
Not open for further replies.
Level 2
Joined
Aug 16, 2008
Messages
8
yo, im making a world war map and was thinking of replacing gold mines with cities you capture, so how would i do it so when the city is damaged to 500 health the player gets it and then gets 10 gold a second for as long as the city is owned by them, cheers Grant
 
Level 8
Joined
Mar 12, 2008
Messages
437
Create a trigger that checks when the city's life becomes less than or equal to 500. Then, pick every unit that is attacking that city. Change the city's owner to owner of picked unit, and order picked unit to stop.

Then use periodic event. That gives 10 * (number of cities owned by player).
 
Level 2
Joined
Aug 16, 2008
Messages
8
Create a trigger that checks when the city's life becomes less than or equal to 500. Then, pick every unit that is attacking that city. Change the city's owner to owner of picked unit, and order picked unit to stop.

Then use periodic event. That gives 10 * (number of cities owned by player).

that means nothing at all to me, i dont udnerstand triggers evry well so if u tell me what event conditions n action i need to do i will try and do it, and report back here whatever the outcome.
 
Level 8
Joined
Mar 12, 2008
Messages
437
Oh, sorry, I'll try to do it.
  • teztz
    • Events
      • Unit - <CITY>'s life becomes Less than or equal to 500.00 ------Listed as "Unit - Life"
    • Conditions
      • <conditions here>
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Issued order) Equal to (Order(attack)))) and do (Actions) -----Listed as "Unit Group - Pick Every Unit In Unit Group And Do Multiple Actions", and the latter as "Order comparison"
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions) ------Listed as "If / Then / Else, Multiple Functions"
            • If - Conditions
              • (Target unit of ability being cast) Equal to (Triggering unit) ------Listed as "Unit comparison"
            • Then - Actions
              • Unit - Change ownership of (Triggering unit) to (Owner of (Picked unit)) and Change color
            • Else - Actions
I'm not sure if this will work, I haven't experimented with the Unit - Life event a lot :/

Edit: Whah screw it, check Mr Divine Boss' solution instead, he's probably right.
 
Level 2
Joined
Aug 16, 2008
Messages
8
i can seem to copy everything you have put expect the unit group bit. i can egt it to do 'unit group-pick every unit in group and do multiple actions ' its just the latter as 'order comparison' i dont know what that means or how to do it. thanks so far

EDIT:
still need help
 
Last edited by a moderator:
  • Income
    • Events
      • Time - Every 1.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 owned by (Picked player) of type Town Hall) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Life of (Picked unit)) Less than 500.00
                • Then - Actions
                  • Player - Add 10 to (Picked player) Current gold
                • Else - Actions
 
Status
Not open for further replies.
Top