Page 2 of 2 FirstFirst 12
Results 21 to 32 of 32

Thread: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

  1. #21

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    So, I downloaded lua 5.1 sources, cygwin and luadec 5.1. Then I got the text of build_luadec and declared the file as .exe (I don't know how I should download it in github). I have no experience with cygwin, so how should I run with it build_luadec? (And thanks that you spend so much time for me)
    "You can ask me for anything you like, except time."
    Napoleon Bonaparte
    "If you want a thing done well, do it yourself."
    Napoleon Bonaparte
    "You don't reason with intellectuals. You shoot them."
    Napoleon Bonaparte

  2. #22

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Or do you have still the 7z Archive with the decompilation results?
    In that case, my email is: order_of_shadows@gmx.de
    "You can ask me for anything you like, except time."
    Napoleon Bonaparte
    "If you want a thing done well, do it yourself."
    Napoleon Bonaparte
    "You don't reason with intellectuals. You shoot them."
    Napoleon Bonaparte

  3. #23

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Online Lua decompiler is now available at http://decompiler.com/

  4. #24
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Quote Originally Posted by TypeSafe View Post
    Online Lua decompiler is now available at http://decompiler.com/
    Anyone tried that on Total War .luac files?

    LUAC is not a single format like JAR, it has a lot of variants for every app, and Total War's uses some custom settings for sure.

  5. #25
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,491

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    It seems to work:

    I tried it with template_attrition_entry.luac from Shogun 2:

    Code:
    local this = UIComponent(Address)
    local utils = require("utilities")
    local m_pos_x, m_pos_y
    local shane_output = false
    function ShaneOutput(msg)
      if defined.debug and shane_output then
        out.shane(msg)
      end
    end
    function Initialise(details, type_a_bg)
      ShaneOutput("** attrition_entry:Initialise **")
      if type_a_bg then
        this:SetState("A_normal")
      else
        this:SetState("B_normal")
      end
      UIComponent(this:Find("dy_name")):SetStateText(details.CharacterName)
      if details.MenLost ~= nil then
        UIComponent(this:Find("men_lost_dy")):SetStateText(CampaignUI.LocalisationString("player_stats_men_lost") .. ": " .. details.MenLost)
      elseif details.Region ~= nil then
        UIComponent(this:Find("men_lost_dy")):SetStateText(details.Region)
      else
        UIComponent(this:Find("men_lost_dy")):SetVisible(false)
      end
      m_pos_x = details.PosX
      m_pos_y = details.PosY
      if details.PortraitPath ~= nil and #details.PortraitPath > 0 then
        image = UIImage(details.PortraitPath)
        image:SetComponentTexture(this:Find("image"), 0)
        UIComponent(this:Find("portrait_clip")):SetVisible(true)
        UIComponent(this:Find("unit_frame")):SetVisible(true)
        UIComponent(this:Find("icon_raiding")):SetVisible(false)
        UIComponent(this:Find("building_window")):SetVisible(false)
      elseif details.BuildingImage ~= nil and 0 < #details.BuildingImage then
        image = UIImage(details.BuildingImage)
        image:SetComponentTexture(this:Find("building_window"), 0)
        UIComponent(this:Find("portrait_clip")):SetVisible(false)
        UIComponent(this:Find("unit_frame")):SetVisible(false)
        UIComponent(this:Find("icon_raiding")):SetVisible(false)
        UIComponent(this:Find("building_window")):SetVisible(true)
      else
        UIComponent(this:Find("portrait_clip")):SetVisible(false)
        UIComponent(this:Find("unit_frame")):SetVisible(false)
        UIComponent(this:Find("icon_raiding")):SetVisible(true)
        UIComponent(this:Find("building_window")):SetVisible(false)
      end
    end
    function OnLeftClickUp()
      CampaignUI.SetCameraTarget(m_pos_x, m_pos_y)
    end
    function OnRightClickUp()
      CampaignUI.SetCameraTarget(m_pos_x, m_pos_y)
    end

  6. #26
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Quick tests suggest it's working better than decompilers we had before.

    I updated README in my repo to say people should generally use that website instead.

  7. #27

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    How can you re-compile back to luac when you made some changes and such?

    EDIT: Neverminded. Forgot to install lue on my hdd.
    Other question, every time I try to run a script, I got the UIComponent(Address) issue:

    lua: region_details.lua:2: attempt to call global 'UIComponent' (a nil value)
    stack traceback:
    region_details.lua:2: in main chunk
    [C]: ?

    Any idea how i can locate the UI adress.

    Last edited by izzi; April 22, 2020 at 03:47 PM.

  8. #28
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Is it crashing from the game or from somewhere else?

    Also, isn't game able to just run `.lua` uncompiled in addition to `.luac`? (or am I really misremembering that)

  9. #29

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Quote Originally Posted by taw View Post
    Is it crashing from the game or from somewhere else?

    Also, isn't game able to just run `.lua` uncompiled in addition to `.luac`? (or am I really misremembering that)
    It does. But I have no clue how to add that. Even adding it in the game as lua (the de-compressed one), the game still use the luac one. I was using the lua 5.1 compiler.

  10. #30
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Could you try adding .luac as a 0 byte file in same pack as that generally how patch packs delete files?

  11. #31

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Quote Originally Posted by taw View Post
    Could you try adding .luac as a 0 byte file in same pack as that generally how patch packs delete files?
    It kinda works. Except as the ui file in game looks totally different (with no values nor ui art). I am using a luac file from NTW in S2TW. If I just copy the luac file from NTW to S2TW and it works as in NTW. But when I try to add the same lua file like your suggestion above (without any changes, just de-compressed), all values, art and such are gone. Also if I compile the vanilla lua file to luac (with no any changes, just vanilla) I get the same result. Doesn't make any sense.

  12. #32

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Hello, please help decompile this script, when decompiling through the site - it gives an empty result..
    Download script

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •