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

Please, How to create income trigger?

Status
Not open for further replies.
Level 1
Joined
Sep 30, 2007
Messages
4
Anyone here who is fairly skilled or learned in the world editor if you pleas be as kind as to make me a trigger which is compound money as seen in:
WMW
Hero Line wars

Where you have a repeated income while adding the cash you use to buy creeps etc.

Much appreciated!
DaN!:thumbs_up:
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Welcome to the Hive Workshop, Danielt0. If you want to introduce yourself to the Community, you may do so here. If not, you should at least read the important Site Rules, to make sure you won't run in trouble.



They purchase creeps, and it gives gold to the player, right? If that is so, I know an easy way:
Since they don't use mana, set their mana or custom value (In the Unit Editor) equal to the points of income you want the player to get. Create an Integer Variable (let's call it IntegerArray), check "Array" and set it to number of players in-game.

[TRIGGER=Then, use this trigger]
IncomeRaising
Events
Unit - A unit Sells a unit
Conditions
(Unit-type of (Selling unit)) Equal to Unit Shop
Actions
Set IntegerVariable[(Player number of (Owner of (Sold unit)))] = (IntegerVariable[(Player number of (Owner of (Sold unit)))] + (Integer((Mana of (Sold unit)))))
[/TRIGGER]

Then you only need to have another trigger adding gold to the player equal to IntegerArray.
You can do this plenty of other ways; this is just an example. Remember that to get the mana of the unit, you have to use Conversion - Convert Real to Integer.

PS. - System-programming threads go on the Spells and Systems forum. Although it might be better in the Triggers (GUI) forum, I'll leave it here for now.
 
Level 1
Joined
Sep 30, 2007
Messages
4
thanks very much i still dont understand but i posted one in the triggers section so you can delete this and if you can please post on the more detailed one in the triggers section.
Thanks brother!
 
Status
Not open for further replies.
Top