Modding guide?

A forum to discuss custom scenarios, campaigns and modding in general.

Moderators: Slitherine Core, The Lordz

Post Reply
kirk23
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 155
Joined: Wed Jul 18, 2012 1:23 pm

Modding guide?

Post by kirk23 »

Hi guys I asked over at the Matrix Games Forum,about a modding guide without reply,so I'm hoping I might get an answer here,I know the Lua files are easy to alter,but I think there should be some kind of guide available to look at,that helps with how to add new units to the game,along with a load of other stuff,I have already tried adding new units,but when I run the game it just crashed,at the present time I'm a frustrated modder!
Myrddraal
The Artistocrats
The Artistocrats
Posts: 1505
Joined: Wed Feb 23, 2011 2:49 pm

Re: Modding guide?

Post by Myrddraal »

Hi kirk,

I'm afraid we don't have anything like that at the moment, but if you have specific questions I can try to answer them.

Let me know what the error message you got was, I might be able to tell you what happened (especially if you attach your modded file).
kirk23
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 155
Joined: Wed Jul 18, 2012 1:23 pm

Re: Modding guide?

Post by kirk23 »

Hi, I was trying to add new naval types to the game, I used the Battleship template as a base point,copied & Paste it,then renamed it Pre-Dreadnought,and then tweaked its settings,Battleships are ID NO 7 so I called the Pre-Dreadnought ID no 8,I also changed all the numbers for all the other unit types,maybe that was my error,should I have added the new type to the bottom of the list?
xriz
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 148
Joined: Tue Oct 21, 2008 2:17 am
Location: Los Angeles

Re: Modding guide?

Post by xriz »

I've messed with adding a new unit; its more then just adding to the list in 'units.lua', you need graphics and other references to the UI and probably more to add a new unit. I've only been able to add more, "levels" to at tech (I split the railroad gun into 3 techs so you can get the basic one by 1915) and can add commanders, but adding new types of units has alluded me because I'm not aware of all the files that need to be amended to create a new unit.

Maybe myrddraal can tell us which files need to me modified to create a new unit it the game? Once we know the files, what to code or modifie should be obvious based on the content.
Myrddraal
The Artistocrats
The Artistocrats
Posts: 1505
Joined: Wed Feb 23, 2011 2:49 pm

Re: Modding guide?

Post by Myrddraal »

Definitely safer to use an unused Id rather than changing the ids of existing units, that will almost certainly cause a problem.
kirk23
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 155
Joined: Wed Jul 18, 2012 1:23 pm

Re: Modding guide?

Post by kirk23 »

Ok so if I create a new unit at ID 30 for example,apart from adding new graphics,what files need ammending,so that the unit shows up in game,the game might be easy moddable,but its not if you have not done it before!
Myrddraal
The Artistocrats
The Artistocrats
Posts: 1505
Joined: Wed Feb 23, 2011 2:49 pm

Re: Modding guide?

Post by Myrddraal »

I'm writing this off the top of my head, but hopefully it should be enough to get you started.

You'll need graphics in Data/Graphics/Units in the following formats:

unitname_nationname_level_hud/info/queue/100

nationname can be 'default'
Where I've written hud/info/queue/100, you need four files for each unit, one finishing hud, one info, one queue, one 100. Don't worry about _25 and all that, they're not used.

All these files are png files with a transparency level.



In Data/Lang/english.txt you'll need to add the text for your new unit:

unitname = unit name to be displayed
unitname_info = unit description to be displayed

For example:
bigship = Big Ship
bigship_info = A really big ship!


I think that's all you need for a valid unit, which you should be able to add to scenarios. For the unit to appear in the production panel takes a few extra steps, which I'll have to get back to you, because I can't remember off the top of my head, but have a look in Scripts/ui/production_panel.lua if you want a hint to start.
kirk23
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 155
Joined: Wed Jul 18, 2012 1:23 pm

Re: Modding guide?

Post by kirk23 »

Cheers for all the info,I will try again to add Pre-Dreadnought & Battlecruiser type units to the data base,and hopefully I will get it right first time.
kirk23
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 155
Joined: Wed Jul 18, 2012 1:23 pm

Re: Modding guide?

Post by kirk23 »

Still can't add new unit types,I have learned how to do a load of other things thou.
xriz
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 148
Joined: Tue Oct 21, 2008 2:17 am
Location: Los Angeles

Re: Modding guide?

Post by xriz »

kirk23
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 155
Joined: Wed Jul 18, 2012 1:23 pm

Re: Modding guide?

Post by kirk23 »

Thnks for all your help brilliant I can't wait to start getting the new units in game,this is very much appreciated cheers. :mrgreen:
Post Reply

Return to “Commander the Great War : Mods & Scenario Design”