Rebel Galaxy

Rebel Galaxy

Not enough ratings
Rebel Galaxy Mod Set up Testing
By Ifret
I have altered the purpose of this guide: the new focus is to test better methods and improve modding for Rebel Galaxy. It may continue to store outdated or previous version information, for a limited time. Untested guide sections will include "TEMP" in the title. This information may be incomplete, confusing, and/or experimental, use at your own risk. Feedback is appreciated if you are so inclined.
   
Award
Favorite
Favorited
Unfavorite
Temp Advanced Modding ideas
I recently realized that I was not satisfied with my modding set up. Each time I wanted to create a new mod I had to remove all the previous files from the last mod before I could make my new mod. And that is what I was doing for a few days. Then I realized that I didn't know which file went to which mod, if I needed to adjust a mod I would have to unpack the DATA2.PAK mod file and then convert the .DAT files to .LUA before I could fix the mod. I am testing a new directory design in order to fix this issue. At C:\MODS\REBEL_GALAXY\ I have created a new folder:
MOD_PROJECTS
Inside C:\MODS\REBEL_GALAXY\MOD_PROJECTS I now create folders for each mod like so:
C:\MODS\REBEL_GALAXY\MOD_PROJECTS\1_Korian_Laser_Turret C:\MODS\REBEL_GALAXY\MOD_PROJECTS\2_ExtraLarge_Smuggler_Hold

Each mod folder will need it's own sub folders like:
\MOD_PROJECTS\1_Korian_Laser_Turret\HACK_DAT\MEDIA \MOD_PROJECTS\1_Korian_Laser_Turret\HACK_LUA\MEDIA \MOD_PROJECTS\1_Korian_Laser_Turret\HACK_PAK

To speed up the process I made a batch file:
IF NOT EXIST .\HACK_DAT (MKDIR HACK_DAT) XCOPY C:\MODS\REBEL_GALAXY\MEDIA .\HACK_DAT /T /E IF NOT EXIST .\HACK_LUA (MKDIR HACK_LUA) XCOPY C:\MODS\REBEL_GALAXY\MEDIA .\HACK_LUA /T /E IF NOT EXIST .\HACK_PAK (MKDIR HACK_PAK)

The batch file will create 3 new sub folders in your current folder:
HACK_DAT; HACK_LUA: HACK_PAK
It will also copy all the folders and sub folders from the MEDIA folder (found at C:\MODS\REBEL_GALAXY) and place them into both HACK_DAT and HACK_LUA folders.

I am currently testing this method as a way to organize my mods and save the modified .lua files in case I need to alter them after testing. If you decide to try this as well please let me know if/how well it works for you, and also any ideas for improvement.

TEMP Improved advanced Modding ideas
What I did was make a batch file in MOD_PROJECTS named "make dir.bat"
IF NOT EXIST .\001_Template\HACK_DAT\MEDIA (MKDIR 001_Template\HACK_DAT\MEDIA) XCOPY C:\MODS\REBEL_GALAXY\MEDIA .\001_Template\HACK_DAT\MEDIA /T /E IF NOT EXIST .\001_Template\HACK_LUA\MEDIA (MKDIR 001_Template\HACK_LUA\MEDIA) XCOPY C:\MODS\REBEL_GALAXY\MEDIA .\001_Template\HACK_LUA\MEDIA /T /E IF NOT EXIST .\001_Template\HACK_PAK (MKDIR 001_Template\HACK_PAK) IF NOT EXIST .\001_Template\MOD_Saves (MKDIR 001_Template\MOD_Saves)

The batch file will create a new folder in your MOD_PROJECTS folder:
001_Template with subfolders:
HACK_DAT; HACK_LUA; HACK_PAK;MOD_Saves
It will also copy all the folders and sub folders from the MEDIA folder (found at C:\MODS\REBEL_GALAXY) and place them into the HACK_LUA and HACK_DAT folders.


Then, if you want to test a new mod you can just make a copy of the 001_Template folder and place it in your MOD_PROJECTS folder, then rename it as you see fit. Since the "001_Template folder"
is being used as a template, we obviously don't want to use it for mod testing.

I have added the MOD_Saves folder in order to save games that may require mods to work properly. If you are unsure about how to copy your saves to this folder look below:




























The selected files are your save games and back ups. I recommend copying saves that require mods to the MOD_Saves folder.

