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

Master of the Force
User avatar
Posts: 4766
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: RC Side Mod SWBF2 HD SWBF3 Legacy

Lua random behaviour??

Postby Anakin » Tue Feb 20, 2018 10:01 am

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

code:
Hidden/Spoiler:
Code: Select all
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


Result:
Hidden/Spoiler:
Image



code:
Hidden/Spoiler:
Code: Select all
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


Result:
Hidden/Spoiler:
Image



code:
Hidden/Spoiler:
Code: Select all
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


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??

Return to SWBF2 Modding

Who is online

Users browsing this forum: No registered users and 1 guest