Create:
Pretty straightforward: let a Lua function create a new projectile of (type, start position, vector, target).
Would allow for chained weapons, explosions that trigger more weapons (think cluster grenades, etc.) and other fun things.
Destroy:
Lua function to destroy (projectileID). Would probably require another function getting projectiles in a sphere, for short sorts.
Would allow for MIRV-type weapons without a lot hack-arounds, new types of Shield, anti-missile weapons that weren't vlaunch, and other useful things.
Allow Lua To Create and Destroy Projectiles
Moderator: Moderators
Re: Allow Lua To Create and Destroy Projectiles
For the second part:
Code: Select all
Spring.SetProjectileCollision(number projectileID) -> nil
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: Allow Lua To Create and Destroy Projectiles
+1
Would be cool to be able to kill a projectile and simply order another weapon to fire from its last position without much hassle (I guess just giving it a CEG to call preserving things like the direction would be a good idea)...
Would be cool to be able to kill a projectile and simply order another weapon to fire from its last position without much hassle (I guess just giving it a CEG to call preserving things like the direction would be a good idea)...
Re: Allow Lua To Create and Destroy Projectiles
OK, so if we set that to true, the projectile dies? Does it then give us an Explosion to read the position of?Spring.SetProjectileCollision(number projectileID) -> nil
Re: Allow Lua To Create and Destroy Projectiles
There's nothing to set to true, you just call it for the projectile and the projectile's collision code is called which usually makes it explode.