Page 1 of 1
SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 26 May 2012, 13:23
by ismo
Hi,
I tried to run BOTA mod with current spring and I run into problem that game initialization (game_spawn.lua) throws exception when trying to call Spring.SetUnitLineage(unitID, teamID, true)
Anyways the mod starts but game initialization is half done (start metal & energy is always 0 - no matter what set from lobby or the default 1000 values).
So I looked from xtar mod and found out that in it the call to SetUnitLineage had been commented out as. I did that in Bota too however now I am wondering should I add some additional initialization code?
From
http://springrts.com/wiki/Lua_SyncedCtrl I found out that
Spring.SetUnitLineage
Removed from version 83.0
( number unitID, number teamID [, boolean isRoot] ) -> nil
Re: SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 26 May 2012, 14:42
by Google_Frog
It will take a bit of work to get BOTA working because it relies on some special case code that has been removed from the engine. Try taking BA's initialisation gadget.
Re: SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 27 May 2012, 12:15
by PepeAmpere
ismo wrote:Hi,
I tried to run BOTA mod with current spring and I run into problem that game initialization (game_spawn.lua) throws exception when trying to call Spring.SetUnitLineage(unitID, teamID, true)
Anyways the mod starts but game initialization is half done (start metal & energy is always 0 - no matter what set from lobby or the default 1000 values).
So I looked from xtar mod and found out that in it the call to SetUnitLineage had been commented out as. I did that in Bota too however now I am wondering should I add some additional initialization code?
From
http://springrts.com/wiki/Lua_SyncedCtrl I found out that
Spring.SetUnitLineage
Removed from version 83.0
( number unitID, number teamID [, boolean isRoot] ) -> nil
Hi, I can repair the BOTA, but i suggest Thor's later work... NOTA - that enhances concepts of BOTA much more and its still maintained.
Try it.
Re: SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 27 May 2012, 19:59
by Beherith
Lineage has been fully removed from engine. You can use the ba game spawb gadget instead.
Re: SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 28 May 2012, 09:36
by knorke
iirc the lineage thing was something where it kept track of the original owner when a unit was shared to other players. idea was to prevent the "share units to teammate 1 seconde before commander dies in com-ends matches." So if you not need that, just remove the line.
Re: SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 28 May 2012, 16:09
by ismo
Thank you all from good comments. I ran into another 4 lua script issues which of 2 I managed to fix already.
The remaining ones are:
Error #1:
[f=0000000] Error: [WeaponDefIndex] ERROR_TYPE for key "areaOfEffect" in WeaponDefs __index
(I could not find source of above error but my guess it is that it is related to gui_attack_aoe_bota.lua - see the #2 error)
Error #2:
f=0000000] Error in Initialize(): [string "LuaUI/Widgets/gui_attack_aoe_bota.lua"]:182: attempt to compare number with nil
This is coming from initialization / function SetupUnitDef(unitDefID, unitDef), from line
Code: Select all
and (weaponDef.areaOfEffect > maxSpread or weaponDef.range * (weaponDef.accuracy + weaponDef.sprayAngle) > maxSpread )
However I think that SetupUnitDef is ok, thus the source must be in some weapon tdf etc file (just my guess). Jools was thinking that perhaps areaOfEffect is not defined for some needed weapon(s).
I also noticed that Ray's xtar 1.03 mod is getting these two errors too (I guess as it is no longer developed?) but Deadnight's XTA mod did not get. So I tried to copy the gui_attack_aoe_xta.lua from Deadnight's mod but that resulted into ~20 new ERROR_TYPE for key "maxVelocity" in WeaponDefs __index errors.
P.S. Perhaps I try NOTA someday, haven't tested it for a year or so.
Re: SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 28 May 2012, 16:16
by Beherith
2) wdef[id].areaOfEffect was made redundant and clearly tagged for removal after the introduction of wdef[id].damageAreaOfEffect + wdef[id].craterAreaOfEffect in 85.0 (as can be found in the changelog)
wdef[id].maxVelocity was already marked deprecated
Re: SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 28 May 2012, 21:42
by Deadnight Warrior
When in doubt
look into SVN. XTA 9.71 has an outdated AreaOfEffect widget, but latest beta doesn't (at least I think it's fixed, as I have a local copy since some other less maintained games might have problems with this as well)
Re: SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 28 May 2012, 23:32
by Jools
The problem is also that sometimes mods define their own names for some parameters, so you cannot just look up in the
wiki for the name of some parameter.
For example, the original OTA name is "soundhit", bit it is defined as WeaponDefs[3]["hitSound"] in the wiki.
Re: SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 28 May 2012, 23:33
by smoth
There are not that many projects. It isn't THAT big a deal.
Re: SetUnitLineage call in Game spawn lua of BOTA mod
Posted: 28 May 2012, 23:35
by Jools
I guess that one is redefined by the engine.