- I know you can make a floating text thats fadeing out the text, but that's not what i want, i have seen it many times before, always wondering how, i know this can't be done is normal GUI, .. And i cant figure out to use JASS..
Anyone got a Idea?|||Floating Text - Create Floating Text At Point/Above Unit?|||Not really, fadeing out while going up.
Well.. Found a long way.
Sometimes its hard to see the Floating Text, thats why there are [2]
Code:
Income Give Players|||It would be REALLY great if I could un-read that.|||Tiranasta, you cant see the function ?|||I was referring to Morton's post.
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Player Group - Pick every player in Player Group - Player 1 (Red) and do (Actions)
Loop - Actions
Set _income_unit = (Random unit from (Units owned by (Picked player) of type Builder))
Set _income_test = ((Real((Number of units in (Units owned by (Picked player))))) x 0.50)
Set _income = (Integer(_income_test))
Special Effect - Create a special effect attached to the overhead of _income_unit using UI\Feedback\GoldCredit\GoldCredit.mdl
Set _special_effects[1] = (Last created special effect)
Trigger - Add to Income Delete <gen> the event (Time - Elapsed game time is 1.00 seconds)
Player - Add _income to (Picked player) Current gold
Set _income_transparency = 100.00
Set _income_z = 400.00
For each (Integer A) from 1 to 200, do (Actions)
Loop - Actions
Set _income_unit = (Random unit from (Units owned by (Picked player) of type Builder))
Floating Text - Create floating text that reads (Income: + (String(_income))) at (Position of _income_unit) with Z offset _income_z, using font size 10.00, color (0.00%, 0.00%, 0.00%), and _income_transparency% transparency
Set _income_floating_text[1] = (Last created floating text)
Floating Text - Create floating text that reads (Income: + (String(_income))) at (Position of _income_unit) with Z offset _income_z, using font size 10.00, color (100.00%, 80.00%, 0.00%), and _income_transparency% transparency
Set _income_floating_text[2] = (Last created floating text)
Floating Text - Set the velocity of _income_floating_text[1] to 64.00 towards 90.00 degrees
Floating Text - Set the velocity of _income_floating_text[2] to 64.00 towards 90.00 degrees
Floating Text - Change the position of _income_floating_text[1] to ((Position of _income_unit) offset by (-55.00, 0.00)) with Z offset _income_z
Floating Text - Change the position of _income_floating_text[2] to ((Position of _income_unit) offset by (-55.00, 0.00)) with Z offset _income_z
Floating Text - Change _income_floating_text[1]: Disable permanence
Floating Text - Change _income_floating_text[2]: Disable permanence
Set _income_z = (_income_z + 0.50)
Set _income_transparency = (_income_transparency - 1.00)
Set _income_unit = (Random unit from (Units owned by (Picked player) of type Builder))
Floating Text - Change the lifespan of _income_floating_text[1] to 2.00 seconds
Floating Text - Change the lifespan of _income_floating_text[2] to 2.00 seconds
Floating Text - Change the fading age of _income_floating_text[1] to 1.00 seconds
Floating Text - Change the fading age of _income_floating_text[2] to 1.00 seconds
Floating Text - Hide _income_floating_text[1] for _player_group
Floating Text - Hide _income_floating_text[2] for _player_group
Floating Text - Show _income_floating_text[1] for (Player group((Picked player)))
Floating Text - Show _income_floating_text[2] for (Player group((Picked player)))
Wait 0.05 seconds
Floating Text - Destroy _income_floating_text[1]
Floating Text - Destroy _income_floating_text[2]
Floating Text - Destroy _income_floating_text[1]
Floating Text - Destroy _income_floating_text[2]
Just so you know, 'Wait 0.05 seconds' is pretty much equivalent to 'Wait 0.27 seconds', the minimum value that Wait (TriggerSleepAction) can handle correctly. Also... why are you creating a player group from player one? You're creating numerous leaks by doing that, and there does not appear to be any reason to do so.
Also, since you're running the trigger every two seconds, it will contain large numbers of global variable conflicts with other instances of itself.
There are also a few redundant actions (the last two Float Text - Destroy calls and one of the assignments to _income_unit)
Finally, I had only just gotten out of bed when I wrote this, so if I missed anything, or made a mistake, I apologise.|||Well .. That was actually just a start trigger.. to see if it was possible..
So i cleaned up the trigger.
Heres the final triggers:
Give Players their Income:
Code:
Income Give Players
Events
Conditions
Actions
Set _income_player_interger = 1
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
Player Group - Pick every player in (Player group(_income_players[_income_player_interger])) and do (Actions)
Loop - Actions
Unit Group - Pick every unit in (Units owned by (Picked player) of type Builder) and do (Actions)
Loop - Actions
Set _income_unit = (Picked unit)
Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is A structure) Equal to True
Then - Actions
Unit Group - Add (Picked unit) to _income_uni_ground
Else - Actions
Set _income_value = ((Real((Number of units in _income_uni_ground))) x 0.50)
Set _income = (Integer(_income_value))
Player - Add _income to (Picked player) Current gold
Special Effect - Create a special effect attached to the overhead of _income_unit using UI\Feedback\GoldCredit\GoldCredit.mdl
Set _special_effects[1] = (Last created special effect)
Trigger - Add to Income Delete <gen> the event (Time - Elapsed game time is 1.00 seconds)
Set _income_transparency = 100.00
Set _income_z = 400.00
Trigger - Run Income Text <gen> (checking conditions)
Set _income_player_interger = (_income_player_interger + 1)
Shows a fadeing upwards Text
Code:
Income Text
Events
Conditions
Actions
For each (Integer A) from 1 to 200, do (Actions)
Loop - Actions
Floating Text - Create floating text that reads (Income: + (String(_income))) at (Position of _income_unit) with Z offset _income_z, using font size 10.00, color (0.00%, 0.00%, 0.00%), and _income_transparency% transparency
Set _income_floating_text[1] = (Last created floating text)
Floating Text - Create floating text that reads (Income: + (String(_income))) at (Position of _income_unit) with Z offset _income_z, using font size 10.00, color (100.00%, 80.00%, 0.00%), and _income_transparency% transparency
Set _income_floating_text[2] = (Last created floating text)
Floating Text - Set the velocity of _income_floating_text[1] to 64.00 towards 90.00 degrees
Floating Text - Set the velocity of _income_floating_text[2] to 64.00 towards 90.00 degrees
Floating Text - Change the position of _income_floating_text[1] to ((Position of _income_unit) offset by (-55.00, 0.00)) with Z offset _income_z
Floating Text - Change the position of _income_floating_text[2] to ((Position of _income_unit) offset by (-55.00, 0.00)) with Z offset _income_z
Floating Text - Change _income_floating_text[1]: Disable permanence
Floating Text - Change _income_floating_text[2]: Disable permanence
Set _income_z = (_income_z + 0.50)
Set _income_transparency = (_income_transparency - 1.00)
Floating Text - Change the lifespan of _income_floating_text[1] to 2.00 seconds
Floating Text - Change the lifespan of _income_floating_text[2] to 2.00 seconds
Floating Text - Change the fading age of _income_floating_text[1] to 1.00 seconds
Floating Text - Change the fading age of _income_floating_text[2] to 1.00 seconds
Floating Text - Hide _income_floating_text[1] for _player_group
Floating Text - Hide _income_floating_text[2] for _player_group
Floating Text - Show _income_floating_text[1] for (Player group((Picked player)))
Floating Text - Show _income_floating_text[2] for (Player group((Picked player)))
Wait 0.05 seconds
Floating Text - Destroy _income_floating_text[1]
Floating Text - Destroy _income_floating_text[2]
- The event: Every 2 sec was just a test.|||I can't figure it out either but you can use this special to make it more realistic: UI\Feedback\GoldCredit\GoldCredit.mdl|||I found a solution!
Use This:
Event: (Your Event Here)
Condition-
Action-
Floating Text - Create floating text that reads (Your Text Here) at (Anywhere) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 50.00 towards 90.00 degrees (THIS IS VERY IMPORTANT)
Explanation:
When you set the angle to 90 degrees. It is actually going North instead of up. BUT when you look at it it actually looks like it's going up. (Depending on the view)
Hope I Helped!
No comments:
Post a Comment