There might be a few different ways to go about this, and I think I can work it out but I just wanted to check what everyone thought the best way was.
Basically I want to throw a grenade by selecting a target to attack, when the grenade lands it sits there for 5 seconds before exploding. If the target unit moves out of the blast range it doesn't get hurt, and vice versa if any unit moves into the blast range.
What I was considering is:
Launch missile effect creates a unit on impact
Unit has a buff with a periodic effect
when the periodic effect expires the unit explodes, damaging the area
Concerns
how do I get the missile to land at the point that the targetted unit was when the effect was launched (incase the target moved)
I'm not that great at the data editor, but I'm pretty sure you can do it without the unit.
Yeah I think it might be possible. Currently I have it working so that the grenade is thrown, and the damage occurs after 5 seconds. What I need is a model to be created at that point, so I should be able to create an actor for this and probably don't need a unit.
As the the not following the target thing, just exclude units as the target (only allow ground targeting).
I'm actually doing this as a weapon, so there will be no manual targetting meaning they have to be able to target units. Imagine it as a grenade launcher weapon that fires grenads that explode after 5 seconds.
1. Change the launch missile effect's location to "Target Point"
2. Yes, using a model actor and a persistent effect. Have the launch effect's impact effect be a create persistent effect that has an expire delay and as its expire effect the damage effect. (Could I say effect any more times?) Make sure its location is "Target Point." Then make a model actor with events that look like this:
Effect.GrenadePersistentEffect.Start
At Effect
Create
Effect.GrenadePersistentEffect.Stop
Destroy
Finally edit the Host field and remove "_Selectable", the subject should be blank. You might also want to fiddle with the host site operations, SOpShadow is probably best for what you're doing.
Okay I think I have it mostly working, most of what you said seemed to work, however when I removed the Host field it didn't like it and didn't create the model actor at all. So I left that as _Selectable and change the Host Site Op to SOpTargetPoint which made it stay wherever it landed.
All I need to do now is find an appropriate model and add an explosion effect when it blows up, it currently does this but only if it damages a unit for some reason.
I guess I can create another actor and essentially do the same thing as I did for model.
There might be a few different ways to go about this, and I think I can work it out but I just wanted to check what everyone thought the best way was.
Basically I want to throw a grenade by selecting a target to attack, when the grenade lands it sits there for 5 seconds before exploding. If the target unit moves out of the blast range it doesn't get hurt, and vice versa if any unit moves into the blast range.
What I was considering is:
Concerns
I'm not that great at the data editor, but I'm pretty sure you can do it without the unit.
As the the not following the target thing, just exclude units as the target (only allow ground targeting).
Yeah I think it might be possible. Currently I have it working so that the grenade is thrown, and the damage occurs after 5 seconds. What I need is a model to be created at that point, so I should be able to create an actor for this and probably don't need a unit.
I'm actually doing this as a weapon, so there will be no manual targetting meaning they have to be able to target units. Imagine it as a grenade launcher weapon that fires grenads that explode after 5 seconds.
1. Change the launch missile effect's location to "Target Point"
2. Yes, using a model actor and a persistent effect. Have the launch effect's impact effect be a create persistent effect that has an expire delay and as its expire effect the damage effect. (Could I say effect any more times?) Make sure its location is "Target Point." Then make a model actor with events that look like this:
Effect.GrenadePersistentEffect.Start
At Effect
Create
Effect.GrenadePersistentEffect.Stop
Destroy
Finally edit the Host field and remove "_Selectable", the subject should be blank. You might also want to fiddle with the host site operations, SOpShadow is probably best for what you're doing.
Thanks Riley, helpful as usual!
Okay I think I have it mostly working, most of what you said seemed to work, however when I removed the Host field it didn't like it and didn't create the model actor at all. So I left that as _Selectable and change the Host Site Op to SOpTargetPoint which made it stay wherever it landed.
All I need to do now is find an appropriate model and add an explosion effect when it blows up, it currently does this but only if it damages a unit for some reason.
I guess I can create another actor and essentially do the same thing as I did for model.
Hmm what would be the best way to create the explosion effect when the periodic effect expires?
I created another model actor that is supposed to be created when the persisten effect stops (via events). Is this the correct way to do it?
Also do I need something in the events to remove it, such as ActorOrphan->Destroy?