Lua random behaviour??

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Lua random behaviour??

Post by Anakin »

Hey there i have three different codes, with three different results. But i don't understand them.

code:
Hidden/Spoiler:
[code]
if ListManager_fnInitList then
print("YEEESSS")

local screenW, screenH = ScriptCB_GetScreenInfo()
FullHD_BackUpFunction = ListManager_fnInitList

ListManager_fnInitList = function(Dest, Layout,...)

print("Layout showcount", Layout.showcount)

if Layout.showcount == 22 then
Layout.width = Layout.width * screenW/800
Layout.showcount = 40
Layout.x = Layout.x - 100
end

return FullHD_BackUpFunction(Dest, Layout, unpack(arg))
end
else
print("NOOOOO")
end
[/code]
Result:
Hidden/Spoiler:
Image

code:
Hidden/Spoiler:
[code]
if ListManager_fnInitList then
print("YEEESSS")

local screenW, screenH = ScriptCB_GetScreenInfo()
FullHD_BackUpFunction = ListManager_fnInitList

ListManager_fnInitList = function(Dest, Layout,...)

print("Layout showcount", Layout.showcount)

if Layout.showcount == 22 then
Layout.width = Layout.width * screenW/800
Layout.showcount = 40
end
return FullHD_BackUpFunction(Dest, Layout, unpack(arg))
end
else
print("NOOOOO")
end
[/code]
Result:
Hidden/Spoiler:
Image

code:
Hidden/Spoiler:
[code]
if ListManager_fnInitList then
print("YEEESSS")

local screenW, screenH = ScriptCB_GetScreenInfo()
FullHD_BackUpFunction = ListManager_fnInitList

ListManager_fnInitList = function(Dest, Layout,...)

print("Layout showcount", Layout.showcount)

if Layout.showcount == 22 then
Layout.width = Layout.width * screenW/800
end

return FullHD_BackUpFunction(Dest, Layout, unpack(arg))
end
else
print("NOOOOO")
end
[/code]
Result:
Hidden/Spoiler:
Image

Maybe someone can explain to me this behaviour, because i don't understand it. Why does the width not work together with the showcount??
Post Reply