roman-murashov / hedgewars

Automatically exported from code.google.com/p/hedgewars
GNU General Public License v2.0
0 stars 0 forks source link

Lua API: Manally set respawn position for heResurrectable / onGearResurrect #968

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is a feature request.

I wish to be able to manually set the respawn position if a hedgehog is 
resurrected via heResurrectable.

One possible way is to let onGearResurrect make an optional return value of 
format x, y. If this is returned, the gear is respawned at this position. If 
nil is returned, the gear is randomly respawned (this is the old behaviour).

Just calling SetGearPosition in onGearResurrect is not a real solution, as you 
will still see the resurrection visual gear (an explosion effect?) at the 
original random position, which is a bit irritating.

Example: If I write this in my Lua script, Hedgewars should always resurrect 
gears at X=500, Y=20.

function onGearResurrect()
return 500, 20
end

Original issue reported on code.google.com by almikes@aol.com on 7 Aug 2015 at 8:06