what I am trying to do is display damage. Now every new damage display needs an own text tag. Let's assume I have no idea, how many text tags are going to be active simultaneously. What would be the most elegant way to solve this problem?
Okay, I'll try to explain differently. I have three units, who can be hit. When they are, the damage is displayed. The problem is, I stared implementing abilities, which hit one unit twice and what I want to do is to make the damage appear quick after each other.
Now to post some triggers, the first trigger is fired, when a unit is hit (I won't post the whole trigger in order to minimize stuff to read):
actions:
Text Tag - Create a text tag with the text AttackResultText1 for (All players),
using a font size of 40, at (Position of Enemy1) and height offset 1.0, initially Visible,
and fog of war enforcement set to true
Text Tag - Set Fade Duration time for (Last created text tag) to 4.0 seconds
Text Tag - Set Duration time for (Last created text tag) to 4.0 seconds
Variable - Set AttackResultTag1 = (Last created text tag)
Trigger - Run Result Tag Effects Loop For Enemy 1 (Check Conditions, Don't Wait
until it finishes)
Okay, the trigger which is fired from here is where the, like Nerfpl said, fancy stuff is done.
Now the problem is, the text tag is saved in the Variable AttackResultTag1. If now a second damaging event hits Enemy1 while this text tag is still active, the variable is overwritten, so the fancy-stuff-trigger forgets the old one.
1. Do NOT call another trigger in a trigger, if you want to have an action function instead. The new trigger creates a new thread and that's why everything is blocked and overwrites because it takes more time than executing a function.
2. Create an action function (action definition), use a text tag as a parameter and do your fancy actions.
3. Call the function with "last created text tag" instead of starting another trigger.
4. fancy stuff will be done with a reference to the parameter, so the text tag won't be "forgotten".
Anyway, I still don't get how your text tag just disappears...
I've no problem with my method. I'm using many text tags (for miss, critical, immunity) and it seems that there is no need to remove them all together. So the waits might only be unnecessary thread usage (there is a maximum of threads at the same time).
So that's what functions are for. Thank you very much, you, sir, just improved the performance of my triggering by about 200%. I already wanted to ask about trigger instancing - if something like this existed. It seems I found my answer before I asked.
Hi,
what I am trying to do is display damage. Now every new damage display needs an own text tag. Let's assume I have no idea, how many text tags are going to be active simultaneously. What would be the most elegant way to solve this problem?
ty
Greetz, Shianky
@Shianky: Go just use them with timed life and make them move up over time (there is a setting for this, too)...
@Ahli634: Go
This kinda doesn't work. If a new one appears, the old one disappears instantly without fading out.
You need to use Data to handle this, not Triggers.
The way you speak about it seems you think like on one ever tried damage display. Everyone did :)
If you have issues with it it most likely you approached it from wrong side. Post some code first so we can tinker it out
usual way is like
unit takes damage
local tt - text tag
create text tag
set tt - last created
/do fancy stuff with tt
wait x
destroy tt
@Shianky: Go
My text tags aren't disappearing, if I create another text tag with triggers...
I've no clue what you are doing to make that NOT work.
Okay, I'll try to explain differently. I have three units, who can be hit. When they are, the damage is displayed. The problem is, I stared implementing abilities, which hit one unit twice and what I want to do is to make the damage appear quick after each other.
Now to post some triggers, the first trigger is fired, when a unit is hit (I won't post the whole trigger in order to minimize stuff to read):
Okay, the trigger which is fired from here is where the, like Nerfpl said, fancy stuff is done.
Now the problem is, the text tag is saved in the Variable AttackResultTag1. If now a second damaging event hits Enemy1 while this text tag is still active, the variable is overwritten, so the fancy-stuff-trigger forgets the old one.
I hope i could explain the problem a little.
Sorry, wasn't supposed to sound like you understood.
ty
1. Do NOT call another trigger in a trigger, if you want to have an action function instead. The new trigger creates a new thread and that's why everything is blocked and overwrites because it takes more time than executing a function.
2. Create an action function (action definition), use a text tag as a parameter and do your fancy actions.
3. Call the function with "last created text tag" instead of starting another trigger.
4. fancy stuff will be done with a reference to the parameter, so the text tag won't be "forgotten".
Anyway, I still don't get how your text tag just disappears...
I've no problem with my method. I'm using many text tags (for miss, critical, immunity) and it seems that there is no need to remove them all together. So the waits might only be unnecessary thread usage (there is a maximum of threads at the same time).
@Ahli634: Go
So that's what functions are for. Thank you very much, you, sir, just improved the performance of my triggering by about 200%. I already wanted to ask about trigger instancing - if something like this existed. It seems I found my answer before I asked.
-*gracious bow*-