.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Scenarios, Maps and Mods (http://forum.shrapnelgames.com/forumdisplay.php?f=146)
-   -   Script for combining multiple mods (http://forum.shrapnelgames.com/showthread.php?t=40654)

llamabeast September 26th, 2008 07:21 AM

Script for combining multiple mods
 
1 Attachment(s)
I proudly present a perl script for combining multiple mods and eliminating any clashes. I expect it to be useful for games where you want to play with a number of mod nations which might otherwise clash. It's quite a big, lengthy script, and it has a lot of built-in knowledge of how mods work. So, barring any typos (always a possibility), I'm fairly sure it can handle anything that can be thrown at it without producing any bugs in the resulting megamod.

The usage is:

combineMods era mod1.dm mod2.dm ... modN.dm newModName

e.g. combineMods 2 TombKings.dm vaetti.dm MagicMod

This will produce a mod called MagicMod.dm which will include the Tomb Kings and the vaetti, both in the middle era.

The era has to be a number between 1 and 3 (1=early etc). All the mod nations included in the combined mod will be set to be in that era, so that they can play together.

You can combine any number of mods with this script, and it's also fine to include mods which modify vanilla nations, e.g. CBM.

For those who haven't used a perl script before: On Linux or, I think, Mac, you need to open a terminal and type "perl combineMods ..." where ... is all the parameters, as given above. On Windows I believe you need to download ActivePerl. I think it's free.

Here it is:

Edratman September 26th, 2008 07:28 AM

Re: Script for combining multiple mods
 
WOW.

As someone who usually plays 5 to 10 mod nations at a time, this is fantastic. I've had to manually change numbers throughout and I lost the takeout menu on which I had scribbled the new numbers.

:up::up::up:

Sombre September 26th, 2008 08:46 AM

Re: Script for combining multiple mods
 
Can it handle all the different shapes?

Firstshape, secondshape, tmpshape, forestshape, plainshape etc? Summon, call allies, domsummon?

What does it do with nametypes?

llamabeast September 26th, 2008 09:03 AM

Re: Script for combining multiple mods
 
Yep yep, it can handle all of them. It can handle all commands in Edi's unofficial modding manual (which I am assuming is complete).

With nametypes, it handles them sensibly, i.e. it keeps track of nametypes from different mods, renumbers them and makes sure each unit is pointing to the correct nametype. However, it obviously needs to choose which vanilla nametypes to overwrite. Near the top of the mod is an ordered list of which nametypes it should overwrite. I chose something like 127, 128, 150, 149, 148, 147 etc.. Obviously it's not ideal to overwrite any apart from 127 and 128, but generally I think that it's unlikely to be noticeable.

llamabeast September 26th, 2008 09:16 AM

Re: Script for combining multiple mods
 
Oh, hang on. firstshape etc all currently assume that you've already defined the monster you want to change to. But of course that won't always be true.

Hmm. I will have a think about that, and try to fix it this afternoon.

Xietor September 26th, 2008 09:48 AM

Re: Script for combining multiple mods
 
Thanks Llamabeast!

llamabeast September 26th, 2008 12:27 PM

Re: Script for combining multiple mods
 
Okay, I have it very nearly fixed, but have run out of time before some friends who are staying for the weekend turn up. I'll re-upload it on Sunday or Monday.

Edratman September 26th, 2008 12:45 PM

Re: Script for combining multiple mods
 
I'm very interested in seeing how you handle firstshape. It seems to be quite a formidible task, at least to my limited knowledge about the subject.

llamabeast October 4th, 2008 05:03 AM

Re: Script for combining multiple mods
 
Okay! Reuploaded at last! See the first post.

The new version is significantly more cunning, and once more I don't _know_ of anything it can't handle. Summons, sites, nametypes, it's all in. The script is now a beast at about 900 lines (many of which are repetitious to be fair).

Also, the resultant mod is somewhat self-documenting. If you right-click on it from the Dom3 "Mod preferences" screen it will list which mods it includes, along with the version number of each. If you look at the mod file you'll find it lists near the top the ID number ranges that it uses.

Edratman October 4th, 2008 06:05 AM

Re: Script for combining multiple mods
 
Thank you very much. I plan on giving it a test spin tonight when I have more time.

Today is one of my "Give-in-to-the-old-ball-and-chain" days. All of us married chaps must concede a couple of them a year. It is a day dedicated to doing things where she offers up the idea (sic), and the only thing I have to do is add the time, labor and money. :re:

Not much different than all the threads where someone reads a book and then suggests that someone can feel free to make a mod nation based on his brillant thoughts. :down:

Well, actually there is a difference; I can ignore those threads forever without enduring relentless, painful nagging. :)


All times are GMT -4. The time now is 07:41 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.