Income Trigger???

Status
Not open for further replies.

iown_azz

Level 8
I am making a map with an income system and I got some triggers out for testing but it is not working for me....

This is the one that give you your income
• Income
• Events
• Time - Every 20.00 seconds of game time
• Conditions
• Actions
• Player Group - Pick every player in (All players) and do (Actions)
• Loop - Actions
• Player - Add Income[(Player number of (Picked player))] to (Picked player) Current gold
• Game - Display to (All players) the text: (String(Income[(Player number of (Picked player))]))

and this is the one when you click the unit:
• Units
• Events
• Unit - A unit Finishes construction
• Conditions
• Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (Unit-type of (Triggering unit)) Equal to Arrow Tower 1
• Then - Actions
• Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] + 1)
• Else - Actions

What is wrong with it? The default income is 25 and it stays at 25...
• Player Group - Pick every player in (All players) and do (Actions)
• Loop - Actions
• Set Income[(Player number of (Picked player))] = 25

Pharaoh_

Level 40
Try this:
• Player - Add (25 + Income[(Player number of (Picked player))]) to (Picked player) Current gold
and don't use that 'default' value.

iown_azz

Level 8
What default value?

Pharaoh_

Level 40
Just don't use this trigger:
• Player Group - Pick every player in (All players) and do (Actions)
• Loop - Actions
• Set Income[(Player number of (Picked player))] = 25
Simply have 25 + the increasing variable, called "Income".

iown_azz

Level 8
ok thanks... I knew I had something wrong

iown_azz

Level 8
It still didn't work... If I upload the map can you fix it for me?

Attachments

• TD.w3x
27.8 KB · Views: 71

arielavi

Level 4
here.. your event were made the wrong way, because you "train" a unit and not "build" the unit. so i added a timer with a window, because that caused me a nicelly expector just waiting the time and not knowing when would it apear.

also added a unit-recognizer simple system to make your td less ugly and you can set the variables in the map init.

feel free to remake stuff if you didn't like it

edit: you have been using preety ugly models i suggest you to remake them all, just make a nice builder, not a tower.. also can reduce "mom"s area to be like as a normal tower

Attachments

• TD.w3x
28.7 KB · Views: 90

iown_azz

Level 8
here.. your event were made the wrong way, because you "train" a unit and not "build" the unit. so i added a timer with a window, because that caused me a nicelly expector just waiting the time and not knowing when would it apear.

also added a unit-recognizer simple system to make your td less ugly and you can set the variables in the map init.

feel free to remake stuff if you didn't like it

edit: you have been using preety ugly models i suggest you to remake them all, just make a nice builder, not a tower.. also can reduce "mom"s area to be like as a normal tower

Well see that is how the map is supposed to be... it is the opposite. Instead of unit running the towers do and the units attack.

Edit: +rep

Edit: lol how would I make it to where it would spawn at the regions? It is kind of confusing...

arielavi

Level 4
like wat? the TD will be made in waves or you "send" units?

there is some ways
1 - for every wave you attach a integer to your unit type of respective wave.
2 - seeing your map, i belive the units are spawned at various regions and are ordered to go to the bigger region. so in each spot you will attach the units (i really recommend to attach regions to players to avoid unit stucking) and then periodically create the units, making a line of units, avoiding the "cakes".
3 - if you send units, remove the trained unit, and for each spot create the same unit type of the trained unit.
4 - don't forget to order unit to move to regions. its easy to trigger, you may not have trouble with that.

Last edited:

iown_azz

Level 8
like wat? the TD will be made in waves or you "send" units?

there is some ways
1 - for every wave you attach a integer to your unit type of respective wave.
2 - seeing your map, i belive the units are spawned at various regions and are ordered to go to the bigger region. so in each spot you will attach the units (i really recommend to attach regions to players to avoid unit stucking) and then periodically create the units, making a line of units, avoiding the "cakes".
3 - if you send units, remove the trained unit, and for each spot create the same unit type of the trained unit.
4 - don't forget to order unit to move to regions. its easy to trigger, you may not have trouble with that.

Ya where they send but for 2 and 3 how would I do that and I already did the regions ect.

Edit: Sence I have this thread... When you kill them you don't gold for it

Last edited:

arielavi

Level 4
its easy to trigger this, so i will reply when i have time like tomorrow

