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

[Trigger] ----> Is there a way to do this? <----

Status
Not open for further replies.
Level 3
Joined
Aug 18, 2008
Messages
52
I want an income trigger that gives 1 gold per every 30 seconds of game so i did this....

1. I set variales to buildings
<><><><><><><><><><><><><><><><><><><><><><><><><><><>

  • SET VARIABLE
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Civ_1 = (Units of type Civ Building 1)
      • Set Civ_2 = (Units of type Civ Building 2)
      • Set Civ_3 = (Units of type Civ Building 3)
      • Set Civ_4 = (Units of type Civ Building 4)
      • Set Civ_5 = (Units of type Civ Building 5)
      • Set Civ_6 = (Units of type Civ Building 6)
      • Set Civ_7 = (Units of type Civ Building 7)
      • Set Civ_8 = (Units of type Civ Building 8)
      • Set Civ_9 = (Units of type Civ Building 9)
      • Set Civ_10 = (Units of type Civ Building 10)
      • Set Civ_11 = (Units of type Civ Building 11)
      • Set Civ_12 = (Units of type Civ Building 12)
<><><><><><><><><><><><><><><><><><><><><><><><><><><>

2. I used those variables to make these triggers for income..

  • Civ 1 income
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Civ_1 and do (Player - Add 1 to (Owner of (Picked unit)) Current gold)
<><><><><><><><><><><><><><><><><><><><><><><><><><><>

The thing is... It works when i test it myself, but when i host it, it crashes the game for me and everyone else playing. So -> i'm guessing its a leak. I started learning JASS because people were saying that i would need to do something like "udg_temp_unit_group" or something. BUT I want my trigger to keep giving income as long as my unit is alive.


>>>>> Will using udg_temp_unit_group or w/e mess that up??????? <<<<<
and if it does, how can i get rid of my leaks??? Does any1 want to leak check my map?

OH and btw, i downloaded a program thats a leak checker. But it didn't find any i don't think.

I'm very conmfused PLEASE HELP
 
Last edited by a moderator:
Level 18
Joined
Aug 23, 2008
Messages
2,319
Why don't you use a simple trigger like this one?

  • Income trigger
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add ((Number of living <UNIT> units owned by Player 1 (Red)) x 1) to Player 1 (Red) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 2 (Blue)) x 1) to Player 2 (Blue) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 3 (Teal)) x 1) to Player 3 (Teal) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 4 (Purple)) x 1) to Player 4 (Purple) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 5 (Yellow)) x 1) to Player 5 (Yellow) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 6 (Orange)) x 1) to Player 6 (Orange) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 7 (Green)) x 1) to Player 7 (Green) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 8 (Pink)) x 1) to Player 8 (Pink) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 9 (Gray)) x 1) to Player 9 (Gray) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 10 (Light Blue)) x 1) to Player 10 (Light Blue) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 11 (Dark Green)) x 1) to Player 11 (Dark Green) Current gold
      • Player - Add ((Number of living <UNIT> units owned by Player 12 (Brown)) x 1) to Player 12 (Brown) Current gold
If I'm not wrong, this trigger should cause every player to gain 1 gold every 30 seconds for every living unit of a specific type.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Sorry, I'm just someone who makes his triggers using only common sence and plain reason. I have no idea how to check for leaks :p

If there is someone who can check it, please do so. It would help him, me and the rest of the community who need such a trigger :p
 
Status
Not open for further replies.
Top