BA-Layout

BA-Layout

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

Moderator: Moderators

Post Reply
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

BA-Layout

Post by NOiZE »

Hi Guys,

The BA-Layout widget in BA is broken in 0.77

This widget was made by lurker, he said he would fix it like 1,5 months ago, however it appears he ran out of time, or has set different priority's. So any volunteers who can/want to fix this widget for BA? or write a new one which does the same? (determine the layout of the buildmenu)

Any help is appreciated!
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: BA-Layout

Post by Forboding Angel »

I'm pretty sure it's the same widget that he originally wrote for me. And yes I asked about the same length of time ago, yes I'm screwed if it (and other thigns that he wrote) aren't fixed fairly soon.
Andrej
Posts: 176
Joined: 13 Aug 2006, 18:55

Re: BA-Layout

Post by Andrej »

if this is the same 'problem' BaSiC had with his layout widget
borrowed from BA it is because LUA_COMPAT_MOD was turned off in luaconf.h blame trepan >.>

open up gui_BA_layout.lua in notepad
and do a replace all occurences of "math.mod" with "math.fmod"

that should fi x it

in b4 nub
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: BA-Layout

Post by REVENGE »

Andrej wrote:if this is the same 'problem' BaSiC had with his layout widget
borrowed from BA it is because LUA_COMPAT_MOD was turned off in luaconf.h blame trepan >.>

open up gui_BA_layout.lua in notepad
and do a replace all occurences of "math.mod" with "math.fmod"

that should fi x it

in b4 nub
So math.mod was changed to math.fmod? Why is this even necessary?
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Re: BA-Layout

Post by NOiZE »

Thanks =)
dizekat
Posts: 438
Joined: 07 Dec 2007, 12:10

Re: BA-Layout

Post by dizekat »

REVENGE wrote:
Andrej wrote:if this is the same 'problem' BaSiC had with his layout widget
borrowed from BA it is because LUA_COMPAT_MOD was turned off in luaconf.h blame trepan >.>

open up gui_BA_layout.lua in notepad
and do a replace all occurences of "math.mod" with "math.fmod"

that should fi x it

in b4 nub
So math.mod was changed to math.fmod? Why is this even necessary?
just a guess, maybe math.mod is not doing modulus at all, but doing "floating point modulus" aka a-floor(a/b)*b
edit: correction:
math.mod is indeed doing proper remainder of division, with floats. i.e. math.fmod(-1,0.7) = -0.3

For most practical uses however, thats really not what you need. You need to use operator "%" instead.
-1%0.7 = 0.4 , which is the value you usually want to get when you do modulus on negative number. In my whole career I think I seen no code that would want to get 0 .. 0.7 from modulus when input is positive and -0.7 .. 0 when input is negative.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: BA-Layout

Post by lurker »

No Electricities!

And until 1 day before power loss I was busy at my summer job.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: BA-Layout

Post by Hoi »

Andrej wrote:if this is the same 'problem' BaSiC had with his layout widget
"borrowed" from BA

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

Re: BA-Layout

Post by Forboding Angel »

Actually they all borrowed from evo if you wanna get picky. :_)

Unless the one lurker made for me the night we stayed up till god knows when is a different one...
Post Reply

Return to “Lua Scripts”