• 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.

Income

Status
Not open for further replies.
Level 1
Joined
Mar 6, 2009
Messages
7
hey i am trying to make a map where i can build farms there give income and i am pretty noob to income

someone can give me a very very easy way to make income in a farm :eekani:
 
Level 18
Joined
Mar 7, 2005
Messages
824
soo..
You got 3 Farms for example, the trigger runs, picks all units and checks farm = picked unit? right, and you get the amount... you got 5 Farms now.. the triggers runs, again picks up all units and checks.. farm = picked unit? right, so you get the "same" amount again.. like before.. and why? you don't check the amount of picked units.. so you have to calculate it.. like adding
>>add "yourvalue" * "amount of picked units" to owner of picked units<<

something like that..
 
Level 9
Joined
Feb 14, 2009
Messages
316
No, Tr!KzZ, it's a loop. For each picked Farm it gives money, not if there are farms on the map. It may look like this (the OP wants an easy way)

  • Income
    • Events
      • Time - Every 4 seconds of game-time
    • Conditions
    • Actions
      • 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 Farm
            • Then - Actions
              • Player - Add 5 gold to (Owner of (Picked unit))'s Current gold
            • Else - Actions

This thing leaks a lot, but blah, forget it, you wanted it simple =]
 
Level 9
Joined
Feb 14, 2009
Messages
316
Don't get offended, DarkAngelAzazel, the guy just tried to help.
I shall add that counting buildings is very tricky, since you have to modify values when a building is destroyed, or is built but not finished, or canceled, etc. This thing 1) leaks a lot 2) isn't trustworthy, I tried it myself and 3) is glitchy, because the game sometimes misses buildings, dunno why. I tried to use this method to create my V/D conditions for custom races. It sucks.
 
Level 18
Joined
Mar 7, 2005
Messages
824
Thanks Interceptor...
Tr!kzZ next time think before correcting somebody.. AND if you do so then give a better way!!!

sorry m8,
it was late, and was looking around here, I'm not at home, and obviously i misread something, so it's my fault.. yeah it's a loop and works already for all picked units.. dunno why i didn't saw that.. so sry
 
Status
Not open for further replies.
Top