PC Mode
Org Mobile Site
Forum > Medieval 2: Total War > Medieval 2: Total War > M2:TW Modification > Learn to Mod > Modding Questions >
Thread: Can you control which units push siege gear?
Bwian 09:42 08-28-2007
This is something which I have been pondering greatly, and wondered if anyone out there knew of a simple answer!

Basically, I have made up a unit for the Warhammer mod which MUST NOT be able to push a ram, or man a catapult etc. It just couldn't. Ever.

Is there a flag which can be set in the unit stats that will ensure it never does?

I know cavalry doesn't, but if I make this unit cavalry, there are serious issues around what happens should this ever be assigned a general unit...

I was hoping to re-create something along the lines of the old RTW dog handler units .... which never got assigned to artillery as far as I can recall. I have several units planned along similar lines, so this is something I will spend some time messing with. Tomb Swarms...Squig herds... bat swarms...those sorts of things!

Reply
alpaca 11:55 08-28-2007
Did you try to re-enable the handlers? I think the code should still be in the exe

Reply
Bwian 12:32 08-28-2007
That's what I am looking at now.

The wardog animations are still in the animation packs and the descr_animal text file does still exist. On the negative side, the wardog skeleton and model are not here.

I have started to look at how easily a horse skeleton could be modded into a dog... The bone names would need to be changed in all the animations, but the animation set allows cas-txt and txt-cas, so I should be able to swap the names in the animations to match the horse bones. Then...I just need to set up the base pos to match the old dog ones, and that should work ok. Or crash horribly!

First off, though, I need to find out if there is a way to make another skeleton set work as an animal. I don;t want to do all that work only to find out the code was cut!!!!

Reply
Bwian 12:56 08-28-2007
Nope....looks like this won't work.

I tried adding in a unit to use wardogs in export_descr_unit, and it crashes on the 'animal' line stating it is missing a parameter. It was failing at column 1... so it was the 'animal' parameter it was choking on, not a reference triggered by it's inclusion.

I also tried messing about with the descr_animal to see if the game noticed, and I can only conclude form that that the game does not read it. If it did, it should cause a crash..since it refers to models that have been removed.

I made sure all the other parameters were set, but I could not get to the point where it would actually parse the text files and start the game ... so I shan't bother further with making models and skeletons for the wardog...

Back to the drawing board

Reply
alpaca 14:33 08-29-2007
I bet you forgot something.
Keep in mind the category has to be handler and you have to copy in descr_animals.txt from RTW:
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
;
;	This file contains the animal linkages; it gets parsed on application 
;	startup but is not otherwise referred to. The data format is thus:
;
;	Fields should be entered in the order shown.
;
;	;						indicates a comment ;-)
;	[]						indicates optional
;
;	type					indicates a new mount type, must be followed by id name string
;	class					animal class (current possibilities - wardog, pig)
;	model					model id from descr_model_battle 
;	radius					animal radius
;	[ x_radius ]			animal x axis radius for elliptical mounts (radius is y radius in this case) 
;	height					animal height
;	mass					animal mass

type		wardog
class		wardog
model		wardog
radius		0.75
x_radius	0.35
height		1.0
mass		1.0

type		pig
class		pig
model		pig
radius		0.75
x_radius	0.35
height		1.0
mass		0.5
I got to this:
Code:
15:34:32.437 [script.err] [error] Script Error in MA_italia/data/export_descr_unit.txt, at line 207, column 1
Could not find animal battle model for unit type 'wardog'.
15:34:32.437 [data.invalid] [error] DATABASE_TABLE error found : error reading record from file MA_italia/data/export_descr_unit.txt.
With this entry in edu:
Code:
type             spearmen
dictionary       spearmen
category         handler
class            spearmen
voice_type       Light
banner faction   main_spear
banner holy      crusade
soldier          spearmen, 60, 0, 1
animal			 wardogs
attributes       sea_faring, hide_forest, can_withdraw, free_upkeep_unit
formation        1.2, 1.2, 2.4, 2.4, 5, square, schiltrom
stat_health      1, 0
stat_pri         5, 2, no, 0, 0, melee, melee_blade, piercing, spear, 25, 0.6
;stat_pri_ex      0, 0, 0
stat_pri_attr    spear, spear_bonus_8
stat_sec         0, 0, no, 0, 0, no, melee_simple, blunt, none, 25, 1
;stat_sec_ex      0, 0, 0
stat_sec_attr    no
stat_pri_armour  0, 1, 3, flesh
;stat_armour_ex   0, 4, 5, 7, 1, 6, 6, flesh
stat_sec_armour  0, 0, flesh
stat_heat        2
stat_ground      1, -2, 3, 2
stat_mental      3, normal, trained
stat_charge_dist 30
stat_fire_delay  0
stat_food        60, 300
stat_cost        1, 310, 125, 75, 60, 310, 4, 70
armour_ug_levels 0
armour_ug_models spearmen
ownership        slave
;unit_info        5, 0, 7
Now, I won't pursue this further because it won't be of any use to me and I don't have the time but I thought it might get you going

Edit: You should probably also change the stat_sec_attr and so on, let the RTW values inspire you for a first attempt.

Reply
Bwian 17:33 08-31-2007
Ahh...thanks alpaca ... IF you got it to work to that point, then it stands to reason that the code IS in place. It was failing purely because it had not found the model...which means all else was OK.

And yes....I had NOT changed the category to handler!

I'll give it another shot

Reply
alpaca 18:48 08-31-2007
Originally Posted by Bwian:
Ahh...thanks alpaca ... IF you got it to work to that point, then it stands to reason that the code IS in place. It was failing purely because it had not found the model...which means all else was OK.

And yes....I had NOT changed the category to handler!

I'll give it another shot
Yeah but the problem I see here is to figure out what an animal entry in the modelsdb would look like

Reply
Bwian 10:15 09-02-2007
The modelsdb entry should look just like any other, I would guess. I am running a test using an elephant in place of the dog model, and this works just fine. There are some issues with the death animations, where the 'dog' is killed and the corresponding animation for 'death' is not there.

Next step is to modify all the 'dog' animations and make a skeleton that matches. There are dog animation routines, which give me a start point.

First job will be to make a modified elephant skeleton with the bones where the dog joints would be. Then, I will need to re-name all the joints in the dog animations to match the 'elephant' bone names. Then, if I have this right, I can apply the modded elephant skeleton to the dog animations, and have Wardogs. And Squigs. And tomb swarms.

I may find, though, that there are silly restrictions on the number of animals that can be had. If this is like RTW, then I will be limited in what I can have attack ... but at a bare minimum, I will have tomb swarms and Khorne hounds!

Reply
alpaca 12:39 09-02-2007
A shame we can't have real flying bats, that'd be cool

Reply
Bwian 23:41 09-02-2007
Nope... seems we are stuck with the same old hard-coded 2 entries only. Nothing else I can put in will work, though I can have 'pigs' with a class of 'wardog' so they behave like wardogs, rather than walking barbeques!

Pity I can't have more ...but at least I can have something.

Reply
Up
Single Sign On provided by vBSSO