• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Income Trigger???

Status
Not open for further replies.
Level 8
Joined
Jun 16, 2008
Messages
333
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
 
Level 4
Joined
May 23, 2010
Messages
83
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
Level 8
Joined
Jun 16, 2008
Messages
333
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...
 
Level 4
Joined
May 23, 2010
Messages
83
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:
Level 8
Joined
Jun 16, 2008
Messages
333
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:
Level 4
Joined
May 23, 2010
Messages
83
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:
Level 8
Joined
Jun 16, 2008
Messages
333
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?
 
Level 4
Joined
May 23, 2010
Messages
83
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 :)
 
Level 8
Joined
Jun 16, 2008
Messages
333
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?
 
Level 4
Joined
May 23, 2010
Messages
83
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.
Top