Forged Alliance Forever Forged Alliance Forever Forums 2017-05-22T18:56:21+02:00 /feed.php?f=45&t=14616 2017-05-22T18:56:21+02:00 2017-05-22T18:56:21+02:00 /viewtopic.php?t=14616&p=149395#p149395 <![CDATA[Re: Build mode bug: building templates exit build mode]]>
R_Charger wrote:
Its interesting to know that the assigned keys for templates work in build mode when the templates tab is active - I didn't know that, but then I use hotbuild :D


Yeah, I didn't know this, until actually looking at the lua code..

Statistics: Posted by crispweed — 22 May 2017, 18:56


]]>
2017-05-22T18:55:41+02:00 2017-05-22T18:55:41+02:00 /viewtopic.php?t=14616&p=149394#p149394 <![CDATA[Re: Build mode bug: building templates exit build mode]]>
KeyBlue wrote:
If you fixed it already, would you mind adding your fix to the game code?
https://github.com/FAForever/fa

Just make a pull request there with the fix, and explain what you fixed and how.


Ok, did this, pull request is here: https://github.com/FAForever/fa/pull/2019

Statistics: Posted by crispweed — 22 May 2017, 18:55


]]>
2017-05-22T16:05:33+02:00 2017-05-22T16:05:33+02:00 /viewtopic.php?t=14616&p=149386#p149386 <![CDATA[Re: Build mode bug: building templates exit build mode]]>

Statistics: Posted by R_Charger — 22 May 2017, 16:05


]]>
2017-05-21T22:46:41+02:00 2017-05-21T22:46:41+02:00 /viewtopic.php?t=14616&p=149351#p149351 <![CDATA[Re: Build mode bug: building templates exit build mode]]> https://github.com/FAForever/fa

Just make a pull request there with the fix, and explain what you fixed and how.

Statistics: Posted by KeyBlue — 21 May 2017, 22:46


]]>
2017-05-21T13:18:54+02:00 2017-05-21T13:18:54+02:00 /viewtopic.php?t=14616&p=149343#p149343 <![CDATA[Build mode bug: building templates exit build mode]]>
So there's a bug in the build mode lua with building templates resulting in build mode being exited.
(I consider this is a bug, because it's inconsistent with the behaviour when building other stuff, where you stay in build mode.)

The problem seems to be with the interactions between the following functions:

in /lua/ui/game/buildmode.lua:
Code:
local function HandleBuildTemplate(key, modifiers)
    if not Construction.HandleBuildModeKey(key) then
        PlayErrorSound()
    end
    return true
end


in /lua/ui/game/construction.lua:
Code:
function HandleBuildModeKey(key)
    if capturingKeys then
        ProcessKeybinding(key)
    else
        BuildTemplate(key)
    end
end


So the problem is that HandleBuildModeKey() eats the return value of BuildTemplate(), and then HandleBuildTemplate() thinks that this failed.

This is easy enough to fix, and I've fixed this locally by hooking this code in a mod, but it seems like this is something that should be fixed in the actual base lua code itself.

(Just for info, to build templates from build mode, you need to right click on the template and set up a key for it, if not already set up, and then, when in build mode, press '5' to switch to the templates tab.)

Statistics: Posted by crispweed — 21 May 2017, 13:18


]]>