Error with New Shield Enhancment

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

Error with New Shield Enhancment

Postby brandonpotter0 » 05 Aug 2014, 18:04

Code: Select all
WARNING: Error running OnFrame script in CScriptObject at 26ea7fc0: ...\faforever\gamedata\lua.nx2\lua\ui\game\unitview.lua(466): attempt to perform arithmetic on local `ShieldMaxHealth' (a nil value)
         stack traceback:
            ...\faforever\gamedata\lua.nx2\lua\ui\game\unitview.lua(466): in function <...\faforever\gamedata\lua.nx2\lua\ui\game\unitview.lua:180>
            ...\faforever\gamedata\lua.nx2\lua\ui\game\unitview.lua(597): in function <...\faforever\gamedata\lua.nx2\lua\ui\game\unitview.lua:594>
            ...\faforever\gamedata\lua.nx2\lua\ui\game\unitview.lua(910): in function `UpdateWindow'
            ...\faforever\gamedata\lua.nx2\lua\ui\game\unitview.lua(879): in function <...\faforever\gamedata\lua.nx2\lua\ui\game\unitview.lua:841


ACU Script - Shield Ench starts at Line 344
http://pastebin.com/RaAEFJxm

ACU BP - Shield Info at 552
http://pastebin.com/mLmEuQGv

Any idea why this happens? The Ench seems to work fine, but when I mouse over the ACU when this upgrade is used/on, the UI throws up errors and doesnt work.
User avatar
brandonpotter0
Avatar-of-War
 
Posts: 65
Joined: 19 Oct 2013, 03:05
Location: In bed with the Borg Queen. Bow Chicka bow wow ;)
Has liked: 0 time
Been liked: 0 time

Re: Error with New Shield Enhancment

Postby Gorton » 06 Aug 2014, 19:47

This is from a mod?
If it is, this should be in general discussions- (sub section useful tools and mods).
Tech Support is for fixing problems with the lobby and base game.
I will move it to there.
"who is this guy, he didnt play gpg or what?" - RA_ZLO

*FAF Moderator*
Gorton
Councillor - Moderation
 
Posts: 2543
Joined: 16 Apr 2013, 21:57
Location: United Kingdom
Has liked: 1067 times
Been liked: 455 times
FAF User Name: Gorton

Re: Error with New Shield Enhancment

Postby brandonpotter0 » 06 Aug 2014, 21:28

Gorton wrote:This is from a mod?
If it is, this should be in general discussions- (sub section useful tools and mods).
Tech Support is for fixing problems with the lobby and base game.
I will move it to there.

Sorry, Didint know any better :)

And if you can move it to general, then Please :-)

This is for my mod that Im trying to make compatible with FAF.
User avatar
brandonpotter0
Avatar-of-War
 
Posts: 65
Joined: 19 Oct 2013, 03:05
Location: In bed with the Borg Queen. Bow Chicka bow wow ;)
Has liked: 0 time
Been liked: 0 time

Re: Error with New Shield Enhancment

Postby Anaryl » 07 Aug 2014, 08:24

So what does the traceback say "trying to perform arithmetic on a nil value 'shieldmaxhealth, a nil value"

So that strongly suggests that you haven't declared a value for the variable you are trying to perform a function on.
Image
User avatar
Anaryl
Banned
 
Posts: 453
Joined: 20 Dec 2011, 18:54
Location: Rohangrad
Has liked: 13 times
Been liked: 6 times
FAF User Name: Anaryl

Re: Error with New Shield Enhancment

Postby Sheeo » 07 Aug 2014, 10:12

Anaryl wrote:So what does the traceback say "trying to perform arithmetic on a nil value 'shieldmaxhealth, a nil value"

So that strongly suggests that you haven't declared a value for the variable you are trying to perform a function on.


In that case, the error would be undefined variable.

What you're referencing is uninitialized, or just set to nil. Would need to see the code to say why that is.
Support FAF on patreon: https://www.patreon.com/faf?ty=h

Peek at our continued development on github: https://github.com/FAForever
Sheeo
Councillor - Administrative
 
Posts: 1038
Joined: 17 Dec 2013, 18:57
Has liked: 109 times
Been liked: 233 times
FAF User Name: Sheeo

Re: Error with New Shield Enhancment

Postby Anaryl » 07 Aug 2014, 12:14

I don't know lua so well but maybe its calling a local variable instead of a friend/member of the function's parent class? I had a quick look over the code - it would be helpful if you commented in the code where your stuff was
Image
User avatar
Anaryl
Banned
 
Posts: 453
Joined: 20 Dec 2011, 18:54
Location: Rohangrad
Has liked: 13 times
Been liked: 6 times
FAF User Name: Anaryl

Re: Error with New Shield Enhancment

Postby brandonpotter0 » 07 Aug 2014, 12:42

Anaryl wrote:I don't know lua so well but maybe its calling a local variable instead of a friend/member of the function's parent class? I had a quick look over the code - it would be helpful if you commented in the code where your stuff was

I posted the entire ACU script and BP, and labeled what line the shield info is at...

What other code would you be referring to?
User avatar
brandonpotter0
Avatar-of-War
 
Posts: 65
Joined: 19 Oct 2013, 03:05
Location: In bed with the Borg Queen. Bow Chicka bow wow ;)
Has liked: 0 time
Been liked: 0 time

Re: Error with New Shield Enhancment

Postby Sheeo » 07 Aug 2014, 16:06

The error is happening in the user lua state (UI). It's trying to do some work with something that's nil

Apparently the shield health isn't getting propagated right from the sim.

At first look the code and the bp seems right. Does the same thing happen with other commander shieldupgrades on your setup?
Support FAF on patreon: https://www.patreon.com/faf?ty=h

Peek at our continued development on github: https://github.com/FAForever
Sheeo
Councillor - Administrative
 
Posts: 1038
Joined: 17 Dec 2013, 18:57
Has liked: 109 times
Been liked: 233 times
FAF User Name: Sheeo

Re: Error with New Shield Enhancment

Postby brandonpotter0 » 07 Aug 2014, 17:30

Sheeo wrote:The error is happening in the user lua state (UI). It's trying to do some work with something that's nil

Apparently the shield health isn't getting propagated right from the sim.

At first look the code and the bp seems right. Does the same thing happen with other commander shieldupgrades on your setup?

It does not. I used winmerge and compared the code with the FAF Aeon Shield upgrades, and they are almost identical. Aside from the obvious changes to make it work for the new Cybran model parts, I dont see why its causing the issue :\
User avatar
brandonpotter0
Avatar-of-War
 
Posts: 65
Joined: 19 Oct 2013, 03:05
Location: In bed with the Borg Queen. Bow Chicka bow wow ;)
Has liked: 0 time
Been liked: 0 time

Re: Error with New Shield Enhancment

Postby brandonpotter0 » 09 Aug 2014, 13:35

Anyone? O-o
User avatar
brandonpotter0
Avatar-of-War
 
Posts: 65
Joined: 19 Oct 2013, 03:05
Location: In bed with the Borg Queen. Bow Chicka bow wow ;)
Has liked: 0 time
Been liked: 0 time


Return to General Discussions

Who is online

Users browsing this forum: FtXCommando and 1 guest