Forged Alliance Forever Forged Alliance Forever Forums 2017-12-05T20:56:27+02:00 /feed.php?f=41&t=15453 2017-12-05T20:56:27+02:00 2017-12-05T20:56:27+02:00 /viewtopic.php?t=15453&p=157609#p157609 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]>
crispweed wrote:
but I kind of like making my own version, so I can really understand what is going on, and tweak it to do exactly what I want.

It's kind of a work in progress, but if this sounds interesting for anyone, just shout, and I'll post an archive with the current state of this mod..


cool man, good luck

Statistics: Posted by nine2 — 05 Dec 2017, 20:56


]]>
2017-11-19T17:57:10+02:00 2017-11-19T17:57:10+02:00 /viewtopic.php?t=15453&p=156763#p156763 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]>
- Ui missing informations as Myxir said.

also :

- when all Ui informations have been set but not in the right sequence.
- when some values are set but to ' ' or nil (for example -> tooltips values).

Statistics: Posted by Franck83 — 19 Nov 2017, 17:57


]]>
2017-11-19T17:51:19+02:00 2017-11-19T17:51:19+02:00 /viewtopic.php?t=15453&p=156762#p156762 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]>
Anihilnine wrote:
What are you up to?


I have a mod with some selection hotkey helpers, e.g. stuff like the 'AddNearestByCategoryToSelection' function in the mod I posted previously here:
viewtopic.php?f=41&t=13763

This has some stuff for selecting idle units of various types, but with the exact definition of 'idle' tweaked a bit to better capture the units I actually want to select.

Sometimes I want to give certain units the 'job' of just standing at a certain position, until I say otherwise.
An example of this might be a cloaked scout.
So I *don't* want this unit to then be included when I press a hotkey to select idle land units.

I added some functionality to enable such units to be flagged as 'busy', then, and I'm using the adornment to show visually which units have been flagged in this way.

This is probably something that is already supported by some other mods (e.g. UI-Party?), but I kind of like making my own version, so I can really understand what is going on, and tweak it to do exactly what I want.

It's kind of a work in progress, but if this sounds interesting for anyone, just shout, and I'll post an archive with the current state of this mod..

Statistics: Posted by crispweed — 19 Nov 2017, 17:51


]]>
2017-11-19T17:34:48+02:00 2017-11-19T17:34:48+02:00 /viewtopic.php?t=15453&p=156760#p156760 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]>
JJ173 wrote:
For future reference - If anyone struggles with LazyVars, I made an entry on the wiki to help find out what's causing the issue. This entry teaches you how to enable extensive logging for lazy variables. It needs an edit to work with hooking, but it's a temporary solution thus far. Take a look: https://wiki.faforever.com/index.php?ti ... g_LazyVars


For my issue, just adding the following line somewhere before the lazy vars error was triggered was enough to get the full stack trace info shown:

Code:
import("/lua/lazyvar.lua").ExtendedErrorMessages = true

Statistics: Posted by crispweed — 19 Nov 2017, 17:34


]]>
2017-11-15T13:31:12+02:00 2017-11-15T13:31:12+02:00 /viewtopic.php?t=15453&p=156558#p156558 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]> https://wiki.faforever.com/index.php?ti ... g_LazyVars

Statistics: Posted by JJ173 — 15 Nov 2017, 13:31


]]>
2017-11-15T10:15:21+02:00 2017-11-15T10:15:21+02:00 /viewtopic.php?t=15453&p=156547#p156547 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]>
Solution as previously mentioned is to set layout properties. Top left width etc

What are you up to?

Statistics: Posted by nine2 — 15 Nov 2017, 10:15


]]>
2017-11-13T20:43:08+02:00 2017-11-13T20:43:08+02:00 /viewtopic.php?t=15453&p=156467#p156467 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]> GetFrame(0) gets you the "main" UI panel, where all the others (score, eco, chat, ...) are placed on

Statistics: Posted by Myxir — 13 Nov 2017, 20:43


]]>
2017-11-13T20:38:56+02:00 2017-11-13T20:38:56+02:00 /viewtopic.php?t=15453&p=156466#p156466 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]>
Myxir wrote:
didn't check your mod, but in my experience that error appears when you're creating UI elements (button, panel, ...) but don't assign them to a specific position, e.g. button missing information where to be put on a window

edit:
checked your code, the overlay element hasn't been assigned an initial position (even though you're setting it in the OnFrame function), mind giving that a try?


Ok, yep, made that change, so far don't seem to be able to repeat the issue any more.
Thank you!

