Jump to content
jonipetteri

Unit X moving to Unit Y position, even when Y is moving?

Recommended Posts

Yeah, I need help with this:

 

I'm trying to use trigger to move Unit X to playable unit, even when playable unit moves away from triggered point. 

So like, Unit X is kind of following whoever (any player) triggered it.

Suicide bomber purposes...

 

Thanks in advance.

Share this post


Link to post
Share on other sites

I play with setWaypointPosition in a smooth loop. The bomber has a short life time anyway!

I have 100% success with that.

Bombers is running to the nearest unit of your group. You have a short delay to flee or kill him. flee is possible if you're in vehicle. The slot for killing him is about 3 seconds after he is yelling "Allah Ackbar". So, just enough to look at his direction and shoot. If he explodes, the bomb is sufficient enough to blow all vehicles/houses within 15 m (so fleeing is not a very good idea). If you succeed in kill him, you can grab his charges.

  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, ofp_f3d3 said:

You can use this:

 


_soldier1 doFollow _soldier2

 

 

Only works on units of the same group, used to make AI fall back into formation etc, doesn't do what you think it does, heh.

 

Also worth to consider using this:

_bomber setAnimSpeedCoef ((getAnimSpeedCoef _target) * 1.25)

for a guaranteed bombing.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites
Quote

Only works on units of the same group, used to make AI fall back into formation etc, doesn't do what you think it does, heh.

Thats what i get for not reading the user comments on the wiki, and trusting completly on bi´s documentation.

 

what about this code:

 

while {alive _bomber} do
{
	_bomber doMove (position _target);
	sleep 5; //give some time for ai to move
}

the documentation mentions that if the unit belongs in a group, after reaching the final position, it will return to formation, but the while should keep him on his way to the target.

Share this post


Link to post
Share on other sites
11 minutes ago, ofp_f3d3 said:

Thats what i get for not reading the user comments on the wiki, and trusting completly on bi´s documentation.

 

what about this code:

 


while {alive _bomber} do
{
	_bomber doMove (position _target);
	sleep 5; //give some time for ai to move
}

the documentation mentions that if the unit belongs in a group, after reaching the final position, it will return to formation, but the while should keep him on his way to the target.

This way the AI will move to a position with (in worst case) a 5 seconds delay. Might be enough for the target to be long gone.

If a player knows how this script works it's easy to completely break the bomber by just moving all the time.

For a successful AI bomber there's quite some stuff needed, knowing at what distance the explosion will be lethal helps quite a bit, also I'd rather use a function to calculate the targets anticipated position and have the bomber intercept the target, something like this:

Can be easily modified.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites

I often just attach a wp to the target and set condition to false and they will follow. Works for as well vehicles sort of.

  • Like 1

Share this post


Link to post
Share on other sites
On 3/18/2019 at 6:25 PM, pierremgi said:

I play with setWaypointPosition in a smooth loop. The bomber has a short life time anyway!

I have 100% success with that.

Bombers is running to the nearest unit of your group. You have a short delay to flee or kill him. flee is possible if you're in vehicle. The slot for killing him is about 3 seconds after he is yelling "Allah Ackbar". So, just enough to look at his direction and shoot. If he explodes, the bomb is sufficient enough to blow all vehicles/houses within 15 m (so fleeing is not a very good idea). If you succeed in kill him, you can grab his charges.

Can you share the code you are using?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×