Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GADGET:
- function gadget:GetInfo()
- return {
- name = "feature exploder",
- desc = "on destruction features are replaced with a unit that plays a fall over animation or w/e",
- author = "knorke",
- date = "April 2011, 2011",
- license = "horse has fallen over",
- layer = -3,
- enabled = true
- }
- end
- function gadget:FeatureDestroyed(featureID, allyTeam)
- Spring.Echo ("feature " .. featureID .. " was destroyed")
- local x,y,z = Spring.GetFeaturePosition (featureID)
- Spring.Echo (x .." " .. y .. " " .. z)
- local u = Spring.CreateUnit ("tptree",x,y,z, 0,0)
- Spring.SetUnitBlocking (u, false)
- end
- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
- UNITSCRIPT:
- local base = piece "base"
- function script.Create()
- --Spring.Echo ("unit " .. unitID .. " was created!")
- Turn (base, y_axis, math.rad(math.random(0,360)))
- Turn (base, x_axis, math.rad (90),math.rad(90))
- WaitForTurn (base,x_axis)
- Move (base, y_axis, -50, 20)
- WaitForMove (base,y_axis)
- Spring.DestroyUnit (unitID)
- end
- function script.FireWeapon1()
- Sleep(30)
- end
- function script.Killed(recentDamage, maxHealth)
- Sleep(30)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement