Projectile lua powerful enough for savegame.
Posted: 03 Mar 2015, 04:13
I would like to implement lua savegame with projectile saving/loading. It may be infeasible to save and load every projectile but I want to save the important ones. Players should not have the temptation to cheat by saving and loading the game when a nuke is launched at them.
For loading games Spring.SpawnProjectile and Spring.SetProjectileTarget look like they will be almost sufficient. Apparently projectile spawning can take many parameters which seem vital for spawning in flight projectiles (namely team and time to live). SetProjectileTarget will work for unit targets because CreateUnit can take a unitID as a parameter, unfortunately it will not work for interceptors because SpawnProjectile does not take a projectileID.
Spring.SpawnProjectile needs to take a projectileID as an optional parameter.
Extra functions are required for saving games because none of the useful parameters which can be set in Spring.SpawnProjectile can be read. Time to live and team are important, others may be important too but I have not discovered what they all do. There is also no Spring.GetAllProjectiles function, this would be nice to have as the current alternative is Spring.GetProjectilesInRectangle.
For loading games Spring.SpawnProjectile and Spring.SetProjectileTarget look like they will be almost sufficient. Apparently projectile spawning can take many parameters which seem vital for spawning in flight projectiles (namely team and time to live). SetProjectileTarget will work for unit targets because CreateUnit can take a unitID as a parameter, unfortunately it will not work for interceptors because SpawnProjectile does not take a projectileID.
Spring.SpawnProjectile needs to take a projectileID as an optional parameter.
Extra functions are required for saving games because none of the useful parameters which can be set in Spring.SpawnProjectile can be read. Time to live and team are important, others may be important too but I have not discovered what they all do. There is also no Spring.GetAllProjectiles function, this would be nice to have as the current alternative is Spring.GetProjectilesInRectangle.