D
dm0n
Guest
Some things that should be easy to do sure arn't.
I made a 20% chance for a random amount (between 20 and 100) of gold to drop from creeps. I used the gold coin model and it looks nice. So then I wanted to have a floating text rise up above the hero stating the amount of coin he found, then have it dissapear in 2-3 seconds.
Problem is when multiple coins drop off of creeps, then the hero picks them up close to the same time.
Since the only way to destroy floating text is "destroy - last created floating text", it will only destroy the last one, and the first one(s) he picks up will continue to float up to the top of the screen.
Example of code:
Coin
Events
Unit - A unit owned by Player 1 (Red) Acquires an item
Unit - A unit owned by Player 2 (Blue) Acquires an item
Unit - A unit owned by Player 3 (Teal) Acquires an item
Unit - A unit owned by Player 4 (Purple) Acquires an item
Unit - A unit owned by Player 5 (Yellow) Acquires an item
Unit - A unit owned by Player 6 (Orange) Acquires an item
Unit - A unit owned by Player 7 (Green) Acquires an item
Unit - A unit owned by Player 8 (Pink) Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Gold Coins
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 8 (Pink)
Then - Actions
Set random = (Random integer number between 20 and 100)
Player - Add random to Player 8 (Pink) Current gold
Floating Text - Create floating text that reads (+ + (String(random))) above (Triggering unit) with Z offset 0.00, using font size 11.00, color (100.00%, 82.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Wait 3.00 seconds
Floating Text - Destroy (Last created floating text)
Else - Actions
Do nothing
----------------------------------
Anyone know how to solve this?
I made a 20% chance for a random amount (between 20 and 100) of gold to drop from creeps. I used the gold coin model and it looks nice. So then I wanted to have a floating text rise up above the hero stating the amount of coin he found, then have it dissapear in 2-3 seconds.
Problem is when multiple coins drop off of creeps, then the hero picks them up close to the same time.
Since the only way to destroy floating text is "destroy - last created floating text", it will only destroy the last one, and the first one(s) he picks up will continue to float up to the top of the screen.
Example of code:
Coin
Events
Unit - A unit owned by Player 1 (Red) Acquires an item
Unit - A unit owned by Player 2 (Blue) Acquires an item
Unit - A unit owned by Player 3 (Teal) Acquires an item
Unit - A unit owned by Player 4 (Purple) Acquires an item
Unit - A unit owned by Player 5 (Yellow) Acquires an item
Unit - A unit owned by Player 6 (Orange) Acquires an item
Unit - A unit owned by Player 7 (Green) Acquires an item
Unit - A unit owned by Player 8 (Pink) Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Gold Coins
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 8 (Pink)
Then - Actions
Set random = (Random integer number between 20 and 100)
Player - Add random to Player 8 (Pink) Current gold
Floating Text - Create floating text that reads (+ + (String(random))) above (Triggering unit) with Z offset 0.00, using font size 11.00, color (100.00%, 82.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Wait 3.00 seconds
Floating Text - Destroy (Last created floating text)
Else - Actions
Do nothing
----------------------------------
Anyone know how to solve this?


