PDA

View Full Version : Some advice in modding. (Sought after, not provided)



Socy
05-23-2008, 19:52
Greetings all.

A while back I was asking questions about some "simple" modding, and seeing that I didn't recieved any answer and haven't been able to figure it out myself I'd like to ask the question(s) once again! I'd really much like to get some help on this since it would help me roleplay my game as I want it (Playing as Arche Seleukeia).

First off, I'd like to know how you add units from one factions rooster into another ones. In this case I'd for example like to know how I'd add Galatian Heavy Infantry as trainable in Ankyra with a "Allied Kingdom" government (The "4:th type", or rather, the cheapest and the one with the shortest build time) with a level 5 regional MIC.

Secondly, how do I change which units that will spawn as a Client Rulers bodyguard? The starting Client Rulers in the Arche Seleukeia have "Babylonian Infantry" (I belive they're called, Assyrian helmet, chainmail, spear and shield). I'd like to change it so that all new Client Rulers in cities with eastern influences recieve these guys as bodyguards. Oh! And in my game all Client Rulers never recieve any Ethnic Trait, wich is kind of sad :no:, is this a bug? And if it is, is there a fix for it?

That'd be all. I could ofcourse just go ahead and make a list of which units I'd like to add to (my) Seleukid rooster, but I thought that it would be worthwhile to learn the whole process so that I can use it with other factions aswell! :smash:

Tellos Athenaios
05-23-2008, 22:30
Copy paste the relevant code to the relevant MIC (called barracks_<some capital letter here>; which requires a bit of clever searching through the export_descr_buildings.txt file to figure everything out). Make the relevant changes regarding factions, ensure ownership within the export_descr_units.txt file (sp game edu backup folder one!)...

Keep backups. As you don't seem to know what/how to do (it) you really should keep a backup for every step you make as you are messing with 2 of the most CTD-sensitive files.

Socy
05-23-2008, 22:34
Thanks for the reply. It might be alot to ask for, but perhaps you could show me an example? As I've understood it the process is pretty much the same for all units/factions (But not having multiple units who shares the same model in one faction, right?) so once I get the hang of the process itself the rest should be pretty easy or atleast I'll be able to figure it out! :idea2:

Tellos Athenaios
05-24-2008, 00:02
For an example: I added Hippeis to the Seleukid & Ptolemaic roster in my own EB 1.1.

So here's a code example of how that would go:

In the sp game edu backup folder; I changed the Hippeis entry of the export_descr_unit.txt file:


;183
type greek cavalry hippeis
dictionary greek_cavalry_hippeis ; Hippeis
category cavalry
class heavy
voice_type General_1
soldier hellenistic_cavalry_hippeis, 25, 0, 1
mount medium horse
mount_effect elephant -1, chariot +2
attributes sea_faring, hide_forest, hardy
formation 1.5, 4, 3, 6, 4, square
stat_health 1, 1
stat_pri 8, 27, no, 0, 0, melee, simple, piercing, spear, 0 ,0.15
stat_pri_attr no
stat_sec 9, 15, no, 0, 0, melee, simple, slashing, sword, 0 ,0.13
stat_sec_attr no
stat_pri_armour 7, 10, 2, leather
stat_sec_armour 0, 0, flesh
stat_heat 2
stat_ground 0, 0, -4, -2
stat_mental 12, disciplined, highly_trained
stat_charge_dist 40
stat_fire_delay 0
stat_food 60, 300
stat_cost 1, 2151, 538, 40, 60, 2151
ownership greek_cities, romans_julii, numidia, thrace, slave, seleucid

In the EB\data folder I changed the Hippeis entry of the descr_model_battle.txt file:

; Hellenistic cavalry - Hippeis / Mistophoroi Hippeis

type hellenistic_cavalry_hippeis
skeleton fs_o_m_spearman, fs_hc_swordsman
indiv_range 40
texture greek_cities, eb/data/models_unit/textures/hellenistic/ebhellenistic_cavalry_hippeis_spw_greek.tga
texture seleucid, eb/data/models_unit/textures/hellenistic/ebhellenistic_cavalry_hippeis_spw_greek.tga
texture thrace, eb/data/models_unit/textures/hellenistic/ebhellenistic_cavalry_hippeis_spw_thrace.tga
texture slave, eb/data/models_unit/textures/hellenistic/ebhellenistic_cavalry_hippeis_spw_slave.tga
texture romans_julii, eb/data/models_unit/textures/hellenistic/ebhellenistic_cavalry_hippeis_spw_slave.tga
texture numidia, eb/data/models_unit/textures/hellenistic/ebhellenistic_cavalry_hippeis_spw_merc.tga
texture merc, eb/data/models_unit/textures/hellenistic/ebhellenistic_cavalry_hippeis_spw_merc.tga
model_flexi eb/data/models_unit/ebhellenic_cavalry_hippeis_spw_high.cas, 15
model_flexi eb/data/models_unit/ebhellenic_cavalry_hippeis_spw_med.cas, 30
model_flexi eb/data/models_unit/ebhellenic_cavalry_hippeis_spw_low.cas, 40
model_flexi eb/data/models_unit/ebhellenic_cavalry_hippeis_spw_lowest.cas, max
model_sprite greek_cities, 60.0, eb/data/sprites/greek/ebsprite_greek_cavalry_hippeis_all.spr
model_sprite seleucid, 60.0, eb/data/sprites/greek/ebsprite_greek_cavalry_hippeis_all.spr
model_sprite thrace, 60.0, eb/data/sprites/greek/ebsprite_greek_cavalry_hippeis_thrace.spr
model_sprite slave, 60.0, eb/data/sprites/greek/ebsprite_greek_cavalry_hippeis_slave.spr
model_sprite numidia, 60.0, eb/data/sprites/greek/ebsprite_greek_cavalry_hippeis_merc.spr
model_sprite romans_julii, 60.0, eb/data/sprites/greek/ebsprite_greek_cavalry_hippeis_slave.spr
model_sprite merc, 60.0, eb/data/sprites/greek/ebsprite_greek_cavalry_hippeis_merc.spr
model_tri 400, 0.5f, 0.5f, 0.5f


And finally I edited the export_descr_buildings.txt file to contain:

city_barracks_J1 requires factions { romans_julii, numidia, } and building_present_min_level government gov3 and not hidden_resource not_here
{
capability
{
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource C and hidden_resource n1 and hidden_resource n2 and hidden_resource y4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource C and hidden_resource n1 and hidden_resource y2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource E and hidden_resource n1 and hidden_resource n2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource D and hidden_resource y1 and hidden_resource y2 and hidden_resource y4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource C and hidden_resource n1 and hidden_resource n2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource C and hidden_resource y1 and hidden_resource y2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource C and hidden_resource n1 and hidden_resource y2 and hidden_resource y4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource D and hidden_resource n1 and hidden_resource n2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource y1 and hidden_resource y2 and hidden_resource y4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource NW and hidden_resource D and hidden_resource n1 and hidden_resource n2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource B and hidden_resource n1 and hidden_resource y2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource B and hidden_resource n1 and hidden_resource n2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource C and hidden_resource y1 and hidden_resource y2 and hidden_resource y4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource C and hidden_resource n1 and hidden_resource y2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource B and hidden_resource n1 and hidden_resource y2 and hidden_resource y4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource E and hidden_resource y1 and hidden_resource n2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource C and hidden_resource y1 and hidden_resource y2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource NW and hidden_resource A and hidden_resource n1 and hidden_resource y2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource E and hidden_resource n1 and hidden_resource y2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource C and hidden_resource n1 and hidden_resource n2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource B and hidden_resource y1 and hidden_resource y2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource y1 and hidden_resource y2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource y1 and hidden_resource y2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource n1 and hidden_resource y2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource y1 and hidden_resource n2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource C and hidden_resource n1 and hidden_resource y2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource A and hidden_resource y1 and hidden_resource y2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource NW and hidden_resource A and hidden_resource n1 and hidden_resource n2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource C and hidden_resource n1 and hidden_resource n2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource y1 and hidden_resource n2 and hidden_resource y4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource n1 and hidden_resource n2 and hidden_resource y4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource C and hidden_resource n1 and hidden_resource n2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource A and hidden_resource n1 and hidden_resource n2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource NW and hidden_resource D and hidden_resource y1 and hidden_resource n2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource n1 and hidden_resource y2 and hidden_resource y4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource n1 and hidden_resource y2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource C and hidden_resource y1 and hidden_resource n2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource n1 and hidden_resource n2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource y1 and hidden_resource n2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource D and hidden_resource n1 and hidden_resource y2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource B and hidden_resource n1 and hidden_resource n2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource C and hidden_resource y1 and hidden_resource y2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource C and hidden_resource y1 and hidden_resource n2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource C and hidden_resource y1 and hidden_resource y2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource NW and hidden_resource D and hidden_resource y1 and hidden_resource y2 and hidden_resource y4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource EA and hidden_resource E and hidden_resource y1 and hidden_resource y2 and hidden_resource n4 and hidden_resource n8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource C and hidden_resource y1 and hidden_resource n2 and hidden_resource n4 and hidden_resource y8
recruit "greek cavalry hippeis" 0 requires factions { romans_julii, numidia, } and hidden_resource SW and hidden_resource B and hidden_resource y1 and hidden_resource n2 and hidden_resource y4 and hidden_resource y8


Since I wasn't in any way particularly concerned with changing AOR and such I kept & copied that code to army_barracks_J1 and royal_barracks_J1 as well. (Otherwise I would be unable to train hippeis in levels beyond city_barracks_J1....)

Megas Methuselah
05-24-2008, 03:39
TA, you're a living legend. :clown:

Socy
05-24-2008, 10:58
What Methuselah said! Thanks a bunch TA, I owe you one:smash:

Aaldaemon
05-24-2008, 11:34
Ooooh, thanks a lot Tellos! I wasn't quite 100% sure about the model part but now I should be able to make my own unhistorical Greek empire that can field hellenistic cataphracts. Spartans and Cataphracts togetherrrrr ooooh /faints.

Socy
05-24-2008, 16:48
While the post from TA certainly was helpful I still would be grateful if anyone would care to elaborate on AOR and how to change the bodyguards of client-rulers (The ones in eastern provinces) so that they become like the client-rulers that the AS start with. (Check Babylon; Babylons client ruler = Shipri Tukul as bodyguard).

By the way, is changing recruitment for a faction save-game compatible?

Tellos Athenaios
05-24-2008, 17:15
Well about AOR, or Area of Recruitment: in EB there exists a system with hidden resources (or HRs for short). Since each region can have a number of hidden resources, you can use a particular unique combination of (certain) hidden resources to indentify a particular region.

So basically:
PSEUDO code to clarify descr_regions.txt found in the eb/data/world/maps/base folder


My region
My city
My people
111 222 0 ; a unique RGB encoding: the colour of a region must match
; the colour of the region on the Map_regions.tga file.
Some more codes
My comma separated HR list


These HR's can be referenced inside the export_descr_buildings.txt file in the eb/data folder; as I said before. The Unique combinations EB uses are a general area markers + a unique (binary) 'number'.

Example (from my Hippeis code as posted above)


and hidden_resource SW and hidden_resource B and hidden_resource y1 and hidden_resource y2 and hidden_resource n4 and hidden_resource y8

The green code is typical of the EB 'general' area marker (SW meaning South-West I think) which is, let's say, Sicily + North Western Africa. I don't know if that really is the case -- but that's for the purpose of an example totally irrelevant anyways. The binary number bit is the blue code. n1 is the opposite of y1, y2 the opposite of n2 and so forth. So this works out: 1011 => region number 11.

Hence, by using 1 'line' of recruitment code per unit per region (per barracks complex, but that is for other purposes) you can set up detailed AOR's. Now, you can of course specify different recruitment code per level of MIC you use, which means in theory you can have wider AOR's on higher MIC levels than on lower levels. (Or vice versa, of course.)

However, if you were to simply delete the entire section listing the hidden resources, you would end up with an AOR which covers the entire map. For instance hippeis would be recruitable in Axum as well as Roma or Gawjam~Heruskoz or Chighu.

If you were to delete the binary number bit, you would now enable recruitment of hippeis throughout the entire region marked by hidden_resource SW and hidden_resource B.

So if you don't want/need a very fine and meticulously defined AOR you can economize on the amount of code quite a bit through means of deleting the binary number (and omitting the other code which specifies other regions within the same general area).

Socy
05-24-2008, 17:53
You're a true hero TA, so it is almost with shame that I ask another question. In the export_descr_unit file the Nakhararakan Tiknapah (Armenian Noble Infantry) and the Shipri Tukul (Babylonian Heavy Infantry) share the same model, namely the "eastern_infantry_babylonian_nakhararakantiknapah". Now, if I add both these units to the same faction rooster, say AS, will it work? Seeing as they share the same model.

The reason that I'm asking is beacuse Hayasdan (roman_scipii) can recruit both according to the export_descr_unit.

And ofcourse, are all these changes save game compatible?

Tellos Athenaios
05-24-2008, 18:11
Then you will probably find that one of those units (I guess it's the Babylonians) are in fact labeled with merc in the descr_model_battle.txt. That is the Babylonian unit simply uses the merc skin slot on the model as defined in the text file.

So let us assume the code is


dictionary myunit
...
texture merc ... .../myunit_merc.tga
texture romans_scipii ... .../myunit_scipii.tga


And the corresponding edu code


unit myunit ;; just a name could be anything
dictionary myunit ;; some dictionary unit.


And:



unit myunit_merc ;; just another name -- doesn't really matter what
dictionary myunit ;; note that this is the same 'entry' as that of the other unit!


Now there's something you would need to keep in mind: the decr_model_battle.txt file (dmb) uses the dictionary 'code'. And as you can see from the pseudo code the two (different!) units refer to the same dictionary 'entry'; hence the same dmb code.

However both edu (export_descr_units.txt) and edb (export_descr_buildings.txt) refer to this 'unit' code. Hence, you can have some edb code

recruit "myunit" 0 requires factions { romans_scipii, }
As well as some other code in the same file

recruit "myunit_merc" 0 requires factions { romans_scipii, }

So, the answer to your question? Yes. It is possible to assign both units to the Seleukid roster -- you just have to make sure that the Seleukids (romans_julii) use a similar 'code' setup as the Hayasdan (romans_scipii) do.

Socy
05-24-2008, 18:21
I'll never be able to really repay your generousity TA. But when I think of it, wouldn't it be good/usefull if the posts that you have made in this thread be copied and pasted into a new thread that would get stickied in the EB forums, wich would act as a sort of step-by-step tutorial for new "modders" (People that want to modify "their" copy of EB)?:idea2:

I'm sure that I'm not the only one out there seeking advice on how to incorporate different units to my preferred faction.:idea2:

Foot
05-24-2008, 18:23
This isn't really the right forum for it. There a lots of tutorials on modding RTW on other parts of the forum. The EB forum is for discussing EB not for modding RTW.

Foot

Socy
05-24-2008, 18:35
Ah well, I suppose you are right. It's just that in the EB forums you get this feeling that you are almost guaranted a serious and civilized answer.

Perhaps then this thread would better fit in the EB Unofficial modding forums?