PDA

View Full Version : Adding a new unit



Kaidonni
12-05-2005, 16:48
Okay, as some of you may know, I've been modding the game so I can play as the ERE Rebels. With a great deal of help from Maley Jacek, that has been a roaring success. Now, however, I'm intending to run it alongside meqon's game enhancement mod (the one that cuts all recruitment times to 0, cuts recruitment and upkeep costs, and cuts out Peasants). I'm finding it most, well, unappealing that I don't have a unit that can do a decent garrison duty in a settlement, so I was wondering if someone could help me create a Town Guard unit for the WRE, ERE, WRE Rebels and ERE Rebels, a unit that can't throw any pila, and looks like the Limitanei, but also (on large unit scale) has 120 men in the unit. Doesn't need to be very good against other units, just needs to be decent at keeping public order. Thanks. ~:cheers:

GrimSta
12-05-2005, 17:32
Copy this into your export_descr_unit



type town guard
dictionary town_guard ; Limitanei
category infantry
class spearmen
voice_type Light_1
soldier limitanei, 60, 0, 1
attributes sea_faring, hide_forest, can_sap
formation 1, 2, 2, 3, 5, square
stat_health 1, 0
stat_pri 3, 1, no, 0, 0, melee, simple, piercing, spear, 25 ,0.73
stat_pri_attr prec, thrown
stat_sec 0, 0, no, 0, 0, no, no, no, none, 25 ,0.73
stat_sec_attr light_spear, spear_bonus_4
stat_pri_armour 6, 5, 6, leather
stat_sec_armour 0, 2, flesh
stat_heat 4
stat_ground 2, 0, 3, 0
stat_mental 3, normal, trained
stat_charge_dist 30
stat_fire_delay 0
stat_food 60, 300
stat_cost 0, 125, 60, 30, 50, 230
ownership slave, empire_west, empire_east, empire_west_rebels, empire_east_rebels

and then copy this into your descr_model_battle



type town_guard
;--------------------------------------
skeleton fs_spearman
indiv_range 40
texture empire_west, bi/data/models_unit/textures/BI_unit_limitanei_west_empire.tga
texture empire_east, bi/data/models_unit/textures/BI_unit_limitanei_empire_east.tga
texture empire_west_rebels, bi/data/models_unit/textures/BI_unit_limitanei_empire_west_rebels.TGA
texture empire_east_rebels, bi/data/models_unit/textures/BI_unit_limitanei_empire_east_rebels.tga
texture slave, bi/data/models_unit/textures/BI_unit_limitanei_slave.tga
model_flexi bi/data/models_unit/BI_unit_limitanei_lod1.cas, 15
model_flexi bi/data/models_unit/BI_unit_limitanei_lod2.cas, 30
model_flexi bi/data/models_unit/BI_unit_limitanei_lod3.cas, 40
model_flexi bi/data/models_unit/BI_unit_limitanei_lod4.cas, max
;model_sprite empire_east, 60.0, bi/data/sprites/empire_east_limitanei_sprite.spr
;model_sprite empire_west, 60.0, bi/data/sprites/empire_west_limitanei_sprite.spr
model_sprite slave, 60.0, bi/data/sprites/slave_limitanei_sprite.spr
model_sprite empire_west_rebels, 60.0, bi/data/sprites/empire_west_rebels_limitanei_sprite.spr
model_sprite empire_east_rebels, 60.0, bi/data/sprites/empire_east_rebels_limitanei_sprite.spr
model_sprite empire_west, 60.0, bi/data/sprites/empire_west_limitanei_sprite.spr
model_sprite empire_east, 60.0, bi/data/sprites/empire_east_limitanei_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f


That will add a new unit called Town Guard, with no unit card that cannot be recruited.
To make them playable they need a Unit Description though

Go to export_descr_unit_enums and add this to the bottom


town_guard
town_guard_descr
town_guard_descr_shot

Then go to bi/text/export_units and add this in to the bottom



{town_guard} Town Guard

{town_guard_descr}
Town Guard patrol the towns of the Roman Empire and keep the streets and allys safe for the Roman Citizen to pass through. They are best suited to garrisoning cities, however they can be called upon to fight in the legions if required altough the day they fight in place of the legionarii will be a sad day indeed for Rome.

{town_guard_descr_short}
Town Guard patrol the towns of the Roman Empire and keep the streets and allys safe for the Roman Citizen to pass through.


To make them recruitable you need to add the following lines to export_descr_buildings, put this in the "building barracks" section, just press ctrl+f to find "building barracks" then add this underneath Limitanei


recruit "town guard" 0 requires factions { empire_west_rebels, empire_west, empire_east_rebels, empire_east, }

That will make them recruitable.
To give them a unit card just find the Limitanei ones and change them slightly (write town guard on them or something) and change the name of it to "#town_guard" and make one of those for the 4 Roman factions.

The Unit Cards can be found in bi/data/ui/units/faction name
To make Unit Info cards just find the limitanei one in bi/data/ui/units_info/faction name change it to what you want then call it town_guard.


I Hope that helps mate.

:bow:

Kaidonni
12-05-2005, 19:14
It all works fine mate (when I have the right files put into my BI folder...lol, I put some unmodded files in and was confused as to why I couldn't find Town Guard...lol).

One more thing - when right clicking on the recruitment queue to bring up info on them, it shows a peasant in the info window...is there any way to avoid that, or have I done something wrong?

GrimSta
12-05-2005, 19:28
did you create unit cards for them?
Oh, and i forgot you were using Meqon-Mod, ill reduce the cost of those guys for you so it fits with his work :D

Kaidonni
12-05-2005, 20:30
I created unit cards in the ui section for them. I took the #limitanei.tga files, copied them, and pasted them in the correct places (for each of the Romans), and renamed the files to #town_guard.tga.

Kaidonni
12-05-2005, 20:33
Ah...didn't do the unit info ones. I need town_guard versions of the limitanei.tga files, don't I, for the unit info? What about the battle map, too? No need for you to change the costs, etc, I've done that bit.

GrimSta
12-05-2005, 21:16
on the battle map they are identical to Limitanei, if you want them changed i can do a small reskin for you

Kaidonni
12-05-2005, 23:07
No, no reskin needed thanks. They'll be just fine. I'll see if I can't get their unit info card correct.

Kaidonni
12-05-2005, 23:14
Okay...one problem. The game CTDs whenI go to the battlefield. Specifically when I press 'Start Deployment.' I was testing out the Town Guard.

Kaidonni
12-05-2005, 23:16
Yep...it did it a second time...

Kaidonni
12-05-2005, 23:32
It's okay now...found out it was the unit not having any missile attack choice.