Resurrectable features/wrecks
Posted: 02 Jul 2012, 18:03
There is a simple way of doing it, but it has some drawbacks, namely its mod specific.
Include the following example gadget in your map at /luarules/gadgets/map_resurrectable_feature.lua
Edit: This runs at frame 0, so the feature wont be on map until game start. If the feature is coded onto the map, then the procedure is a bit different, but setfeatureresurrect can still be used.
Include the following example gadget in your map at /luarules/gadgets/map_resurrectable_feature.lua
Code: Select all
function gadget:GetInfo()
return {
name = "Resurrectabke wreck placer",
desc = "Resurrectabke wreck placer",
author = "beherith",
date = "2012 july",
license = "GNU GPL, v2 or later",
layer = 10,
enabled = true
}
end
if (not gadgetHandler:IsSyncedCode()) then
return false
end
function gadget:Initialize()
wreck=Spring.CreateFeature('corstorm_dead', 2100, 0, 2000) --x,y,z positions
Spring.SetFeatureResurrect(wreck,'corstorm')
end