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

Buggy Floating Text

Status
Not open for further replies.
Level 14
Joined
Aug 23, 2013
Messages
285
  • Game - FloatingTextEvent becomes Equal to 1.00
  • Conditions
  • Actions
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
    • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
    • Floating Text - Set the velocity of (Last created floating text) to 64 towards 90.00 degrees
    • Set FloatingTextEvent = 0.00
The trigger work fine. but if i add this line. sometime floating text won't appear.
  • Floating Text - Change (Last created floating text): Disable permanence
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
sometime floating text won't appear.
Can you narrow down when it does not appear? If the text is outside the camera area it might automatically disappear to preserver resources (after all you cannot see it).

The classic tree falling in forest with no one there to hear it problem. In real life it does make a sound. However in video games it does not simply because computers have insufficient resources to simulate everything. Since there is no one there to see it both appear to have the same results most of the time. However if the person were to quickly go next to where the tree fell in the video game from far enough away then there would be no sound as the tree falling over sound did not start playing and now it is already half fallen over.
 
Level 14
Joined
Aug 23, 2013
Messages
285
Can you narrow down when it does not appear? If the text is outside the camera area it might automatically disappear to preserver resources (after all you cannot see it).

The classic tree falling in forest with no one there to hear it problem. In real life it does make a sound. However in video games it does not simply because computers have insufficient resources to simulate everything. Since there is no one there to see it both appear to have the same results most of the time. However if the person were to quickly go next to where the tree fell in the video game from far enough away then there would be no sound as the tree falling over sound did not start playing and now it is already half fallen over.

Problem sloved. after reset my pc it's working fine. Sorry to bother you.

You should not use (Last created floating text) like that. You do not know if there is a floating text at all. It can cause a game crash. You should use a variable and that will solve that problem along with making it more efficient.

Try changing permanence after the lifespan and fading age span.

Whatever a floating text is created. I set floatingtextevent = 1 ( the method base on DDD system)
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Whatever a floating text is created. I set floatingtextevent = 1 ( the method base on DDD system)

That is fine but you should also set your floating text to a variable. It is for speed and efficiency. It will also help to prevent bugs in case a spell / system you downloaded uses floating text and the event for that is triggered between your floating text creation and your event above.


It is also more efficient to simply create a function out of that and use custom script to call it. This will make it more efficient than using the triggered event.
Example: This is the more efficient one with a function call.

  • Events
  • Conditions
  • Actions
    • Custom script: endfunction
    • Custom script: function SetupFloatingText takes nothing returns nothing
    • Floating Text - Change FloatingText : Disable permanence
    • Floating Text - Change the lifespan of FloatingText to 5.00 seconds
    • Floating Text - Change the fading age of FloatingText to 3.00 seconds
    • Floating Text - Set the velocity of FloatingText to 64 towards 90.00 degrees
    • Custom script: endfunction
This is how to call the above function.
  • Set FloatingText = (Last created floating text)
  • Custom script: call SetupFloatingText()
 
Level 14
Joined
Aug 23, 2013
Messages
285
That is fine but you should also set your floating text to a variable. It is for speed and efficiency. It will also help to prevent bugs in case a spell / system you downloaded uses floating text and the event for that is triggered between your floating text creation and your event above.


It is also more efficient to simply create a function out of that and use custom script to call it. This will make it more efficient than using the triggered event.
Example: This is the more efficient one with a function call.

  • Events
  • Conditions
  • Actions
    • Custom script: endfunction
    • Custom script: function SetupFloatingText takes nothing returns nothing
    • Floating Text - Change FloatingText : Disable permanence
    • Floating Text - Change the lifespan of FloatingText to 5.00 seconds
    • Floating Text - Change the fading age of FloatingText to 3.00 seconds
    • Floating Text - Set the velocity of FloatingText to 64 towards 90.00 degrees
    • Custom script: endfunction
This is how to call the above function.
  • Set FloatingText = (Last created floating text)
  • Custom script: call SetupFloatingText()
Um.... I tried and i got bug at
  • call SetupFloatingText()
when save map.
Bug%20Call.jpg
 
Level 14
Joined
Aug 23, 2013
Messages
285
This is not correct. This is a custom function not one created by the GUI.

@CreatorD3292
Can you show me the triggers you made to work like the example I posted above?

I figure it out. You don't mention that function must be on op of the "call" Trigger.
After i read your tutorial. i see that there is no need for
  • Custom script: endfunction
after the
  • Floating Text - Set the velocity of FloatingText to 64 towards 90.00 degrees
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
I figure it out. You don't mention that function must be on op of the "call" Trigger.
After i read your tutorial. i see that there is no need for
  • Custom script: endfunction
after the
  • Floating Text - Set the velocity of FloatingText to 64 towards 90.00 degrees

Yup sorry about that. Some things I forgot to mention.
 
Status
Not open for further replies.
Top