Greetings,
this is a tutorial on how to save some coding from the DMB text file and applies
mostly on units that will have the same skin for many factions,
in Hegemonia City-States we have one hoplite for every city,any faction conquers
a city will use the city's special hoplite,for example the spartan "homoioi hoplitai" unit
will have the same texture for any faction will conquer sparta(lol) and be able to recruit them.
first of all to make this tutorial work' the skinner,the modeller and the coder
of a mod must work together and come to an agreement on the names of the
models and the skins,to make it clearer let's start.
firstly
the modeller makes the model and the skinner the skin,they have to come to an
agreement of the name they are going to use,for example:
if the model would be named "M_greek_hoplite.cas"
then the skin should be "S_greek_hoplite.tga.dds"
the reason for this' is going to be more understandble later.
So,we have a model that it is named "M_greek_hoplite.cas"
and a skin that it is named "S_greek_hoplite.tga.dds"
the modeller should open the model "M_greek_hoplite.cas" with 3DSMAX and apply
the texture "S_greek_hoplite.tga.dds" on it,then the model should be
exported with the skin on it,on this phase the skin named "S_greek_hoplite.tga.dds"
becomes hardcoded on the model.
normally when the coder put this unit in the DMB text file for,say, 5 factions
then he/she will code it like this:
Code:
type greek_hoplite
skeleton fs_spearman, fs_swordsman
indiv_range 40
texture greek_cities, data/models_unit/textures/S_greek_hoplite.tga
texture macedon, data/models_unit/textures/S_greek_hoplite.tga
texture seleucid, data/models_unit/textures/S_greek_hoplite.tga
texture thrace, data/models_unit/textures/S_greek_hoplite.tga
texture slave, data/models_unit/textures/S_greek_hoplite.tga
model_flexi data/models_unit/M_greek_hoplite.cas
model_sprite 60.0, data/sprites/greek_hoplite_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
in the case of this tutorial after the model "M_greek_hoplite.cas" has been exported from 3DSMAX
with the skin "S_greek_hoplite.tga.dds" on it ,then we could code like this
(don't forget ONLY if we want the particular unit to use the same texture by every faction it could
recruit it.):
Code:
type greek_hoplite
skeleton fs_spearman, fs_swordsman
indiv_range 40
texture no_faction(i'll explain this later), data/models_unit/textures/S_greek_hoplite.tga
model_flexi data/models_unit/M_greek_hoplite.cas
model_sprite 60.0, data/sprites/greek_hoplite_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
As you understand after the export from 3DSMAX with the correct texture on it,the texture
has been hardcoded on the unit, BUT the texture MUST be in the textures folder so that the
model "finds it" by it's own.
the point for coming on an agreement on the names of the model and the skin is to have
an order on the names and don't have to look in the DMB everytime we want to know the skin
so the names, for example,"M_greek_hoplite.cas" and "S_greek_hoplite.tga.dds" points the way
that the skin has the same name as the model except the M(model)_ and S(kin)_.
Another example
If we want the particular unit to be recruited by all factions,we normally code like this:
Code:
type greek_hoplite
skeleton fs_spearman, fs_swordsman
indiv_range 40
texture romans_julii, data/models_unit/textures/S_greek_hoplite.tga
texture armenia, data/models_unit/textures/S_greek_hoplite.tga
texture britons, data/models_unit/textures/S_greek_hoplite.tga
texture romans_brutii, data/models_unit/textures/S_greek_hoplite.tga
texture carthage, data/models_unit/textures/S_greek_hoplite.tga
texture dacia, data/models_unit/textures/S_greek_hoplite.tga
texture egypt, data/models_unit/textures/S_greek_hoplite.tga
texture gauls, data/models_unit/textures/S_greek_hoplite.tga
texture germans, data/models_unit/textures/S_greek_hoplite.tga
texture greek_cities, data/models_unit/textures/S_greek_hoplite.tga
texture macedon, data/models_unit/textures/S_greek_hoplite.tga
texture mercenary, data/models_unit/textures/S_greek_hoplite.tga
texture numidia, data/models_unit/textures/S_greek_hoplite.tga
texture parthia, data/models_unit/textures/S_greek_hoplite.tga
texture pontus, data/models_unit/textures/S_greek_hoplite.tga
texture romans_scipii, data/models_unit/textures/S_greek_hoplite.tga
texture scythia, data/models_unit/textures/S_greek_hoplite.tga
texture seleucid, data/models_unit/textures/S_greek_hoplite.tga
texture romans_senate, data/models_unit/textures/S_greek_hoplite.tga
texture slave, data/models_unit/textures/S_greek_hoplite.tga
texture spain, data/models_unit/textures/S_greek_hoplite.tga
texture thrace, data/models_unit/textures/S_greek_hoplite.tga
model_flexi data/models_unit/M_greek_hoplite.cas
model_sprite 60.0, data/sprites/greek_hoplite_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
in the case of this tutorial we should code it like this:
Code:
type greek_hoplite
skeleton fs_spearman, fs_swordsman
indiv_range 40
texture no_faction(i'll explain this later), data/models_unit/textures/S_greek_hoplite.tga
model_flexi data/models_unit/M_greek_hoplite.cas
model_sprite 60.0, data/sprites/greek_hoplite_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
AND
if we want another skin for the faction of Pontus ,say "S_pontus_hoplite.tga" ,and the same for all the rest factions
we will normally code it like this:
Code:
type greek_hoplite
skeleton fs_spearman, fs_swordsman
indiv_range 40
texture romans_julii, data/models_unit/textures/S_greek_hoplite.tga
texture armenia, data/models_unit/textures/S_greek_hoplite.tga
texture britons, data/models_unit/textures/S_greek_hoplite.tga
texture romans_brutii, data/models_unit/textures/S_greek_hoplite.tga
texture carthage, data/models_unit/textures/S_greek_hoplite.tga
texture dacia, data/models_unit/textures/S_greek_hoplite.tga
texture egypt, data/models_unit/textures/S_greek_hoplite.tga
texture gauls, data/models_unit/textures/S_greek_hoplite.tga
texture germans, data/models_unit/textures/S_greek_hoplite.tga
texture greek_cities, data/models_unit/textures/S_greek_hoplite.tga
texture macedon, data/models_unit/textures/S_greek_hoplite.tga
texture mercenary, data/models_unit/textures/S_greek_hoplite.tga
texture numidia, data/models_unit/textures/S_greek_hoplite.tga
texture parthia, data/models_unit/textures/S_greek_hoplite.tga
texture pontus, data/models_unit/textures/S_pontus_hoplite.tga
texture romans_scipii, data/models_unit/textures/S_greek_hoplite.tga
texture scythia, data/models_unit/textures/S_greek_hoplite.tga
texture seleucid, data/models_unit/textures/S_greek_hoplite.tga
texture romans_senate, data/models_unit/textures/S_greek_hoplite.tga
texture slave, data/models_unit/textures/S_greek_hoplite.tga
texture spain, data/models_unit/textures/S_greek_hoplite.tga
texture thrace, data/models_unit/textures/S_greek_hoplite.tga
model_flexi data/models_unit/M_greek_hoplite.cas
model_sprite 60.0, data/sprites/greek_hoplite_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
in the case of this tutorial we should code it like this:
Code:
type greek_hoplite
skeleton fs_spearman, fs_swordsman ; combat spear
indiv_range 40
texture pontus, data/models_unit/textures/S_pontus_hoplite.tga
texture no_faction(i'll explain this soon), data/models_unit/textures/S_greek_hoplite.tga
model_flexi data/models_unit/M_greek_hoplite.cas
model_sprite 60.0, data/sprites/greek_hoplite_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
SPRITES
now when we are ready to generate sprites,we make the standard actions ("-sprite_script"->command line,
"sprites" folder->RTW/data/"sprites" and the sprite_script text file in RTW/data).
now i'll explain the "no_faction",it is not important to write no_faction at this place as to
write something,a number a word,anything.
the point is that we write here whatever we write in the sprite_script text file next to the model.
example:
if we have this in the DMB :
Code:
type greek_hoplite
skeleton fs_spearman, fs_swordsman ; combat spear
indiv_range 40
texture karpouzi, data/models_unit/textures/S_greek_hoplite.tga
model_flexi data/models_unit/M_greek_hoplite.cas
model_sprite 60.0, data/sprites/greek_hoplite_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
then in the sprite_script text file we will have this:
Code:
greek_hoplite karpouzi
for the case we want a different texture to one faction
we have this in the DMB :
Code:
type greek_hoplite
skeleton fs_spearman, fs_swordsman ; combat spear
indiv_range 40
texture pontus, data/models_unit/textures/S_pontus_hoplite.tga
texture karpouzi, data/models_unit/textures/S_greek_hoplite.tga
model_flexi data/models_unit/M_greek_hoplite.cas
model_sprite 60.0, data/sprites/greek_hoplite_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5f
and in the sprite_script text file we will have this:
Code:
greek_hoplite karpouzi
greek_hoplite pontus
but it is better to use a phrase like "no_faction" rather than karpouzi(the greek water melon!)
so, thats it!
i'm posting this tut on the models forum but i think that it would be usefull to be mentioned
and in the coding forum.
i hope i made my self understandable enough and maybe help someone to save some time...
thanks to MasterOfNone for the direction on sprites.