You must be logged in to post messages.
Please login or register

Game Modifications
Moderated by alincarpetman

Hop to:    
Welcome! You are not logged in. Please Login or Register.135 replies, Sticky
Rise of Nations Heaven » Forums » Game Modifications » How to mod units - Answered.
Bottom
Topic Subject:How to mod units - Answered.
« Previous Page  1 2 3 4 5 6  Next Page »
montero
Member
posted 09-19-05 07:10 PM EDT (US)         
HOW TO MOD UNITS:
Well first off, I''ll start using the Inca as an example:
I modded the Inca and made them the Venezuelan, they get various brand
new UUs, so I'll just explain what I did to acheive this:

First off, you need to backup four files in case you mess up:
-unitrules.xml
-unit_graphics.xml
-help.xml
-soundtypes.xml.
All of them are located in your T&P "data" folder. Or, if you have RoN only, the data folder in side Rise of Nations. C:\Rise of Nations\Data.

Now first you should think of what you want to do, for the Inca, I first made Info Age L. Infantry called "Guardia Nacional". After you got your ideas set up, you should open up the unitrules.xml file with a text editor (I use Notepad), find a unit that's not used in the game or you don't care about, I replaced the
Inca Inti Macemen. Now, find the entry for that unit (simply hit search and type the
unit's name) and replace it's stats with the ones you want it to have, for instance, I changed the Inti's attack to 27 from around 14, specify the requirements
for the unit (they are pretty obvious, in a field named "PREQ" and "PREQ1").
I recommend you find another unit from the same age and copy it's specs, but DON'T
change the "GRAPH" field, it'll just use the other unit's art, portrait and sound, and that's not what you want, aye?
After your done tinkering with the stats (make
sure you type the correct age name in "PREQ", in my case Information Age) save up the new file.
Also, if you want to make your new unit "Unique", just type in a "y" in the "FLAGS" field.

Now you need to go to unit_graphics.xml, specifying the art and animation for all units, find the unit you changed (ex. search=INTIMACEMEN) and change the destination
from which it reads the art files, so, the Inti Macemen's original was
"model=".\art\Macemen.bh3" texture=".\art\Macemen.tga", BH3 is the 3D model and TGA
is the skin for the unit, I replaced those to "model=".\art\modern_shockinfantry.bh3" texture=".\art\modern_shockinfantry.tga"
Make sure you put in the correct name in, this should give your unit that art. Now for the animations, just find a same type of unit (Info Age L. Inf.) and copy/paste it's info in place of the existing ones, they're just below the unit name, after this your unit will look and move correctly, you will also want to change the unit's portrait or asign another unit's one to it,
to do this find 'tex_id="TEX_UNITS_2" tex_col="0" tex_row="4" tex_x="-1" tex_y="-1" tex_clip="0"> or something like that, it depends on the unit. Now if you're gonna asign another unit's portrait, find that unit's tex_id="TEX_UNITS" entry and paste
it over your unit's if you're gonna edit the existing portrait...well that's a bit more comlpicated, leave the current TEX_UNITS,
and go to your art folder, find the Iface_units 01, 02 and 03, open them ALL up with an image editing program (not sure if Paint works, I don't think so, I use Photoshop) there you will find ALL unit's in-game portrait, now find the replaced unit's one, and paste in the one you made, downloaded or whatever, save the file as Targa, and that's it, now save up unit_graphics and on to step 3.

Now, go to soundtypes.xml, the document which specifies the sounds of: attack, selection, creation, etc.
Pretty simple here, just find (again) a unit from the same type and age and paste in their info (for instance, I looked up
the Shock Infantry, on which I had based my entire unit, and pasted it's sounds on top of the former Inti sounds) after that...
you're done with soundtypes.xml! That's it for the complex part, now we go to aesthetics.

Go to help.xml, once again search up your unit's ORIGINAL name (INTIMACEMEN) you should find some text saying:
Inca Unique {Heavy Infantry} and a short description which is the one you see in the game
(Inca Unique {Light Infantry}, Medieval Age #ICON29 - fast, cheap melee troops effective against enemy mounted troops.)
Now replace the nation's name to the one you asigned the new unit, and type in a little description about it, it should look like this:
(Venezuelan Unique {Modern Infantry}, Information Age #ICON34 - fast, rapid-firing soldiers used for Patriotic Defense.)
Or whatever you decide to put in, now lastly see the #ICON34 or #ICON29? That's the Age portrait (Enlightenment: the little
buildings with the V symbol) to change it simply find a unit from that Age and put it's "ICON" (INFO: 34, ENLIGHT: 29, etc)
Afer that, save up and enter RoN, select the nation you added or changed the unit for, start a game and check if it worked, if
not, retrace your steps and make sure everything is in order, hope I was able to help all of you.

Ah yes, important, at the top of the unitrules.xml file is a little "glossasy" which explains what does what, it's very handy for starters. (And experts as well, never forget a good manual).
-------------------------
Some interesting things.

You can asign cultural-art-set-related skins to units (think difference between European and Asian units), all you need to do is create another entry in the unit_graphics.xml file, right after the original entry, but replace the "DEFAULT" part of the unit's name to whatever art set you want it to be, like "ASIAN" for example. So, if you want to give China the US Assault Marines, but with a different skin, all you need to do is:
-Copy the ASSAULTMARINES-DEFAULT-AGE0 [...] entry in it's entirity.
-Paste it just below.
-Now, change ...-DEFAULT... to ASIAN, and asign it a new skin and/or model, just like explained above.

The cultural-related entries would be:
-DEFAULT (European)
-ASIAN
-ARAB (African)
-AMERICAN
-NA (Native North Americans)

-------------------------
Nations' tribe masks are:

100000000000000000000000 Persians
010000000000000000000000 Dutch
001000000000000000000000 Indians
000100000000000000000000 American
000010000000000000000000 Lakota
000001000000000000000000 Iroquois
000000100000000000000000 Mongols
000000010000000000000000 Koreans
000000001000000000000000 Japanesse
000000000100000000000000 Chinese
000000000010000000000000 Russians
000000000001000000000000 Germans
000000000000100000000000 British
000000000000010000000000 French
000000000000001000000000 Spanish
000000000000000100000000 Turks
000000000000000010000000 Egyptians
000000000000000001000000 Romans
000000000000000000100000 Greeks
000000000000000000010000 Nubians
000000000000000000001000 Bantu
000000000000000000000100 Inca
000000000000000000000010 Maya
000000000000000000000001 Aztecs


Thanks to jesus123 for posting the expack tribe mask.
And thanks to ODA for posting jesus123's numbers in his "unnoficial modding FAQ" topic. I added this here to save you the trouble of having to go to ODA's topic to find the masks.

Another update, when modding units, you can determine where they show up their building, for instance, you can add a third unit at the fort or even the barracks (before the Industrial Age, remember Machine Guns and Flamethrowers), to do this, simply look for "<GRID_X>" in any unit entry in the unitrules.xml file, and change it to the position you want the unit to be in, this allows you to "add" a new unit while still being able to build a similar unit, for example, you could have two kinds of Musketeers at the Barracks, simultaneously, and so on, the count on the "X Grid" starts at zero, with this format:

[MUSKETEERS] [FUSILIERS] [YOUR NEW UNIT] [ANOTHER NEW UNIT]
______0___________1____________2________________3_________


This article was made on Feb. 4th, 2005 and edited on September 19th, October 1st and October 28th 2005 by Luis M. Montero.


Author of Modern Civilization for RoN: T&P.

montero91@gmail.com

[This message has been edited by montero (edited 10-28-2005 @ 06:16 PM).]

AuthorReplies:
Coldwar Warrior
Member
posted 03-17-08 03:39 PM EDT (US)     76 / 135       
Go to modding library there's an article there that teaches you how to make new nations
iVisionStudios
Member
posted 06-17-08 02:55 PM EDT (US)     77 / 135       
Hey. I'm starting work on a Rise of Nations mod and I'm interested in making new skins for a particular faction. In this case, I want to make separate skins for the French.

I know had to edit standard skins, but I was wondering if it was possible to create coding to almost "redirect" the game to read the skins for the French units from different files.

How do I go about this?
Selim Yavuz
Member
posted 10-22-08 10:24 AM EDT (US)     78 / 135       
I would like to know how I could change it so the Romans can build each of their Unique Units an age earlier (Legions in Ancient, Caesar's Legions in Classical etc.). Also I want to know how I could add two new Unique Units, Condottieri in Gunpowder and Grantieri in Enlightenment. Any assistance would be greatly appreciated.
Chinson
Member
posted 03-04-09 02:38 PM EDT (US)     79 / 135       
hey help me please!!

I wanted to make the nuclear missiles a bigger splash, but now the missiles does not hurt Buildings. What did I wrong?

look her:

<UNIT>
<NAME>Nuclear ICBM</NAME>
<GRAPH>NUCLEARICBMMISSILE</GRAPH>
<OBJ_MASK>SBX32</OBJ_MASK>
<FLAGS></FLAGS>
<WHERE>Missile Silo</WHERE>
<ATTACK>100000</ATTACK>
<HITS>2</HITS>
<MOVES>115</MOVES>
<SUPPORT>75o/75k support</SUPPORT>
<COST>95k/11o</COST>
<JOB_TIME>800</JOB_TIME>
<PREQ0>Information Age</PREQ0>
<PREQ1>Selective Service</PREQ1>
<FROM>Nuclear Missile</FROM>
<JUMP>disable</JUMP>
<GRAFT>none</GRAFT>
<RANGE>0-99999rng</RANGE>
<LOS>1</LOS>
<SCIENCE_LOS>0</SCIENCE_LOS>
<FLY_HIGH>0</FLY_HIGH>
<FLY_LOW>0</FLY_LOW>
<RECHARGE>999</RECHARGE>
<ARMOR>0</ARMOR>
<DOMAIN>Air</DOMAIN>
<TO_HIT>300</TO_HIT>
<ATTENUATE>-3</ATTENUATE>
<CAT>Air</CAT>
<PROGRESSION>0</PROGRESSION>
<SPLASH>675</SPLASH>
<SPLASH_PERCENT>600</SPLASH_PERCENT>
<AMMO_PER_ATT>1</AMMO_PER_ATT>
<TURN_SPEED>9</TURN_SPEED>
<PROJ_SPEED>450</PROJ_SPEED>
<CARRY_SIZE>4</CARRY_SIZE>
<POP>1</POP>
<RESEARCH_PREMIUM_TIME>5</RESEARCH_PREMIUM_TIME>
<RESEARCH_PREMIUM_COST>3</RESEARCH_PREMIUM_COST>
<JOB_EXTRA_TIME>0/10tsx</JOB_EXTRA_TIME>
<MANA>950</MANA>
<TRIBE_MASK>111111111111111111111111</TRIBE_MASK> ;
<CARRY>0</CARRY>
<GUY_SPACING>25</GUY_SPACING>
<X_SPACING>25</X_SPACING>
<Y_SPACING>25</Y_SPACING>
<CIRCLE_RADIUS>3</CIRCLE_RADIUS>
<BLOCK_RADIUS>3</BLOCK_RADIUS>
<TARGET_SIZE>3</TARGET_SIZE>
<UBER_SIZE>1</UBER_SIZE>
<CREW_SIZE>0</CREW_SIZE>
<GRID_X>0</GRID_X>
<GRID_Y>0</GRID_Y>
<UPGRADE></UPGRADE>
<PUSH_SIZE>3</PUSH_SIZE>
<PUSH_CIRCLES>1</PUSH_CIRCLES>
<TYPENAME>Nuclear ICBM</TYPENAME>
</UNIT>
HuManBing
Member
posted 03-24-09 09:13 AM EDT (US)     80 / 135       
Thanks for the walkthrough - very informative.

I'm trying to mod an unused unit slot: the "Guerilla Infantry". But I don't know how to do the changes in the unitgraphics.xml and sound files. Do I just write in a new entry for them? Has anybody managed to mod those units into the game?



Edit: Ignore the above. I finally found out what was wrong with that approach. (Guerilla Infantry uses the same entry as "Infantry" in the unit_graphics.xml, so I'd have to make alterations to that entry.) The correct thing to do is to find an unused unit that has its own unique "graph" entry. I eventually decided on "Imperial Guard", an unused unit that is only ever activated for the Napoleon scenario.


I now have a separate problem. I followed all the instructions to put the new unit, Jiefangjun Infantry, over the Imperial Guard unit. I left the Graph and even the name the same. Instead, I changed the TYPENAME to Jiefangjun Infantry, and I altered the Assault Infantry entry to exclude China's tribemask from it.

I changed all the specs in the unit_graphics.xml to resemble the Shock Infantry entries (except for the TEX entries, which I left as the Imperial Guard because I wanted to redo the icon).

I've made changes to the help.xml, the soundtypes.xml, the unitrules.xml, and the unit_graphics.xml. I also left a mostly-blank info.xml in the correct folder.

When I load up the mod in solo play, it crashes and says:


UNKNOWN KEY 'IMPERIAL GUARD' OF TYPE: 'UNIT'

FILE TEXT: <LEFT, RANDOM, RANDOM, RANDOM, RANDOM, DOWN>

PRESS RETRY TO DEBUG



What does this mean and what am I doing wrong? I feel like I'm so close to getting this right, but the debugging program is no help at all, and there's always some little irritating thing that crashes the game.

To troubleshoot, I have restored the original unitrules.xml file in the relevant mod folder, and when I do this, the mod will load properly (although it crashes when I quit out of the game). Obviously there is no Jiefangjun unit, but this strongly suggests that whatever the problem is, it's with the unitrules.xml file.

I've uploaded the current (nonfunctional) state of the mod in a zip. If you have experience with these, please look at the zip and tell me what I've done wrong. I've preserved the subfolder structure too.

URL: http://www.geocities.com/enixine/JiefangjunInfantryTnP.zip

Thanks!

[This message has been edited by HuManBing (edited 03-24-2009 @ 09:25 PM).]

Gpayne31
Member
posted 04-25-09 01:55 AM EDT (US)     81 / 135       
I followed this guide to create a new unit(EXACTLY) and when I run RoN it gets to the loading screen and says

Cant read unitrules.xml

So i click ok and then it crashes and says:

# OF UNITTYPES IN UNITRULES.XML DOES NOT = NUM_UNITTYPES!

Click Retry to Debug...

And some button stuff after that. I tried restoring the files to the original but it still does it...
HuManBing
Member
posted 04-25-09 08:46 PM EDT (US)     82 / 135       
Are you overwriting a unit's entry?

Or are you writing a completely new entry?

The error message suggests that the game is finding that the number of unit entries is wrong.
kingtigertank
Member
posted 05-15-09 09:06 PM EDT (US)     83 / 135       
I've read your guide, but i have no idea how to change the name of the units. Please help. Thanks.
One_Dead_Angel
Seraph in Absentia
(id: One_Dead_Villy)
posted 05-24-09 00:16 AM EDT (US)     84 / 135       
Best way is to just experiment. RoN is a fairly forgiving and easy game as far as modding since its just a text file that is in plain english text for the most part. Just take the files that the modding guide mentions. Change one thing and see what happens in the game. Then chance it back and then change another parameter and see what happens. This is the only way to really learn the mod and how the expert RoN modders learned.

[This message has been edited by One_Dead_Angel (edited 05-24-2009 @ 00:20 AM).]

King of Worms
Member
posted 05-24-09 04:44 AM EDT (US)     85 / 135       
Hello everyone.

I used this guide (which is extremely helpful) but I have a problem.
My goal is to replace the Assault Marine unit with a modern age special forces unit that carries a browning automatic rifle (like modern age Marine Infantry unit carries). However the new unit has some errors, such as the two different types of rifles appear at once and some strange behavior.

What could I do to correct these problems?
How could I add a special forces unit that uses the browning automatic rifle instead of behaving as a sniper?

Any response or help is really appreciated.

By the way, I replaced the Assault Marine's model and art with that of the special forces unit as well as the animation.

[This message has been edited by King of Worms (edited 05-24-2009 @ 04:47 AM).]

lordliam
Member
posted 05-24-09 02:15 PM EDT (US)     86 / 135       
I really want to create new unit art, but does anyone know how to open the art files? It's all .bha, and I don't have a program that can! Thanks.
One_Dead_Angel
Seraph in Absentia
(id: One_Dead_Villy)
posted 05-24-09 10:43 PM EDT (US)     87 / 135       
You cant change the BHA files. They are animation files. You can change the appearance by changing the TGA files, and you just need photoshop or something similar to change that.
One_Dead_Angel
Seraph in Absentia
(id: One_Dead_Villy)
posted 05-24-09 10:45 PM EDT (US)     88 / 135       
You cant really change just the rifle on the units. you maybe able to paint over the rifle skins to make it look like another weapon but that doesnt usually look good. as for your other problem, just keep playing around with it
lordliam
Member
posted 05-25-09 00:38 AM EDT (US)     89 / 135       
GIMP works right? I hope it does, because photoshop = $$$$ and I don't have too much $$$$.
King of Worms
Member
posted 05-25-09 05:21 AM EDT (US)     90 / 135       
Ah okay.
Thanks for the input ODA
Soturi
Member
posted 07-04-09 07:06 AM EDT (US)     91 / 135       
Hi guys,
I've spend some time reading all yer usefull info (O.O)
and in the first post i read that to change a unit's name you just have to replace the name...
but when i checked the Data Folder and looked for Jaguar infantry ( i wanted to replace it with "Paracommando unit") but there i found the name "Jaguar infantry" 2 times
i just want to replace the name , not anything else about it. now it could also be the problem that i called it's upgrade "the jaguar assault infantry" a paracommando Trooper? but when i start the game it get's stuck when loading "pre-loading graphics"

<NAME>Jaguar Infantry</NAME> << should i change this?
<GRAPH>JAGINFANTRY</GRAPH> << don't change this, right?
<OBJ_MASK>IFG</OBJ_MASK>
<FLAGS>lmjiy</FLAGS>
<WHERE>Barracks</WHERE>
<ATTACK>25</ATTACK>
<HITS>171</HITS>
<MOVES>35</MOVES>
<SUPPORT>1t/1f support</SUPPORT>
<COST>8f/7t</COST>
<JOB_TIME>169</JOB_TIME>
<PREQ0>Modern Age</PREQ0>
<PREQ1>none</PREQ1>
<FROM>Riflemen</FROM>
<JUMP>Jaguar Assault Infantry</JUMP> << i want it to upgrade to a unit called Paracommando trooper , what shoud i do?

<GRAFT>Infantry</GRAFT>
<RANGE>0-13rng</RANGE>
<LOS>14</LOS>
<SCIENCE_LOS>0</SCIENCE_LOS>
<FLY_HIGH>0</FLY_HIGH>
<FLY_LOW>33%</FLY_LOW>
<RECHARGE>32</RECHARGE>
<ARMOR>5</ARMOR>
<DOMAIN>Land</DOMAIN>
<TO_HIT>300</TO_HIT>
<ATTENUATE>-4</ATTENUATE>
<CAT>Foot</CAT>
<PROGRESSION>3</PROGRESSION>
<SPLASH>0</SPLASH>
<SPLASH_PERCENT>100</SPLASH_PERCENT>
<AMMO_PER_ATT>1</AMMO_PER_ATT>
<TURN_SPEED>27</TURN_SPEED>
<PROJ_SPEED>450</PROJ_SPEED>
<CARRY_SIZE>2</CARRY_SIZE>
<POP>1</POP>
<RESEARCH_PREMIUM_TIME>2</RESEARCH_PREMIUM_TIME>
<RESEARCH_PREMIUM_COST>2</RESEARCH_PREMIUM_COST>
<JOB_EXTRA_TIME>1/10tsx</JOB_EXTRA_TIME>
<MANA>0</MANA>
<TRIBE_MASK>000000000000000001</TRIBE_MASK>
<CARRY>0</CARRY>
<GUY_SPACING>12</GUY_SPACING>
<X_SPACING>12</X_SPACING>
<Y_SPACING>12</Y_SPACING>
<CIRCLE_RADIUS>1</CIRCLE_RADIUS>
<BLOCK_RADIUS>1</BLOCK_RADIUS>
<TARGET_SIZE>3</TARGET_SIZE>
<UBER_SIZE>3</UBER_SIZE>
<CREW_SIZE>0</CREW_SIZE>
<GRID_X>0</GRID_X>
<GRID_Y>0</GRID_Y>
<UPGRADE/>
<PUSH_SIZE>1</PUSH_SIZE>
<PUSH_CIRCLES>1</PUSH_CIRCLES>
<TYPENAME>Jaguar Infantry</TYPENAME> << Change this?
</UNIT>
<UNIT>
Coldwar Warrior
Member
posted 07-06-09 11:46 AM EDT (US)     92 / 135       
Leave the jump alone, then on jaguar assaults change only the NAME.
hubhruhzni
Member
posted 09-05-09 09:35 AM EDT (US)     93 / 135       
How I Edit The Caravan Limits? I want to have lots and lots of than, but I can't find a MAX_CARAVAN_POP or caravnlimits or anything in this way, can you help me? what to change and were?

update: IDEA!!!!!!!!
What will happen if I will Take this line
<;COLOSSUS_CARAVAN value="0"/>;
Edit it to
<;LIBRARY_CARAVAN value="1000"/>; Or
<;MARKET_CARAVAN value="1000"/>;
will it work?
does eveytime I will Build A Library or a market I will get a 1000 Caravans?

[This message has been edited by hubhruhzni (edited 09-05-2009 @ 09:54 AM).]

Simon1
Member
posted 09-05-09 01:25 PM EDT (US)     94 / 135       
Hub, it doesn't work that way. Raising the caravan limit doesn't seem to be possible

My RON modding youtube account.
http://www.youtube.com/user/RoNModding
Wadis10
Member
posted 09-05-09 11:39 PM EDT (US)     95 / 135       
You can only raise the caravan limit by increasing it on wonders and rare resources in rules.xml.
sargonthegreat
Member
posted 09-06-09 11:56 PM EDT (US)     96 / 135       
Simon and Wadis are correct.

I've just searched through the XML, and it seems that there are no specific areas where you can mod Caravan Limit, which means that it must be hard-coded into the game.
KlauSpinnaker
Member
posted 12-18-09 09:12 PM EDT (US)     97 / 135       
the german howitzers in modern age have a different design but the same stats as the normal howitzers. is it possible for me to just add another separate section for it under soundtypes.xml & hepl.xml?

Boom. Rush. Surge.
bins16
Member
posted 02-09-10 09:34 PM EDT (US)     98 / 135       
How do you edit the country codes like :000000000000000000000001
KlauSpinnaker
Member
posted 02-16-10 08:45 PM EDT (US)     99 / 135       
bins:
the numbers show which nations get that specific unit (0 means they don't get that unit, 1 means they do)
for example, if u want a unit to be available to the persians & dutch ONLY, u would set both nations' markers to 1, and change every other nation's marker to 0, so it looks like this:
110000000000000000000000
a list of which markers represent which nation is on the modding instructions at the top

Boom. Rush. Surge.
yoshiboo
Member
posted 04-28-10 07:38 AM EDT (US)     100 / 135       
Hi, I've been doing some of my own modding, I was wondering do you know of anyway to make units able to carry other units?
« Previous Page  1 2 3 4 5 6  Next Page »
You must be logged in to post messages.
Please login or register

Hop to:    

Rise of Nations Heaven | HeavenGames