• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Gold income

Status
Not open for further replies.
It would be something like this, but with a little twist, depending on the way you will be using it:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: set udg_EntangledGoldMines[bj_forLoopAIndex] = CreateGroup()
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Gold Mine
            • Then - Actions
              • Unit - Replace (Picked unit) with a Entangled Gold Mine using The new unit's max life and mana
              • Unit - Change ownership of (Last replaced unit) to (Player((Integer A))) and Change color
              • Unit Group - Add (Last replaced unit) to EntangledGoldMines[(Integer A)]
            • Else - Actions
  • Timed Gold
    • Events
      • Time - Every 5.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 EntangledGoldMines[(Player number of (Picked player))] and do (Actions)
            • Loop - Actions
              • Set TempForce = (Player group((Picked player)))
              • Player - Add 10 to (Picked player) Current gold
              • Floating Text - Create floating text that reads +10 above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 80.00%, 0.00%), and 0.00% transparency
              • Floating Text - Hide (Last created floating text) for (All players)
              • Floating Text - Show (Last created floating text) for TempForce
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 2.50 seconds
              • Custom script: call DestroyForce (udg_TempForce)
Test Map:
 

Attachments

  • Test EntangledMine.w3x
    17.8 KB · Views: 58
Level 7
Joined
Jan 29, 2010
Messages
213
I like to play with triggers but I don't have much time for that.
it would be better If I'll just put some kind of ability and all be done.
Ok it isn't chat administrators will be mad if we'll keep here flooding about some kind of things like this :D
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: set udg_EntangledGoldMines[bj_forLoopAIndex] = CreateGroup()

Sorry for nitpicking but groups for indexes 0 and 1 are created at map initialization, thus you leak one unit group with that.
 
I remember when you said that to me. I've immidiately tested it and looked at map script. And yeah, it's true :D

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if udg_EntangledGoldMines[bj_forLoopAIndex] == null then
          • Custom script: set udg_EntangledGoldMines[bj_forLoopAIndex] = CreateGroup()
          • Custom script: endif
 
Status
Not open for further replies.
Top