To make this quicker I made a shortcut to the file that contains the game saves, and placed it in my "001_Template folder". The next part is optional.
Open the properties of the Shortcut you just created. Go to the shortcut tab, and add
C:\Windows\explorer.exe /n,
to the beginning of the target line. This opens the link in a new window so the previous window isn't closed.
And now for the finally! Make a new batch file (do not run it yet), it can be named "pack mod"
@ECHO OFF IF NOT EXIST .\HACK_LUA GOTO FAIL FOR /R .\HACK_LUA\ %%A IN (*.LUA) DO LUA C:\MODS\REBEL_GALAXY\LUA2DAT.LUA "%%A" ".\HACK_DAT\%%~nA.DAT" LUA C:\MODS\REBEL_GALAXY\PACK.LUA .\HACK_DAT .\HACK_PAK\DATA2.PAK IF EXIST .\HACK_PAK\DATA2.PAK GOTO SUCCESS :FAIL ECHO Unable to pack mod. This batch file will close TIMEOUT 20 EXIT :SUCCESS ECHO Mod successfully packed hit any key to continue TIMEOUT 10

I am still testing this, but it should convert all your .lua files in HACK_LUA to .dat, place them in
HACK_DAT then pack HACK_DAT to DATA2.PAK into HACK_PAK

currently broken
1) Lua can't access lib files and fails to pack.
a) copying lua lib files to 001_Templates seems to work
2) After packing fails echo reports success

Currently looking for the best solutions to these issues
Got it working but the dat file isn't placed into the correct folder so the pack won't work.

DAT2LUA example
Originally posted:
lua "C:\MODS\REBEL_GALAXY\dat2lua.lua" "C:\MODS\REBEL_GALAXY\MEDIA\WEAPONS\PROJECTILES\15_PLAYER_FLAKTURRET.DAT" "C:\MODS\REBEL_GALAXY\LIBRARY\15_PLAYER_FLAKTURRET.LUA"

Alternatively:
LUA DAT2LUA.LUA .\MEDIA\WEAPONS\PROJECTILES\15_PLAYER_FLAKTURRET.DAT .\LIBRARY\15_PLAYER_FLAKTURRET.LUA
Explanation of cmd input
Originally:
This command runs lua.exe
lua
The 1st entry chooses what lua script to use
"C:\MODS\REBEL_GALAXY\dat2lua.lua"
the 2nd entry points to which file the script will be run on (input)
"C:\MODS\REBEL_GALAXY\MEDIA\WEAPONS\PROJECTILES\15_PLAYER_FLAKTURRET.DAT"
the 3rd entry specifies where the converted file will go (output)
"C:\MODS\REBEL_GALAXY\LIBRARY\15_PLAYER_FLAKTURRET.LUA"

Alternatively:
This command runs lua.exe
LUA
The 1st entry chooses what lua script to use
DAT2LUA.LUA
the 2nd entry points to which file the script will be run on (input)
.\MEDIA\WEAPONS\PROJECTILES\15_PLAYER_FLAKTURRET.DAT
the 3rd entry specifies where the converted file will go (output)
.\LIBRARY\15_PLAYER_FLAKTURRET.LUA

LUA2DAT example
Originally:
lua "C:\MODS\REBEL_GALAXY\lua2dat.lua" "C:\MODS\REBEL_GALAXY\HACK_LUA\MEDIA\WEAPONS\PROJECTILES\15_PLAYER_FLAKTURRET.LUA" "C:\MODS\REBEL_GALAXY\HACK_DAT\MEDIA\WEAPONS\PROJECTILES\15_PLAYER_FLAKTURRET.DAT"

Alternatively:
LUA LUA2DAT.LUA .\HACK_LUA\MEDIA\WEAPONS\PROJECTILES\15_PLAYER_FLAKTURRET.LUA .\HACK_DAT\MEDIA\WEAPONS\PROJECTILES\15_PLAYER_FLAKTURRET.DAT
PACK.LUA example
Originally:
lua "C:\MODS\REBEL_GALAXY\pack.lua" "C:\MODS\REBEL_GALAXY\HACK_DAT" "C:\MODS\REBEL_GALAXY\HACK_PAK\DATA2.PAK"

Alternatively:
LUA PACK.LUA .\HACK_DAT .\HACK_PAK\DATA2.PAK
To Do
1) Create alternative batch file to avoid the need to copy DATA.PAK to another folder to save hard disk space and perhaps make it easier to update mod library in the event that Rebel Galaxy gets updated to a newer version.

2) Create step by step mod walkthrough with screenshots (done)

3) tbd
Temp Mod Walk-through
Next lets create a mod we can test out!
Find the file named http://images.akamai.steamusercontent.com/ugc/583575429727366619/96AEFD81EAFC37F88A0B162C3DE97B07B576E7F6/
located at C:\MODS\REBEL_GALAXY\LIBRARY

