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

Help with income

Status
Not open for further replies.
Level 3
Joined
May 30, 2010
Messages
35
Okay I got an income system for my map and I'm trying to make it so when
someone gets 100k income they lose 50k income and gain 1 lumber but it
doesn't work so here is what I got so far

  • Events
    • Time - Next_Level expires
  • Actions
    • -------- Setup Timer --------
    • Countdown Timer - Destroy (Last created timer window)
    • Countdown Timer - Create a timer window for Next_Level with title Next Round in...
    • Player Group - Pick every player in (All players) and do (Player - Add Income[(Player number of (Picked player))] to (Picked player) Current gold)
    • Player Group - Pick every player in (All players) and do (Player - Add Income_Copy[(Player number of (Picked player))] to (Picked player) Current lumber)
    • If ((Player 1 (Red) slot status) Equal to Is playing) then do (Trigger - Run Show Stats Red <gen> (checking conditions)) else do (Do nothing)
    • If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Trigger - Run Show Stats Blue <gen> (checking conditions)) else do (Do nothing)
    • If ((Player 3 (Teal) slot status) Equal to Is playing) then do (Trigger - Run Show Stats Teal <gen> (checking conditions)) else do (Do nothing)
    • If ((Player 4 (Purple) slot status) Equal to Is playing) then do (Trigger - Run Show Stats Purple <gen> (checking conditions)) else do (Do nothing)
    • If ((Player 5 (Yellow) slot status) Equal to Is playing) then do (Trigger - Run Show Stats Yellow <gen> (checking conditions)) else do (Do nothing)
    • If ((Player 6 (Orange) slot status) Equal to Is playing) then do (Trigger - Run Show Stats Orange <gen> (checking conditions)) else do (Do nothing)
    • If ((Player 7 (Green) slot status) Equal to Is playing) then do (Trigger - Run Show Stats Green <gen> (checking conditions)) else do (Do nothing)
    • If ((Player 8 (Pink) slot status) Equal to Is playing) then do (Trigger - Run Show Stats Pink <gen> (checking conditions)) else do (Do nothing)
    • If ((Player 9 (Gray) slot status) Equal to Is playing) then do (Trigger - Run Show Stats Gray <gen> (checking conditions)) else do (Do nothing)
    • If ((Player 10 (Light Blue) slot status) Equal to Is playing) then do (Trigger - Run Show Stats Light blue <gen> (checking conditions)) else do (Do nothing)
  • Events
    • Unit - A unit enters Top unit <gen>
  • Conditions
    • Income[(Player number of (Owner of (Entering unit)))] Greater than or equal to 100000
  • Actions
    • Set Income[(Player number of (Owner of (Entering unit)))] = (Income[(Player number of (Owner of (Entering unit)))] - 50000)
    • Set Income_Copy[(Player number of (Owner of (Entering unit)))] = (Income_Copy[(Player number of (Owner of (Entering unit)))] + 1)
The first part works fine but the second part doesn't ever remove from gold income or add to lumbers income
 
Level 3
Joined
Dec 23, 2009
Messages
32
I dont see anything wrong, you could try to replace the ''Entering unit'' with ''Triggering Unit'' though.. Also I belive
Player Group - Pick every player in (All players) and do (Player - Add Income[(Player number of (Picked player))] to (Picked player) Current gold)
And
Player Group - Pick every player in (All players) and do (Player - Add Income_Copy[(Player number of (Picked player))] to (Picked player) Current lumber)
Leaks. It would be wise to not have them leak as you run that trigger alot, right?

Edit: Checked the Player Group thing with Leak Check v.3 by Im_On_56k. Dident leak :)
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

@Diablo: Yes I think it must be (Entering Unit) > (Triggering Unit) because I fast build two triggers to test it and it works fine:

  • AddIncomeG
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
    • Actions
      • Set IncomeG[(Player number of (Owner of (Triggering unit)))] = (IncomeG[(Player number of (Owner of (Triggering unit)))] + 100000)
      • -------- --------
      • Game - Display to (All players) the text: (String(IncomeG[(Player number of (Owner of (Triggering unit)))]))
  • AddIncomeL
    • Events
      • Unit - A unit enters Region 001 <gen>
    • Conditions
      • IncomeG[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 100000
    • Actions
      • Set IncomeG[(Player number of (Owner of (Triggering unit)))] = (IncomeG[(Player number of (Owner of (Triggering unit)))] - 50000)
      • Set IncomeL[(Player number of (Owner of (Triggering unit)))] = (IncomeL[(Player number of (Owner of (Triggering unit)))] + 1)
      • -------- --------
      • Game - Display to (All players) the text: (String(IncomeG[(Player number of (Owner of (Triggering unit)))]))
      • Game - Display to (All players) the text: (String(IncomeL[(Player number of (Owner of (Triggering unit)))]))
Edit: Btw @Alucard: Your picture ... it's made at a fight scene: Alucard vs luke valentine isn't it? ^^ - Jep got it http://www.youtube.com/watch?v=mUfYKb4nriY at 2:31 - 2:35 ^^

Greetings
~ The Bomb King > Dr. Boom
 
Level 3
Joined
May 30, 2010
Messages
35
  • Lumber income Copy
    • Events
      • Unit - A unit enters Top unit <gen>
    • Conditions
      • Income[(Player number of (Owner of (Triggering unit)))] Greater than or equal to 100000
    • Actions
      • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] - 50000)
      • Set Income_Copy[(Player number of (Owner of (Triggering unit)))] = (Income_Copy[(Player number of (Owner of (Triggering unit)))] + 1)
Still doesn't work

And good eye for hellsing
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Ok the trigger isn't wrong in anyway, this is clear. So somewhere else must be the mistake:

1) Are you really sure, that your income is really 100 000 or higher??

Create at your "Lumber income Copy" trigger the action (BEFORE any other action):
  • Game - Display to (All players) the text: (String(Income[(Player number of (Owner of (Triggering unit)))]))
[ It's an Integer converted to a string!]

After create this action, test your map, enter the rect and see what a value you get there. ( Ofc maybe you have to create a trigger that you manual increase the income up to 100 000)

2) Make sure that you are really increase the income variable, not another variable instead ( this can just happen - nothing bad! )

3) Make sure that you set the Income variable correctly!

4) Make sure that you picked the correct Rect for your event.

5) Maybe you have to create 2 different variables ( maybe it's get confused with "just copied variables" - but I don't think so.

Ok, if you test everything and it still doesn't work, then there's only one solution: You try to kidding us! =S ( or you just pm me the map so I get a look myself, because after that, it MUST! work T_T

Greetings
~ The Bomb King > Dr. Boom
 
Level 3
Joined
May 30, 2010
Messages
35
I got it working by changing the event to Unit - A unit Finishes training a unit
with the other event it'd only work when a hero entered the region (prob has something to do with the you lose the unit as soon as its done so it never registered as the players unit
but I'm just guessing) anyways thank ya for ya help

As for the integer converted to a string I've had that setup for awhile
 
Status
Not open for further replies.
Top