Anyone got an idea?
steps to reproduce:
download
http://springfiles.com/spring/games/spring-tanks
(version rc5.2) or rapid: springtanks:latest
start the mod on any map
press ESC to hide menu or disable the widget
do
/cheat
/give tplegocar
/give tpflag 1
drive to the flag with the car.
What happens in 0.82.7.1:
As you get near, the flag will attach itself on top of the car like this:

This is because
gadgets\tp_gamelogic.lua
Code: Select all
blabla if unit is near flag then
env = Spring.UnitScript.GetScriptEnv(nearunitid)
if (env) then Spring.UnitScript.CallAsUnit(nearunitid,env.script.TransportPickup,flagid) end
Code: Select all
function script.TransportPickup (passengerID)
...
Spring.UnitScript.AttachUnit (flagattachpoint, passengerID)
...
end
The flag does not get attached to the car.
If you put an Echo before the AttachUnit() one can see everything else works until there.
In newer spring versions, the units spawned by mod do not run their unitscripts because of wrong layer in gadget. There are also some wrong/too many lua base files. Not sure if that matters since units spawned with /give work, but in case there is svn with fixed version:
https://code.google.com/p/springtanks/
Was AttachUnit() made to check stricter what can load what?
These units should be able to load the flag though, wrt mass, size.
(AttachUnit should be able to attach anything to anything!)