View topic - SetUnitLineage call in Game spawn lua of BOTA mod



All times are UTC + 1 hour


Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: 26 May 2012, 12:23 

Joined: 27 Dec 2009, 13:52
Location: Finland
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


Top
 Offline Profile  
 
PostPosted: 26 May 2012, 13:42 
Moderator

Joined: 12 Oct 2007, 08:24
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.


Top
 Offline Profile  
 
PostPosted: 27 May 2012, 11:15 
User avatar

Joined: 03 Jun 2010, 00:28
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.


Top
 Offline Profile  
 
PostPosted: 27 May 2012, 18:59 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Lineage has been fully removed from engine. You can use the ba game spawb gadget instead.


Top
 Offline Profile  
 
PostPosted: 28 May 2012, 08:36 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
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.


Top
 Offline Profile  
 
PostPosted: 28 May 2012, 15:09 

Joined: 27 Dec 2009, 13:52
Location: Finland
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:
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.


Top
 Offline Profile  
 
PostPosted: 28 May 2012, 15:16 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Quote:
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)


Quote:
wdef[id].maxVelocity was already marked deprecated


Top
 Offline Profile  
 
PostPosted: 28 May 2012, 20:42 
User avatar

Joined: 08 Jun 2009, 16:59
Location: Croatia
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)


Top
 Offline Profile  
 
PostPosted: 28 May 2012, 22:32 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
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, 22:34, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 28 May 2012, 22:33 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
There are not that many projects. It isn't THAT big a deal.


Top
 Offline Profile  
 
PostPosted: 28 May 2012, 22:35 
User avatar

Joined: 23 Feb 2009, 16:29
Location: Finland
I guess that one is redefined by the engine.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.