I'm trying to do something like the infestor's ability to launch eggs that morph into infested terrans, but instead make it a passive periodic behavior that launches eggs in the direction the unit is facing and instead of having them morph into infested terrans, make a delayed explosion like a grenade.
I have a behavior that runs a periodic effect. The effect is a create persistent effect with the field Target - Offset Expire set to (-3,-3) and the field Expire Effect set to the Launch Missile Effect. The Launch Missile's effect has the field Impact Location set to Target Point, the Source Location set to Caster Unit, and I have the Impact Effect set to an effect that creates a baneling.
When I test this, the missile is launched and always creates a baneling to the bottom left of the unit regardless of where the unit is facing. What I want is to have it so the missile is always launched and ends up in the direction the unit is facing.
I also tried setting the Impact Offset field in the Launch Missile effect instead of the Offset in the persistent effect, but that just creates banelings at my unit.
If you have a facing angle as integer or real, and there is a Sine() or cosine() function in the editor, then you can have the angle number in x and y coordiantes.
trigonometric functions on Wikipedia
I'm trying to do this in the data editor. I don't know how you would get the facing angle, apply functions to it, and then set offset fields to those values.
right now I don't have sc2 installed, so i cannot look it up. Applying a function could be done with a math action. Facing angle could be a unit property. But I don't know, sorry.
If you're trying to do this in the Data editor, you need to be working under the Events of the actor you are modifying. Here you can create conditions and events, almost like mini-triggers for a unit.
here you go. I wrote a little map. Open it and move the zealot. Then press left mouse button and the other unit will move in front of the zealot. If I understood you right, you wanted to do something like that.
I appreciate the attempt, but you didn't understand the effect I'm trying to create. I'm trying to make a behavior that periodically launches a grenade in the direction a unit is facing. I want it to look like the infestor's ability to launch eggs, but instead of being an ability, I want it to be a behavior that runs on its own. And instead of the eggs turning into infested terrans, I want them to explode after a small delay.
I've been able to do everything, except get the egg to launch in the right direction. My problem is that the target point the egg is launching to is based on absolute coordinates rather than relative to the direction the unit is facing.
The basic problem is that a periodic effect fired from a behavior cannot specify a target point, and without a second point of reference, the create persistent effect defaults to using the default orientation instead of the source unit's facing. The Offset Facing Fallback field should allow you to fix this but it either does something else or doesn't work at all (at least in my testing.)
That will allow you to hook a trigger whenever the behavior's period expires. Then in the trigger you can calculate the correct target point for the effect based on the unit's facing and then use the Create Effect At Point action to create your actual effect.
Thanks, that's exactly what I was going for. I was using the initial/final/expire fields and their corresponding offset fields and apparently those work differently from the periodic fields.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to do something like the infestor's ability to launch eggs that morph into infested terrans, but instead make it a passive periodic behavior that launches eggs in the direction the unit is facing and instead of having them morph into infested terrans, make a delayed explosion like a grenade.
I have a behavior that runs a periodic effect. The effect is a create persistent effect with the field Target - Offset Expire set to (-3,-3) and the field Expire Effect set to the Launch Missile Effect. The Launch Missile's effect has the field Impact Location set to Target Point, the Source Location set to Caster Unit, and I have the Impact Effect set to an effect that creates a baneling.
When I test this, the missile is launched and always creates a baneling to the bottom left of the unit regardless of where the unit is facing. What I want is to have it so the missile is always launched and ends up in the direction the unit is facing.
I also tried setting the Impact Offset field in the Launch Missile effect instead of the Offset in the persistent effect, but that just creates banelings at my unit.
@devilesk: Go
If you have a facing angle as integer or real, and there is a Sine() or cosine() function in the editor, then you can have the angle number in x and y coordiantes. trigonometric functions on Wikipedia
I'm trying to do this in the data editor. I don't know how you would get the facing angle, apply functions to it, and then set offset fields to those values.
@devilesk: Go
right now I don't have sc2 installed, so i cannot look it up. Applying a function could be done with a math action. Facing angle could be a unit property. But I don't know, sorry.
@devilesk: Go
If you're trying to do this in the Data editor, you need to be working under the Events of the actor you are modifying. Here you can create conditions and events, almost like mini-triggers for a unit.
@kozm0naut: Go
I don't really see how actor events will help me with the problem.
here you go. I wrote a little map. Open it and move the zealot. Then press left mouse button and the other unit will move in front of the zealot. If I understood you right, you wanted to do something like that.
I appreciate the attempt, but you didn't understand the effect I'm trying to create. I'm trying to make a behavior that periodically launches a grenade in the direction a unit is facing. I want it to look like the infestor's ability to launch eggs, but instead of being an ability, I want it to be a behavior that runs on its own. And instead of the eggs turning into infested terrans, I want them to explode after a small delay.
I've been able to do everything, except get the egg to launch in the right direction. My problem is that the target point the egg is launching to is based on absolute coordinates rather than relative to the direction the unit is facing.
@devilesk: Go
I haven't done much work with this type of thing, but you could try these settings in the create persistent effect.
Edit: I just had a play with the editor, this does work fine. See attached map.
The basic problem is that a periodic effect fired from a behavior cannot specify a target point, and without a second point of reference, the create persistent effect defaults to using the default orientation instead of the source unit's facing. The Offset Facing Fallback field should allow you to fix this but it either does something else or doesn't work at all (at least in my testing.)
The easiest way will be to use a trigger. Use this technique: http://rileystarcraft.blogspot.com/2010/06/tutorial-create-custom-trigger-hooks.html
That will allow you to hook a trigger whenever the behavior's period expires. Then in the trigger you can calculate the correct target point for the effect based on the unit's facing and then use the Create Effect At Point action to create your actual effect.
Hope that helps.
@Elemeno: Go
Thanks, that's exactly what I was going for. I was using the initial/final/expire fields and their corresponding offset fields and apparently those work differently from the periodic fields.