Hi, I'm in a bit of a trouble. When I order the actor, to play animation, when ability (any), i't doesn't do anything. Maybe it's asking for the unit to use the ability?
My concept: Unit2 comes, targets unit with channeling skill, the unit plays the animation. Is it executable, or I'm better off with triggers?
ˇˇˇˇˇ
When unit is targeted by ability->use skill(morph). Actor: When skill is used, play animation.
When you use Ability events, you can specify where and at what stage of the ability the event should fire. So you should have an Event of Ability, with the 2nd drop down being Target (Stage Here). Stages included Channel, Cast, Prepare, Final. You can also specify if the event should occur when the stage starts or ends (For example, when the Ability has a cast time, do you want the animation to start when the casting begins or ends?).
That being said, it appears you want an animation to play when the unit is targeted by any ability. In which case, something like Funky's solution would work. You will need a way to have the animation play when the unit is hit by any ability. The most likely way to have this happen is to specify on the first unit that when any Effect occurs on it (so Effect event), play the animation.
I'm currently away from the editor, but if that is what you are looking for, I may be able to code up a simple example.
To be honest, I'm currently creating a Dawn of War like element in the game with it (the control points). So maybe I eventually need to trigger it for the morph ability to start anyway. Idea: Unit comes near it, starts channeling (Healer +2 energy/sec, unit has -1 energy/sec, so it would degenerate influence like in DoW), and when unit reaches 100 energy, it transforms to the activated control point.
The problem with my idea so far is, that it would run when unit reaches 100 energy, and then morph+animation would need to happen super fast.
That's why I want to start animation when channeling starts, stop animation when channeling stops. Then morph would happen in the background, the player doesn't need to know the nasty way I solved the problem
You will want to explore the usage of Interact Abilities. Or possibly just an effect instant.
If it is based purely on the unit approaching the point and being within a certain range, you can use an effect - Target ability with autocasting. The control point itself would cast this ability and place a persistent on the target unit. This persistent would be channeled or possibly just run 100 periods of 1 second each, or however you want to define the duration. The animation of showing the capture would start with the intital/start of the persistent, and end with completion of the persistent. The persistent would have a periodic validator to make sure the capturing unit is within range, if not, the persistent is destroyed and the capture ends. You would also need to include a validator of sorts to check for units of multiple factions being present so if the point is contested, the capture is paused. This may be better handled with behaviors since they can be easily "paused" by being disabled.
On the other hand, if this assumes the unit must actively attempt to capture the point as in Dawn of War, simply use a battery ability. Battery abilities are abilities that react to the unit with it being right clicked (smart command targeted). This is in reference to the Starcraft 1 Shield Battery, which you just right clicked to have it immediately start recharging the unit shields. You can control what units can use the battery ability and what the targets for the effect that runs as well. So in this case, being right clicked by a faction would simply create a persistent on the control point that is channeled (by the capturing units, they effectively would be the "casters"). So if they die or break off, the casting ends.
As for the animation itself, you will want to explore the Duration field, it allows you to control how the animation is played. You can play it as is, scale it according to the time scale of the actor, use an absolute time scale or specify a duration directly, in which case the game will scale the animation to fit that duration (So if the animation takes 5 seconds to play and you specify a duration of 50 seconds, it will simply play the animation at 1/10th speed.
As for the model on capture, you can simply check for the end of the capture, use a validator on the event (terms), and do a modal swap. Likewise, swap out the model if the point is already captured and play the uncapture animation.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi, I'm in a bit of a trouble. When I order the actor, to play animation, when ability (any), i't doesn't do anything. Maybe it's asking for the unit to use the ability?
My concept: Unit2 comes, targets unit with channeling skill, the unit plays the animation. Is it executable, or I'm better off with triggers? ˇˇˇˇˇ When unit is targeted by ability->use skill(morph). Actor: When skill is used, play animation.
add a behaviour to the target starting channeling your ability. then add a behavior event on the unit to play its animation
When you use Ability events, you can specify where and at what stage of the ability the event should fire. So you should have an Event of Ability, with the 2nd drop down being Target (Stage Here). Stages included Channel, Cast, Prepare, Final. You can also specify if the event should occur when the stage starts or ends (For example, when the Ability has a cast time, do you want the animation to start when the casting begins or ends?).
That being said, it appears you want an animation to play when the unit is targeted by any ability. In which case, something like Funky's solution would work. You will need a way to have the animation play when the unit is hit by any ability. The most likely way to have this happen is to specify on the first unit that when any Effect occurs on it (so Effect event), play the animation.
I'm currently away from the editor, but if that is what you are looking for, I may be able to code up a simple example.
@ArcaneDurandel: Go
To be honest, I'm currently creating a Dawn of War like element in the game with it (the control points). So maybe I eventually need to trigger it for the morph ability to start anyway. Idea: Unit comes near it, starts channeling (Healer +2 energy/sec, unit has -1 energy/sec, so it would degenerate influence like in DoW), and when unit reaches 100 energy, it transforms to the activated control point.
The problem with my idea so far is, that it would run when unit reaches 100 energy, and then morph+animation would need to happen super fast.
That's why I want to start animation when channeling starts, stop animation when channeling stops. Then morph would happen in the background, the player doesn't need to know the nasty way I solved the problem
Ahh. There is a much better method to this.
You will want to explore the usage of Interact Abilities. Or possibly just an effect instant.
If it is based purely on the unit approaching the point and being within a certain range, you can use an effect - Target ability with autocasting. The control point itself would cast this ability and place a persistent on the target unit. This persistent would be channeled or possibly just run 100 periods of 1 second each, or however you want to define the duration. The animation of showing the capture would start with the intital/start of the persistent, and end with completion of the persistent. The persistent would have a periodic validator to make sure the capturing unit is within range, if not, the persistent is destroyed and the capture ends. You would also need to include a validator of sorts to check for units of multiple factions being present so if the point is contested, the capture is paused. This may be better handled with behaviors since they can be easily "paused" by being disabled.
On the other hand, if this assumes the unit must actively attempt to capture the point as in Dawn of War, simply use a battery ability. Battery abilities are abilities that react to the unit with it being right clicked (smart command targeted). This is in reference to the Starcraft 1 Shield Battery, which you just right clicked to have it immediately start recharging the unit shields. You can control what units can use the battery ability and what the targets for the effect that runs as well. So in this case, being right clicked by a faction would simply create a persistent on the control point that is channeled (by the capturing units, they effectively would be the "casters"). So if they die or break off, the casting ends.
As for the animation itself, you will want to explore the Duration field, it allows you to control how the animation is played. You can play it as is, scale it according to the time scale of the actor, use an absolute time scale or specify a duration directly, in which case the game will scale the animation to fit that duration (So if the animation takes 5 seconds to play and you specify a duration of 50 seconds, it will simply play the animation at 1/10th speed.
As for the model on capture, you can simply check for the end of the capture, use a validator on the event (terms), and do a modal swap. Likewise, swap out the model if the point is already captured and play the uncapture animation.