Lups unitcloaked fx error when starting unit is cloaked

Lups unitcloaked fx error when starting unit is cloaked

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Lups unitcloaked fx error when starting unit is cloaked

Post by Forboding Angel »

Evo has dynamic cloaking based upon whether your unit is in the middle of a bunch of features that provide cover or not. The issue is that if someone starts in the middle of a bunch of features, the starting unit immediately starts to cloak. This causes this error in lups. It is only an error and doesn't actually break anything.

That said, line 161 is gibberish to me. I thought I could add some simple error handling, but in seeing line 161 I don't know how I would. Could someone help me?

Code: Select all

[f=0000000] Error: LuaRules::RunCallIn: error = 2, UnitCloaked, [Internal Lua error: Call failure] [string "LuaRules/Gadgets/lups_cloak_fx.lua"]:161: attempt to index upvalue 'Lups' (a nil value)
stack traceback:
    [string "LuaRules/Gadgets/lups_cloak_fx.lua"]:161: in function 'UnitCloaked'
    [string "LuaRules/gadgets.lua"]:1506: in function <[string "LuaRules/gadgets.lua"]:1504>
    (tail call): ?
https://github.com/EvolutionRTS/Evolution-RTS/issues/44

https://github.com/EvolutionRTS/Evoluti ... x.lua#L161
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Lups unitcloaked fx error when starting unit is cloaked

Post by FLOZi »

At a glance, just wrap 155 to 162 in an 'if Lups then ... end'
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Lups unitcloaked fx error when starting unit is cloaked

Post by Forboding Angel »

FLOZi wrote:At a glance, just wrap 155 to 162 in an 'if Lups then ... end'
This plus wrapping the statement before it did the trick.

Fixed in: https://github.com/EvolutionRTS/Evolution-RTS/issues/44

Issues comment thread: https://github.com/EvolutionRTS/Evolution-RTS/issues/44

I would commit upstream, but apparently JK doesn't deem it necessary to keep the base up to date :roll:
Post Reply

Return to “Lua Scripts”