Help with error terms

Everything about mods can be found here.

Moderator: Morax

Help with error terms

Postby RavenCurow » 22 Sep 2016, 13:29

So I'm trying to update the nomads as a pet project and I'm getting an error that I'm not sure what it means. It says a funtion being called in the nomadunits.lua is ambiguous in class definition. When I look at the line specified I can't see anything wrong with it. So I'm just wondering what it means when it says the function is ambiguous in class definition.
RavenCurow
Avatar-of-War
 
Posts: 98
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: Help with error terms

Postby CookieNoob » 22 Sep 2016, 14:46

I guess it means that the function is declared twice
Check out the next level of maps: viewtopic.php?f=53&t=13014
For adaptivity, customizability and less clutter in the vault.
User avatar
CookieNoob
Priest
 
Posts: 477
Joined: 02 Aug 2014, 17:07
Has liked: 65 times
Been liked: 249 times
FAF User Name: CookieNoob

Re: Help with error terms

Postby RocketRooster » 22 Sep 2016, 15:31

Does LUA have prototype overloading?
RocketRooster
Avatar-of-War
 
Posts: 294
Joined: 08 Apr 2016, 11:29
Has liked: 29 times
Been liked: 52 times
FAF User Name: RocketRooster

Re: Help with error terms

Postby Uveso » 22 Sep 2016, 21:21

I dont know, why you get this error, but its from the function InsertIndexFields() inside class.lua

Maybe your are defining a class twice ?
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Help with error terms

Postby RavenCurow » 23 Sep 2016, 00:41

No, the function isn't being called twice far as I can see. At least not for the same unit type. It's calling the OnTransportAttach function for the hover unit.
RavenCurow
Avatar-of-War
 
Posts: 98
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: Help with error terms

Postby Uveso » 23 Sep 2016, 02:41

Well, then i don't have a clue whats going on there :(
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Help with error terms

Postby RavenCurow » 23 Sep 2016, 02:45

I wonder if it's because the exphover unit is calling the nhoverunit class in the same lua as the nhoverunit. Only thing I can think of.
RavenCurow
Avatar-of-War
 
Posts: 98
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: Help with error terms

Postby RavenCurow » 23 Sep 2016, 03:43

Code: Select all
WARNING: ...data\faforever\gamedata\lua.nx2\lua\system\class.lua(147): field 'OnTransportAttach' is ambiguous in class definition
WARNING: stack traceback:
WARNING:         [C]: in function `error'
WARNING:         ...data\faforever\gamedata\lua.nx2\lua\system\class.lua(147): in function <...data\faforever\gamedata\lua.nx2\lua\system\class.lua:125>
WARNING:         ...data\faforever\gamedata\lua.nx2\lua\system\class.lua(154): in function <...data\faforever\gamedata\lua.nx2\lua\system\class.lua:125>
WARNING:         ...data\faforever\gamedata\lua.nx2\lua\system\class.lua(165): in function <...data\faforever\gamedata\lua.nx2\lua\system\class.lua:160>
WARNING:         ...data\faforever\gamedata\lua.nx2\lua\system\class.lua(212): in function <...data\faforever\gamedata\lua.nx2\lua\system\class.lua:208>
WARNING:         ...data\faforever\gamedata\lua.nx2\lua\defaultunits.lua(1827): in main chunk
WARNING:         [C]: in function `doscript'
WARNING:         [C]: in function `pcall'
WARNING:         ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
WARNING:         ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
WARNING:         ...a\faforever\gamedata\nomads.nomad\lua\nomadunits.lua(4): in main chunk


Here is the error log for the function. Now that I look at it, perhaps its not the nomadunits.lua that its saying has an ambiguous function and the default units file itself.
RavenCurow
Avatar-of-War
 
Posts: 98
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: Help with error terms

Postby Uveso » 24 Sep 2016, 14:03

I am sorry still no clue. :(
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Help with error terms

Postby Crotalus » 25 Sep 2016, 02:29

Check if the unit is a descendant of AircraftCarrier / AirTransport / BaseTransport (they are defined in defaultunits.lua) but also has OnTransportAttach defined somewhere else in its class or another parent class of it.

The problem is that some units are inheriting two classes which can cause this error.
Crotalus
Priest
 
Posts: 319
Joined: 27 Jan 2013, 20:37
Has liked: 2 times
Been liked: 102 times
FAF User Name: Crotalus

Next

Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest