Allow Lua To Create and Destroy Projectiles

Allow Lua To Create and Destroy Projectiles

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Allow Lua To Create and Destroy Projectiles

Post by Argh »

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.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Allow Lua To Create and Destroy Projectiles

Post by Kloot »

For the second part:

Code: Select all

Spring.SetProjectileCollision(number projectileID) -> nil
Master-Athmos
Posts: 916
Joined: 27 Jun 2009, 01:32

Re: Allow Lua To Create and Destroy Projectiles

Post by Master-Athmos »

+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)...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Allow Lua To Create and Destroy Projectiles

Post by Argh »

Spring.SetProjectileCollision(number projectileID) -> nil
OK, so if we set that to true, the projectile dies? Does it then give us an Explosion to read the position of?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Allow Lua To Create and Destroy Projectiles

Post by KDR_11k »

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.
Post Reply

Return to “Feature Requests”