Open it with a text editor such as notepad. Find the line that starts:
}, { --COMPONENTS[3]

This part of the file contains data for a broadside that is in the game files but has been hidden so we can't see it or use it.

Look down a few lines where it shows:
{ n="HIDDEN", t="BOOL", v=true },
change it to
{ n="HIDDEN", t="BOOL", v=false },

Below the line that previous read
{ n="HIDDEN", t="BOOL", v=true },
we see code that determines where you can purchase this broadside.
{ --BROADSIDE[1] n="AVAILABILITY", vars = { { n="FACTION", t="STRING", v="NEUTRAL" },

As you continue to look further you notice it lists availability in many other factions.
If it wasn't available it would not be listed here. So if you wanted to limited where you can purchase an item you would mod the code here by removing entries keeping the proper format. Alternatively, if your item wasn't available at a faction station you could add entries, again keeping the proper format.

I haven't tested this broadside to see if it works or how well it works. It looks to me to be roughly to scale with a MK2 broadside. We can't mod the damage or performance stats of this weapon from this file so we will limit the changes to removing its hidden status so we can test it.
If you would like to adjust the cost/price just change value at
{ n="PRICE", t="INTEGER", v=47000 }
As you can see the default value is 47,000 credits.

Once you have finished making your modifications to the file go to "save as"























for file name put
15_BROADSIDES.LUA
for location choose:
C:\MODS\REBEL_GALAXY\HACK_LUA\MEDIA\COMPONENTS
If any of those folders do not exist you will need to create them

The next part will use LUA2DAT.LUA to covert our file back to .DAT
double click or run lua.bat
type or paste:
LUA LUA2DAT.LUA .\HACK_LUA\MEDIA\COMPONENTS\15_BROADSIDES.LUA .\HACK_DAT\MEDIA\COMPONENTS\15_BROADSIDES.DAT

Then we will convert the .DAT file using PACK.LUA
If you have closed the command prompt then double click or run lua.bat
When you have the command prompt up
type or paste:
LUA PACK.LUA .\HACK_DAT .\HACK_PAK\DATA2.PAK

Finally, copy DATA2.PAK found at C:\MODS\REBEL_GALAXY\HACK_PAK
to your Rebel Galaxy game folder i.e.
C:\Program Files (x86)\Steam\steamapps\common\RebelGalaxy\PAKS

Then start up Rebel Galaxy and test your mod!



Temp testing
11 Comments
Ross_R 23 Oct, 2018 @ 10:04am 
Ifret, can you contact me? I need some help with Rebel Galaxy...
Ifret  [author] 27 Mar, 2018 @ 1:12pm 
I did some modding on an RTS game CoH/ CoH2 awhile back, it used some lua
I had to give the game up, though, it was in a state of constant pvp rebalancing
Project_Jenova 27 Mar, 2018 @ 12:34am 
Know of any other games that run off lua? I'm surprised at how much I'm enjoying learning how to mod & would like to branch out.

I might need a ego/reality check if this keeps up, lol.
Project_Jenova 27 Mar, 2018 @ 12:27am 
Good man, I'll report back if/when I come up with something kinky.
Ifret  [author] 25 Mar, 2018 @ 1:08pm 
@djrominger118, not sure if this mod works but I saw it was already uploaded
https://www.dropbox.com/s/56o9vc3sb6cws6f/Greel%20Playable%20ship%20LUA.zip?dl=0
Ifret  [author] 25 Mar, 2018 @ 1:06pm 
@djrominger118, I will post a link later with some of the text files if that helps
Ifret  [author] 25 Mar, 2018 @ 1:04pm 
Sure, you might check also with some of the other modders, also. I think Darphinx (spelling?) did that in some mods.
Project_Jenova 24 Mar, 2018 @ 8:07pm 
@Ifret, I'm attempting to make some (if not all) of the enemy ships purchasable. A sizable task to be sure. Do you have any knowlege /or .lua scraps you'd be willing to share on the subject matter?
PW 16 Nov, 2015 @ 3:39pm 
This is actually too complicate for the setup. The original guide you gave us make a lot more sense.

Right now I just follow your original advice, mod a lua, turn it into a dat then move it into the hack_dat folder. A little bat to create the data2.pak. That's it. It allows me to accumulate all the changes. If I need to change anything, edit the lua in the hack_lua folder, turn it into a dat with a bat then drag it over to the hack_dat folder.

The system you setup is perfect already.

One suggestion though, please use Notepad++ instead of Notepad to edit a LUA file. Notepad++ will help you in so many ways that you haven't realize yet. It also helps to end the { } nightmare.
Ifret  [author] 16 Nov, 2015 @ 11:04am 
I am looking for assistance with this guide. Please comment here if you are interested. The focus of this guide is to test better methods and improve modding for Rebel Galaxy.