That depends on the model in question. For some models, it is enough to use the AnimPlay actor message and check PlayForever, others require you to check the Automate Global Loops flag in the actor, and some would require you to loop their animation manually with a chain of actor events, I would use something like this:
ActorCreation
AnimPlay Lifetime PlayForever
ActorCreation
TimerStart
TimerExpired
TimerStart
TimerExpired
AnimSetCompletion Lifetime 0
The timer is looped by restarting itself when it expired, and whenever it expires, it resets the animation. You would obviously add the used animation yourself (like birth, stand or death), also you would need to specify a timer duration matching the animation length you want to loop.
The Medic has a permanent behavior added to it. Every 0.5 seconds a search effect is looped that adds a buff to nearby friendly units. The buff lasts for 0.6 seconds. The technical aspect of this ability works. Its only the visual that causes problems. When the Medic comes close to a friendly unit, the buff model is displayed. But only once! If the Medic stands still near units, they get the effect from the buff, but the model only appear once.
The AnimPlay message you use doesn't play any animation, because you selected (None) for the animation properties. Also, you still have the default animation bracket events, if you want to use AnimPlay instead, you should remove them.
For the model in question, you probably need the 3rd method I described. Do you know, how to copy a data object to your map using XML data? In this case, copy this:
<CActorModelid="PacifyVisual"parent="ModelAnimationStyleContinuousUNIT"><Onindex="0"Terms="Behavior.Pacify.On"Send="Create"/><Onindex="1"Terms="Behavior.Pacify.Off"Send="Destroy"/><Onindex="2"Terms="ActorCreation"Send="AnimPlay Lifetime Stand PlayForever"/><OnTerms="ActorCreation"Send="TimerSet"/><OnTerms="TimerExpired"Send="TimerSet 0.500000"/><OnTerms="TimerExpired"Send="AnimSetCompletion Lifetime"/><HostSiteOpsOps="SOpAttachOrigin"/><Modelvalue="Pacify"/></CActorModel>
Make sure you are not triggering any orphan parameters.
I didn't include the Actor Orphan -> Destroy, because from my understanding, there is no way for a behavior to apply without getting removed again, so the destroy message should always trigger. Could always add it just to be on the safe side, of course.
I have tried for some more hours, but still the model animation only appears once, and never loops. : /
I have tried to paste your XML data into the XML field but it does not work. I only get error messages. (I have looked at XML tutorials to get it right.)
I got a nice PM from Kueken himself. He told me this:
"€ okay, you say in the thread, you tried that already. Obviously, you cannot just paste it anywhere. When you open the XML view, it should look somewhat like this:
<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
(a whole bunch of stuff)
</Catalog>
Now, you have to paste the lines after all the stuff, but before the </Catalog> - tag"
If someone from the future would read this, you will now understand how to solve the problem! :)
Thank you!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Some models seems to always be on a buffed unit. For example Fungal Growth stays on the target unit for 15 seconds.
When I create a buff model, sometimes the model only appear in 1 second, even if the buff lasts for 10 seconds!
How can I make any model be used as a buff? Is it possible to "loop" a model so it stays on the buff until the buff is finished?
(I try to use Temporalfieldimpact.m3 as a buff. The model is only visible for 1 second)
That depends on the model in question. For some models, it is enough to use the AnimPlay actor message and check PlayForever, others require you to check the Automate Global Loops flag in the actor, and some would require you to loop their animation manually with a chain of actor events, I would use something like this:
The timer is looped by restarting itself when it expired, and whenever it expires, it resets the animation. You would obviously add the used animation yourself (like birth, stand or death), also you would need to specify a timer duration matching the animation length you want to loop.
Thank you.
Does it matter if the model itself is "Generic PersistentFX" or "Generic BuffFX" etc?
Let me specify a bit more:
The Medic has a permanent behavior added to it. Every 0.5 seconds a search effect is looped that adds a buff to nearby friendly units. The buff lasts for 0.6 seconds. The technical aspect of this ability works. Its only the visual that causes problems. When the Medic comes close to a friendly unit, the buff model is displayed. But only once! If the Medic stands still near units, they get the effect from the buff, but the model only appear once.
I have pictures below to show how it looks like.
The AnimPlay message you use doesn't play any animation, because you selected (None) for the animation properties. Also, you still have the default animation bracket events, if you want to use AnimPlay instead, you should remove them.
For the model in question, you probably need the 3rd method I described. Do you know, how to copy a data object to your map using XML data? In this case, copy this:
to your actor XML data as an example.
Make sure you are not triggering any orphan parameters.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
I didn't include the Actor Orphan -> Destroy, because from my understanding, there is no way for a behavior to apply without getting removed again, so the destroy message should always trigger. Could always add it just to be on the safe side, of course.
Thank you for your effort Kueken.
I have tried for some more hours, but still the model animation only appears once, and never loops. : /
I have tried to paste your XML data into the XML field but it does not work. I only get error messages. (I have looked at XML tutorials to get it right.)
Is all hope gone now..?
: /
I got a nice PM from Kueken himself. He told me this:
"€ okay, you say in the thread, you tried that already. Obviously, you cannot just paste it anywhere. When you open the XML view, it should look somewhat like this:
<?xml version="1.0" encoding="us-ascii"?> <Catalog> (a whole bunch of stuff) </Catalog>
Now, you have to paste the lines after all the stuff, but before the </Catalog> - tag"
If someone from the future would read this, you will now understand how to solve the problem! :)
Thank you!