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

Income by sending creeps

Status
Not open for further replies.
Level 2
Joined
Nov 25, 2010
Messages
8
Hey guys,

Im building some Hero wars with mini games included.
so the heroes can build towers too.
but the income will be gained from income from sending creeps.

this is the code i had.but it wont work.

  • Events
    • Time - Every 5.00 seconds of game time
  • Conditions
  • Actions
    • Countdown Timer - Destroy (Last created timer window)
    • Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in 5.00 seconds
    • Countdown Timer - Create a timer window for (Last started timer) with title Next income in
    • Player - Add (Player 1 (Red) Current gold) to Player 1 (Red) Current gold
    • Game - Display to (All players) the text: (Player red has the income + (String((Player 1 (Red) Current gold))))


Somebody got some other WORKING trigger?

uhm. i've putted the point value of the sent creep on 2 but after the clock resets. i wont get 2G

Help?!
 
Level 2
Joined
Nov 25, 2010
Messages
8
Your English is, WOW
Let me rephrase it for you:
You will gain money based on HOW much creeps you are sending... ?

haha im sorry ;)

im dutch, so my english is not the best...

uhm. i ment the Line tower 7 style.

like:

send> footmen= +2 income
send> footmenx3= +6 income.


u know what i mean?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
It is called using variables...

Make an integer array representing income. The indicies map to the players while the values held are the respective incomes.

When a player spawns a unit, you then add the gold increase to the variable for that player.

When income time comes, you loop through all used indicies and add the gold to the players coffers (their gold total...).

A variable is used to store data for use at a later time in computer languages. An array is a chain of multiple variables grouped together and identified uniquly by an integer index representing a single variable out of them. An integer in computer languages is generally a 32 bit signed (via two's compliment) value formated so it can only take whole numbers (mathimatical integers) within its range.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Your explanation is ALWAYS the best !
But... it's kinda LOL when you are explaining all of these things to beginners (well, considering the post count and rep...), you should start making test map for them, they (also me =p) would like to see how the actual trigger works =D
Keep Improving !
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Do you honestly think I have the time to make a test map? Do you think I learned all I did from test maps others posted?

My explination should sufice to anyone. Even if he has no clue what a variable is, I explain it roughly to him. If my explination is not enough (he fails to grasp variables), he will know he must grasp variables inorder to do what he is after which will help him hugely due to the nesescity of them to do nearly everything. After looking at how blizzard used variables in their custom maps, I am sure he will understand them perfectly as I did back when I was 11 odd.
 
Level 2
Joined
Nov 25, 2010
Messages
8
It is called using variables...

Make an integer array representing income. The indicies map to the players while the values held are the respective incomes.

When a player spawns a unit, you then add the gold increase to the variable for that player.

When income time comes, you loop through all used indicies and add the gold to the players coffers (their gold total...).

A variable is used to store data for use at a later time in computer languages. An array is a chain of multiple variables grouped together and identified uniquly by an integer index representing a single variable out of them. An integer in computer languages is generally a 32 bit signed (via two's compliment) value formated so it can only take whole numbers (mathimatical integers) within its range.

ye i get that.

i already made my income variable, which is integer with an array (0)
but still its not working.

can u show me how the code has to look like/?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Do you honestly think I have the time to make a test map? Do you think I learned all I did from test maps others posted?

My explination should sufice to anyone. Even if he has no clue what a variable is, I explain it roughly to him. If my explination is not enough (he fails to grasp variables), he will know he must grasp variables inorder to do what he is after which will help him hugely due to the nesescity of them to do nearly everything. After looking at how blizzard used variables in their custom maps, I am sure he will understand them perfectly as I did back when I was 11 odd.

ye i get that.

i already made my income variable, which is integer with an array (0)
but still its not working.

can u show me how the code has to look like/?

This is what I'm talking about
They need to see actual trigger of it with the use of TRIGGER tags and stuff
It depends on you, for me, I understood your explanation 100%, don't know for others (beginners, perhaps)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Player - Add (Player 1 (Red) Current gold) to Player 1 (Red) Current gold
Make that add the integer variable array to reds current gold.

Then when you spawn a unit, make the integer variable to be the integer variable + the amount to add.

Honestly, this problem is prety implicit if you break it down. Think what you want to be done and do it in triggers.

1. Player is to perodically earn an income.
Points towards a trigged that runs perodically or when a timer expires that adds to the player an integer variable amount of gold.
2. The income increases when more units are spawned.
Points towards a trigger that then adds (to do this you must set the variable to intself + some value) to the the income variable.

It really is just that simple. Simlar mechanics are behind maps with waves, kill counts, player counts, you name it.

They need to see actual trigger of it with the use of TRIGGER tags and stuff
Firstly, when I make stuff for WC3 it is always JASS which for some strange reason people think is harder than GUI.
Secondly, virtually every map with triggers is an example of this in work. He could look for already made tower wars to see how they did it. Even blizzard's maps must use simple variable incrimentation.

Do not think I became good at JASS by running to everyone begging for help over the slightest problem and demanding to see an example of it done. I found my own examples and stole the concepts behind them into ones that are always readilly available for me to use in any programming or scripting language.
 
Status
Not open for further replies.
Top