Statistics: Posted by crispweed — 13 Nov 2017, 20:38


]]>
2017-11-13T20:30:28+02:00 2017-11-13T20:30:28+02:00 /viewtopic.php?t=15453&p=156465#p156465 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]>
local overlay = Bitmap(GetFrame(0))

So I don't really understand the GetFrame(0) bit here, just copied this from somewhere else (idle engineers, I think).

Is there something wrong with this constructor call?

Statistics: Posted by crispweed — 13 Nov 2017, 20:30


]]>
2017-11-13T20:14:35+02:00 2017-11-13T20:14:35+02:00 /viewtopic.php?t=15453&p=156463#p156463 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]>
edit:
checked your code, the overlay element hasn't been assigned an initial position (even though you're setting it in the OnFrame function), mind giving that a try?

Statistics: Posted by Myxir — 13 Nov 2017, 20:14


]]>
2017-11-13T20:14:14+02:00 2017-11-13T20:14:14+02:00 /viewtopic.php?t=15453&p=156462#p156462 <![CDATA[Re: Anyone seen this strange 'Evaluating LazyVar failed' err]]>
Code:
WARNING: Evaluating LazyVar failed: error evaluating lazy variable: ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(37): error evaluating lazy variable: ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(35): circular dependency in lazy evaluation for variable set from:
         stack traceback:
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(64): in function `SetFunction'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(95): in function `Set'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(37): in function `ResetLayout'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(68): in function `ResetLayout'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(43): in function `OnInit'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(74): in function <...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua:73>
            [C]: in function `InternalCreateBitmap'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(35): in function `initfn'
            ...data\faforever\gamedata\lua.nx2\lua\system\class.lua(258): in function <...data\faforever\gamedata\lua.nx2\lua\system\class.lua:246>
            ...ommander forged alliance\mods\adornmenttest\main.lua(9): in function `CreateOverlay'
            ...ommander forged alliance\mods\adornmenttest\main.lua(34): in function `ToggleFor'
            ...ommander forged alliance\mods\adornmenttest\main.lua(44): in function `ToggleForSelection'
            [string "import("/mods/AdornmentTest/main.lua").Togg..."](1): in main chunk
            [C]: in function `ConExecuteSave'
            ...alliance\gamedata\lua.scd\lua\ui\dialogs\console.lua(159): in function <...alliance\gamedata\lua.scd\lua\ui\dialogs\console.lua:158>
         stack traceback:
            [C]: in function `error'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(21): in function `Bottom'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(35): in function <... alliance\gamedata\mohodata.scd\lua\maui\control.lua:35>
            [C]: in function `pcall'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(31): in function `Top'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(37): in function <... alliance\gamedata\mohodata.scd\lua\maui\control.lua:37>
            [C]: in function `pcall'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(31): in function <...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua:18>
         Stack trace from definition: set from:
         stack traceback:
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(64): in function `SetFunction'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(95): in function `Set'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(35): in function `ResetLayout'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(68): in function `ResetLayout'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(43): in function `OnInit'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(74): in function <...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua:73>
            [C]: in function `InternalCreateBitmap'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(35): in function `initfn'
            ...data\faforever\gamedata\lua.nx2\lua\system\class.lua(258): in function <...data\faforever\gamedata\lua.nx2\lua\system\class.lua:246>
            ...ommander forged alliance\mods\adornmenttest\main.lua(9): in function `CreateOverlay'
            ...ommander forged alliance\mods\adornmenttest\main.lua(34): in function `ToggleFor'
            ...ommander forged alliance\mods\adornmenttest\main.lua(44): in function `ToggleForSelection'
            [string "import("/mods/AdornmentTest/main.lua").Togg..."](1): in main chunk
            [C]: in function `ConExecuteSave'
            ...alliance\gamedata\lua.scd\lua\ui\dialogs\console.lua(159): in function <...alliance\gamedata\lua.scd\lua\ui\dialogs\console.lua:158>
         
         stack traceback:
            [C]: in function `error'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(37): in function `Top'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(37): in function <... alliance\gamedata\mohodata.scd\lua\maui\control.lua:37>
            [C]: in function `pcall'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(31): in function <...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua:18>
         Stack trace from definition: set from:
         stack traceback:
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(64): in function `SetFunction'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(95): in function `Set'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(37): in function `ResetLayout'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(68): in function `ResetLayout'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(43): in function `OnInit'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(74): in function <...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua:73>
            [C]: in function `InternalCreateBitmap'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(35): in function `initfn'
            ...data\faforever\gamedata\lua.nx2\lua\system\class.lua(258): in function <...data\faforever\gamedata\lua.nx2\lua\system\class.lua:246>
            ...ommander forged alliance\mods\adornmenttest\main.lua(9): in function `CreateOverlay'
            ...ommander forged alliance\mods\adornmenttest\main.lua(34): in function `ToggleFor'
            ...ommander forged alliance\mods\adornmenttest\main.lua(44): in function `ToggleForSelection'
            [string "import("/mods/AdornmentTest/main.lua").Togg..."](1): in main chunk
            [C]: in function `ConExecuteSave'
            ...alliance\gamedata\lua.scd\lua\ui\dialogs\console.lua(159): in function <...alliance\gamedata\lua.scd\lua\ui\dialogs\console.lua:158>
         
         stack traceback:
            [C]: in function `error'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(37): in function <...orged alliance\gamedata\mohodata.scd\

Statistics: Posted by crispweed — 13 Nov 2017, 20:14


]]>
2017-11-13T19:57:13+02:00 2017-11-13T19:57:13+02:00 /viewtopic.php?t=15453&p=156460#p156460 <![CDATA[Anyone seen this strange 'Evaluating LazyVar failed' error?]]>
I'm trying to get adornments working in a mod, and it works most of the time, but I get a strange, sporadic, error.

I've cut this down to a very minimal test mod, and still get the error, with the mod essentially just the following code:

Code:
local LayoutHelpers = import('/lua/maui/layouthelpers.lua')
local Bitmap = import('/lua/maui/bitmap.lua').Bitmap

local overlays = {}

function CreateOverlay(unit)
   local overlay = Bitmap(GetFrame(0))
   overlay:SetTexture('/mods/SelectionHelper/textures/busy.dds', 0)
   overlay.Width:Set(26)
   overlay.Height:Set(26)
   overlay:SetNeedsFrameUpdate(true)
   overlay.OnFrame = function(self, delta)
        if not (overlay.Width() == 26) then
            LOG("overlay width is:", overlay.Width())
        end
        if unit:IsDead() then
            local id = unit:GetEntityId()
            overlays[id] = nil
           overlay:Destroy()
        else
          local worldView = import('/lua/ui/game/worldview.lua').viewLeft
          local pos = worldView:Project(unit:GetPosition())
          LayoutHelpers.AtLeftTopIn(overlay, worldView, pos.x - overlay.Width() / 2, pos.y - overlay.Height() - 9)
        end
   end
   return overlay
end

function ToggleFor(u)
    local id = u:GetEntityId()
    if overlays[id] == nil then
        overlays[id] = CreateOverlay(u)
    else
       overlays[id]:Destroy()
      overlays[id] = nil
    end
end

function ToggleForSelection()
    for _, u in GetSelectedUnits() or {} do
        ToggleFor(u)
    end
end


The full mod is attached, here:
AdornmentTest.zip

Most of the time, when the mod works correctly, the adornment looks like this:

adornment_good.JPG

From time to time, however, something goes wrong, and the adornment gets created like this:

adornment_bad.JPG

When it goes wrong, I get some errors in the log, as follows:

Code:
WARNING: Evaluating LazyVar failed: error evaluating lazy variable: ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(37): error evaluating lazy variable: ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(35): circular dependency in lazy evaluation for variable [Set lazyvar.ExtendedErrorMessages for extra trace info]
         stack traceback:
            [C]: in function `error'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(21): in function `Bottom'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(35): in function <... alliance\gamedata\mohodata.scd\lua\maui\control.lua:35>
            [C]: in function `pcall'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(31): in function `Top'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(37): in function <... alliance\gamedata\mohodata.scd\lua\maui\control.lua:37>
            [C]: in function `pcall'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(31): in function <...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua:18>
         Stack trace from definition: [Set lazyvar.ExtendedErrorMessages for extra trace info]
         
         stack traceback:
            [C]: in function `error'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(37): in function `Top'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(37): in function <... alliance\gamedata\mohodata.scd\lua\maui\control.lua:37>
            [C]: in function `pcall'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(31): in function <...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua:18>
         Stack trace from definition: [Set lazyvar.ExtendedErrorMessages for extra trace info]
         
         stack traceback:
            [C]: in function `error'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(37): in function <...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua:18>


(And then the same again, by the looks of things, but referring to 'Right' and 'Left'.)

Has anyone seen this kind of error before, and have some idea what this could be about?

If you want to try repeating the issue, you should be able to just put the AdornmentTest.zip archive in your mods folder (no need to unzip, or turn on the mod in the UI), and then enter the following command in the in-game console a bunch of times (with something selected):

Code:
UI_Lua import("/mods/AdornmentTest/main.lua").ToggleForSelection()

Statistics: Posted by crispweed — 13 Nov 2017, 19:57


]]>