Sign in to follow this  
SinbadEV

[Tutorial] Easy Modding

Recommended Posts

Guys! I am so excited!

I haven't seen this stuff anywhere I've looked and none of the Mods I've cracked open have used this method... it's so much easier than you think.

Step -1: Install Lua For Windows from https://github.com/rjpcomputing/luaforwindows

Step 0: Install unluac from http://sourceforge.net/projects/unluac/

Step 1: unluac game content lua (example "Data/Content/Game/Global/Gui/InventoryGui.lua")

Step 2: edit resulting code in SciTE (provided as part of Lua For Windows)

Step 3: compile edited code from SciTE (Tools>Compile)

Step 4: add a modfiles.load and assets.overwrite to your Patch.lua to replace the original lua with your updated luac file

example

local file = modfiles.load("InventoryGui.luac")

assets.overwrite("Data/Content/Game/Global/Gui/InventoryGui.lua", file)

That's it.

?ACT=36&fid=59&aid=5076_sGIFRRBdyzQFdC7DK7Ar&board_id=1

Am I really the first person to figure this out?

Share this post


Link to post
Share on other sites

Not a bad tutorial! Here are some improvements I would like to point out.

First. Lua for Windows has moved to GitHub. (Google Code will stop existing soon.)

Second, this technique makes mods incompatible with other mods that edits the same files. Code injection is preferable to allow that, even though it's not as easy. (Not that there's a lot of other mods right now, but it's always something good to consider.)

Share this post


Link to post
Share on other sites

I see how you mean Overwriting could be bad. Hadn't considered multiple mods wanting the same files.

It would still be fine so long as the overwriting mod was loaded first though... because then the other mods would inject their code into my new version of the files... so for massive overhauls that should be loaded first anyways (like story/flow changes etc.) it would be a viable option.

Share this post


Link to post
Share on other sites

Well... yes and no. Even for mods that don't attempt to overwrite the same file, there's no guarantee that the compiler you use will generate assembly code close enough to the original for them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this