SetUnitLineage call in Game spawn lua of BOTA mod

SetUnitLineage call in Game spawn lua of BOTA mod

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
ismo
Posts: 33
Joined: 27 Dec 2009, 13:52

SetUnitLineage call in Game spawn lua of BOTA mod

Post 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
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: SetUnitLineage call in Game spawn lua of BOTA mod

Post 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.
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: SetUnitLineage call in Game spawn lua of BOTA mod

Post 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.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: SetUnitLineage call in Game spawn lua of BOTA mod

Post by Beherith »

Lineage has been fully removed from engine. You can use the ba game spawb gadget instead.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: SetUnitLineage call in Game spawn lua of BOTA mod

Post 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.
ismo
Posts: 33
Joined: 27 Dec 2009, 13:52

Re: SetUnitLineage call in Game spawn lua of BOTA mod

Post 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.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: SetUnitLineage call in Game spawn lua of BOTA mod

Post 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
User avatar
Deadnight Warrior
Posts: 183
Joined: 08 Jun 2009, 17:59

Re: SetUnitLineage call in Game spawn lua of BOTA mod

Post 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)
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: SetUnitLineage call in Game spawn lua of BOTA mod

Post 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.
Last edited by Jools on 28 May 2012, 23:34, edited 1 time in total.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: SetUnitLineage call in Game spawn lua of BOTA mod

Post by smoth »

There are not that many projects. It isn't THAT big a deal.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: SetUnitLineage call in Game spawn lua of BOTA mod

Post by Jools »

I guess that one is redefined by the engine.
Post Reply

Return to “Game Development”