EDIT
you dont have to wait that much. i got some time so i did the trigger:

here we order the unit to go to the end. i didn't work with your "turn" regions because i don't know much how they work and it takes too much time. you need also to change unit values in obj editor ;p good luck with your map
• Units
• Events
• Unit - A unit Finishes training a unit
• Conditions
• Actions
• For each (Integer generalintegers[1]) from 1 to Income_totalunits, do (Actions)
• Loop - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (Unit-type of (Trained unit)) Equal to Income_unit[generalintegers[1]]
• Then - Actions
• Unit - Remove (Trained unit) from the game
• Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] + Income_provided[generalintegers[1]])
• For each (Integer generalintegers[2]) from 1 to createcreepscount, do (Actions)
• Loop - Actions
• Unit - Create 1 (Unit-type of (Trained unit)) for Player 11 (Dark Green) at (Center of createcreeps[generalintegers[2]]) facing Default building facing degrees
• Unit - Order (Last created unit) to Move To (Center of End <gen>)
• Else - Actions
here you can also make a player lose a life. just add a global variable and subtract the previous value by one ;D
• Life loss
• Events
• Unit - A unit enters End <gen>
• Conditions
• (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
• Actions
• Unit - Remove (Triggering unit) from the game
• Game - Display to (All players) the text: You lost a life.

Last edited:

iown_azz

Level 8
its easy to trigger this, so i will reply when i have time like tomorrow

EDIT
you dont have to wait that much. i got some time so i did the trigger:

here we order the unit to go to the end. i didn't work with your "turn" regions because i don't know much how they work and it takes too much time. you need also to change unit values in obj editor ;p good luck with your map
• Units
• Events
• Unit - A unit Finishes training a unit
• Conditions
• Actions
• For each (Integer generalintegers[1]) from 1 to Income_totalunits, do (Actions)
• Loop - Actions
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• (Unit-type of (Trained unit)) Equal to Income_unit[generalintegers[1]]
• Then - Actions
• Unit - Remove (Trained unit) from the game
• Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] + Income_provided[generalintegers[1]])
• For each (Integer generalintegers[2]) from 1 to createcreepscount, do (Actions)
• Loop - Actions
• Unit - Create 1 (Unit-type of (Trained unit)) for Player 11 (Dark Green) at (Center of createcreeps[generalintegers[2]]) facing Default building facing degrees
• Unit - Order (Last created unit) to Move To (Center of End <gen>)
• Else - Actions
here you can also make a player lose a life. just add a global variable and subtract the previous value by one ;D
• Life loss
• Events
• Unit - A unit enters End <gen>
• Conditions
• (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
• Actions
• Unit - Remove (Triggering unit) from the game
• Game - Display to (All players) the text: You lost a life.
Lol haha I did both of those already and add a leaderboard for both lol but thanks anways... haha I wouldnt be able to do it anyways cuz im on my fone right now lieing in bed

Edit: Plus once I am finished with the map , do you want to be one of my testers?

arielavi

Level 4
Edit: Plus once I am finished with the map , do you want to be one of my testers?

im kinda busy at my orpg project, it means i have got many triggers to review and skills to do, but if i have time ill help you, just send a PM when you finish it and dont forget to post it. im a fan of tower defenses

iown_azz

Level 8
seeing your map, i belive the units are spawned at various regions and are ordered to go to the bigger region. so in each spot you will attach the units (i really recommend to attach regions to players to avoid unit stucking) and then periodically create the units, making a line of units, avoiding the "cakes".

I need help with that... how would I do that?

arielavi

Level 4
I need help with that... how would I do that?

look: in your map you got if i remember 8 players to defend. so there is 4 players to be the enemies. in each spot you created, a unit type of a unit will be created so try to make something like this:

-at initialization, set a player array variable to do this:
-enemy[1] = player 9
-enemy[2] = player 10
-enemy[3] = player 11
-enemy[4] = player 12
-tempint = 0
-in the trigger where you respawn creeps, you can add this inside the loop i created:
-tempint = tempint + 1
-create Y unit for ´enemy[tempint]´ at bla bla bla
-if then else
-tempint greater than or equal to 4
-set tempint = 0

that will work

Status
Not open for further replies.

[Solved] Income
Replies
0
Views
337
Replies
6
Views
785
Replies
4
Views
783
Replies
3
Views
634
Replies
2
Views
460