re: tracking the target while dancing

re: tracking the target while dancing

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
8611
XTA Developer
Posts: 242
Joined: 29 Dec 2014, 08:22

re: tracking the target while dancing

Post by 8611 »

viewtopic.php?f=23&t=31799#p568160
shizuo wrote:I just wonder if you can make a moving target and the missile still keeps on tracking the target while dancing.
If the target-unit is moving a missile can still track it.
There are two ways for missiles to dance:
1) engine physics: Missiles have "wobble" and "dance" parameters that randomize their movement: https://springrts.com/wiki/Gamedev:Weap ... leLauncher
How reliably such missiles tracks their target mostly depends on whether their tracking "turnRate" can compensate the randomness.
2) It depedends whatever you do with the existing Lua projectile-functions. The "dance" tag can be re-created with Spring.SetProjectilePosition() to give more control, for example to make the movement less random the closer the projectile comes to the target.
The "wobble" tag would require Spring.SetProjectileDirection() (I guess like https://github.com/spring/spring/blob/d ... .cpp#L2745 but proj->dir instead of proj->pos)
Even without SetProjectileDirection
a projectile could dance a lot or fly in a search-pattern before it eventually becomes accurate.
Image

Image
Post Reply

Return to “Lua Scripts”