Homing missile

Get help using Construct 2

Post » Wed May 22, 2013 4:20 pm

@fassFlash:

Turret didn't exist a year ago when these posts were posted.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu May 23, 2013 1:34 pm

Anyways, the message quite clear no matter when. Pathfinding can go screw itself.
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,362

Post » Tue Jun 18, 2013 8:03 am

[QUOTE=jn2002dk] [QUOTE=sqiddster] If you want the missiles to behave a bit more realistically, I would suggest, instead of setting the angle straight towards the object, every tick set the angle to: anglelerp(rocket.angle,angle(rocket.x,rocket.y,target.x,target.y),dt*somespeedfactor)[/QUOTE]
Will try this

I can't claim to have a firm grasp of what lerp does exactly but it can't hurt to try. Thank you:)[/QUOTE]

nice work....but i dont understand what anglelerp means.sorry for the inconvenience
B
6
Posts: 31
Reputation: 639

Post » Tue Jun 18, 2013 2:29 pm

@planetheads:

If you check out the "[How do I] FAQ" thread by Kyatric there are some links to threads where lerp (linear interpolation) is explained in detail. Anglelerp is pretty much the same only it's meant for angles.

[quote=Manual]Unlike the standard lerp, this takes in to account the cyclical nature of angles.[/quote]Nimtrix2013-06-18 14:30:22
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jun 18, 2013 7:40 pm

Couldn't you justt use rotate towards object? :P
B
40
S
12
G
7
Posts: 603
Reputation: 7,646

Post » Tue Jun 18, 2013 7:46 pm

@EncryptedCow
You could, but it wouldn't be smoothed like the lerp would. Depends on what you want really.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Feb 07, 2014 11:12 am

i do really struggle with my homing missiles. but by whole project is quite complicated.
i have a family called all_chars with the four players in it p1_ship, p2_ship, p3... they all have an instance variable stored called "player" and the value of their player.

i now have a power up which should spawn a homing missile. i tried every f*** thing and didn't get it to work.
i stored the UID of the player who spawned the missile and let it chase the family all_chars for target which members dont have the same instance variable.

i tried to do it with the UID. something like
missile has target
missile.turret.targetUID not equals missile.originUID -> unacquire target.

i even tried it with for-loops, checked every player if he has the same instance variable as the missile and then acquired/unacquired the target.

how can i except players out of a family from the target objects.
problem is, my missile keeps chasing the wrong players and keeps exploding the wrong players.


I'd be veeeeeery happy about a sample capx of an advanced sample capx of a good working homing missile.

im afraid i can't share a capx because the scirra site is blocked from the content filter due to "games"
cheers!
phil
B
23
S
6
G
5
Posts: 132
Reputation: 4,487

Post » Fri Feb 07, 2014 6:27 pm

Sorry... this line got me....

a sample capx of an advanced sample capx

:)

You could always use the angle lerp method until the missile get's to within a certain distance and then switch over to the set angle towards object method at the end...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Previous

Return to How do I....?

Who is online

Users browsing this forum: benajad, Braus, R0J0hound, shinkan and 17 guests