logo   login
right
Home Forums Downloads Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Forum Info
Forum Members: 18,613
Total Threads: 8,704
Posts: 94,969

Administrators:
DeeZire, Redemption

There are currently 51 users online.
Partner Links

Free Credit Repair

Learn the Ticket Broker Secrets
Advertisements


Generals & Zero Hour Editing Discuss any modding related issues to do with Generals and Zero Hour here.

Reply
 
LinkBack Thread Tools
Old 02-20-2003, 08:56 AM   #1 (permalink)
Administrator
 
DeeZire's Avatar
 
Join Date: Dec 2002
Posts: 1,913
Send a message via ICQ to DeeZire
Default The Basics Of Unit Editing - CAMEOS

I'll go ahead and cover the basic elements of editing a unit via INI files here, to eliminate any confusion at early stages.

First off, a very basic principle to understand - forget everything you learned in TS and/or RA2. Generals' engine is almost entirely object orientated. In plain terms, that means that theres no such thing as a 'building' or an 'aircraft' or a 'vehicle' or an 'infantry' or even a 'tree'. Everything in Generals is simply an 'object'.

In TS or RA2, you defined the behavioural characteristics of things with 'tags' or 'statements'. In Generals, all objects are defined by 'modules' instead. Each module does a specific job. So instead of using Primary=A_WEAPON, in Generals theres a module to define an objects weapons. Theres another module for armor and so on.

What this means is that there is enormous flexiblity in the engine as most modules can be used on any object although there are some logical restrictions where certain modules cant be used in conjunction with others. In plainer terms, imagine being able to make a VehicleType work with Carryall=yes set insetad of it being restricted to an AircraftType and you have some idea of what can be done.

Take a look at at any unit in FactionUnit.INI and you'll see they are made up of a section that all follow the same convention;-
Code:
Object [objectname]
...
End
Simple enough isnt it? Well yes, but theres all kinds of stuff that has to go in there. Its important to understand that every module you stick in this section gets nested properly - in other words, every module has to be opened (by using the name of the module) and closed (by using the End statement).

First things first, we'll use the Marauder Tank (I kinda like that unit hehe) so we need to tell the game how our unit gets displayed. This is done by the Art Parameters, which effectively are like the ART.INI settings from TS and RA2 except better.

You can first define the basic art stuff like its cameo. Every object needs 2 cameos specifying - a large one for when it is selected (this one appears on the right of the control bar) and a small one to use for building it etc (i.e. your traditional cameo). As a tip, you only really need to make the large one - the game will auto-resize it to be small if necessary. However, I dont recommend doing this as the code that resizes it is primitive and exists only as a debug tool to prevent the old 'Missing Cameo' problem. The result is usually a poorer quality scaled down version of the larger one, so do it yourself for better results. Specify your cameos like this;-
Code:
SelectPortrait = SUMarauder_L
ButtonImage = SUMarauder
SelectPortrait= is the one used when its selected (duh) and is the bigger image, and the small one is its button (or true cameo). If you set both of those images to SUMarauder_L, the big one will get resized and used for the small image. Nice. The game even turns them into black & white and highlights them automatically so you dont even need to make different versions. Nicer.

Where do those names come from? Simple. Every single 2D image in the game, no matter how/where its used, comes from a Mapped Image. Mapped Images are ones which are taken from a 'texture page'. A texture page in Generals is a 512x512 24-bit color TrueVision Targa image with no alpha (if you use alpha you get weird effects when cameos are drawn). Each texture page contains one or more seperate images, including cameos, menu images etc etc. Each time you want to use a cameo, you have to tell the game which image you want, and then from which Mapped Image to fetch it. All of these texture pages can be found in Textures.big, so you can extract and edit them in your decent image editing program.

To specify the cameo, and whereabouts to get it from, you need a Mapped Image INI file. Every mapped image has a corrosponding INI file, and that file tells the game (i) which mapped image it defines and (ii) which images are contained in it as well as whereabouts they are.

Going back to our Marauder example, we need to find SUMarauder_L and SUMarauder, so its worth talking about Generals naming convention here.

Like TS and RA2, theres a global file naming convention that makes life easier for us. The convention applies to all 2D images for all objects and works like this;-

SYname_E

'Y' can be;-

A = America
N = China
U= GLA
C = abilities (like fire weapon etc)
S = science (like super weapons etc)
_E = optional and is usually _L for the larger image. _D, _H and _P are no longer needed as the game creates the effects for Disabled, Highlighted and Pushed automatically.

So, SUMarauder_L is a GLA image called Marauder_L. That will appear therefore in the SUUserInterface512.INI file - got it? Keep the naming convention consistent. In that file, you will find the SUMarauder_L entry;-
Code:
MappedImage SUMarauder_L
  Texture = SUUserInterface512_002.tga
  TextureWidth = 512
  TextureHeight = 512
  Coords = Left:1 Top:1 Right:121 Bottom:97
  Status = NONE
End
Logically, it specifies the SUUserInterface512_n.tga file - as this is the SUUserInterface512.INI file. Remember, one INI file controlling all the images for one thing. This one controls all the SUUserInterface ones.

Open SUUserInterface512_002.tga in your image editing program and youll see all the cameos. Move the mouse about, and keep an eye on the co-ordinates on screen. The Coords= tag above tells the game whereabouts in that image the cameo is located (in this case wheres SUMarauder_L). Together, the coords specify the top-left and bottom-right of the image (so it can use that info to pull the image and also to resize it if nesc).

You can copy that bit of the mapped image out, edit it, and put it back in if you like to change the cameo. Just keep the size and location the same. Its much easier to make your own though, so make a new .tga format image, 512x512 pixels in size with 24-bit color, and stick your cameo somewhere on it. Make a note of the top-left and bottom-right coords of your cameo, and use them to define its location. You can then make a new mapped image INI file that tells the game all about your cameo.

Save your .tga file, and make sure to specify no compression and no alpha. Call it SXUserInterface512_001.tga for simplicty sake. Then make a new INI file called SXUserInterface512.INI and put this entry in for your cameo (Im calling the cameo SUGLATank_L);-
Code:
MappedImage SUGLATank_L
  Texture = SXUserInterface512_001.tga
  TextureWidth = 512
  TextureHeight = 512
  Coords = Left:x Top:y Right:x Bottom:y
  Status = NONE
End
Remember to put the coords in - i.e. whereabouts the cameo is in the mapped image itself otherwise the game wont be able to find it! Finally, you put your new mapped image .tga file in Art\Textures and your new INI file in Data\INI\MappedImages\TextureSize_512.

To recap;-

- make sure you specify which cameo to use in your units definition in FactionUnit.INI (or for your building, in FactionBuilding.INI);
- make sure you have made the cameo in a new .tga image file which is 512x512 in size and 24-bit color depth, with no alpha and no compression;
- make sure that .tga file has a corrosponding INI file which tells the game where your cameo is in that .tga mapped image file;
- make sure that INI file has the appropriate entry thats called for by your unit/building.

There you have it - the very very basics of cameo editing. Not half as simple as RA2 but a lot better and a lot more flexible.

EDIT: my housemate just followed that, heres his result, and if he can do it then anybody can
DeeZire is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-20-2003, 09:15 AM   #2 (permalink)
Senior Member
 
Join Date: Sep 2001
Posts: 734
Send a message via ICQ to Flyby
Default

I just realized that we badly need a texteditor that allows programmable syntax highlighting. It would make reading these ini files MUCH easier !!

f.e.

MappedImage SUMarauder_L Texture = SUUserInterface512_002.tga
TextureWidth = 512
TextureHeight = 512
Coords = Left:1 Top:1 Right:121 Bottom:97
Status = NONE
End

By programmable , i mean the ability to compose a list of all important tags...

Maybe Koen or Olaf are aware of such a freeware tool ?
Flyby is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-20-2003, 10:31 AM   #3 (permalink)
Member
 
Join Date: Feb 2003
Location: Holland
Posts: 30
Default

aye, yeh!
thnx deez; this should be able to even get me started
next week: vacation, gonna take a look in this "stuff" then.
Avelcaine is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-20-2003, 04:17 PM   #4 (permalink)
Senior Member
 
Join Date: Dec 2002
Location: UK, England
Posts: 178
Send a message via ICQ to FoxMcCloud Send a message via MSN to FoxMcCloud
Default

Quote:
Originally Posted by Flyby
I just realized that we badly need a texteditor that allows programmable syntax highlighting. It would make reading these ini files MUCH easier !!

f.e.

MappedImage SUMarauder_L Texture = SUUserInterface512_002.tga
TextureWidth = 512
TextureHeight = 512
Coords = Left:1 Top:1 Right:121 Bottom:97
Status = NONE
End

By programmable , i mean the ability to compose a list of all important tags...

Maybe Koen or Olaf are aware of such a freeware tool ?
I know its not exactly what you wanted, but someone has released an INI Reader, runs from tags and what not.

http://www.generalsfiles.com/file.info?ID=10713
FoxMcCloud is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-20-2003, 04:54 PM   #5 (permalink)
Senior Member
 
Join Date: Jan 2003
Location: Netherlands
Posts: 206
Default

... that utility seems to allow easy browsing.
There are multiple editors out there which allow you to define keywords.. UltraEdit, EditPlus? I can post a list of keywords which cover most Ini files (object starting keywords).
Koen is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-21-2003, 02:52 AM   #6 (permalink)
Senior Member
 
Join Date: Sep 2001
Posts: 734
Send a message via ICQ to Flyby
Default

Quote:
Originally Posted by Koen
... that utility seems to allow easy browsing.
There are multiple editors out there which allow you to define keywords.. UltraEdit, EditPlus? I can post a list of keywords which cover most Ini files (object starting keywords).
In my search i stumbled upon Ultraedit, which seems to do exactly what is needed, but it isn't freeware..... :/
Flyby is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-21-2003, 05:13 AM   #7 (permalink)
Senior Member
 
Join Date: Jan 2003
Location: Netherlands
Posts: 206
Default

Quote:
Originally Posted by Flyby
In my search i stumbled upon Ultraedit, which seems to do exactly what is needed, but it isn't freeware..... :/
http://cedit.sourceforge.net/ contains cEdit... I found it on Google, haven't tested it myself. But it looks nice from the screenshots...
Koen is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-21-2003, 06:17 AM   #8 (permalink)
Senior Member
 
Join Date: Sep 2001
Posts: 734
Send a message via ICQ to Flyby
Default

Quote:
Originally Posted by Koen
Quote:
Originally Posted by Flyby
In my search i stumbled upon Ultraedit, which seems to do exactly what is needed, but it isn't freeware..... :/
http://cedit.sourceforge.net/ contains cEdit... I found it on Google, haven't tested it myself. But it looks nice from the screenshots...
EXCELLENT find, Koen !!
I also used googles, but this one slipped through my search... :S

I'l start making a Generals languages defination.
This is going to rock ! :drunk:
Flyby is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-21-2003, 06:41 AM   #9 (permalink)
Senior Member
 
Join Date: Jan 2003
Location: Netherlands
Posts: 206
Default

Here are some of the keywords... Perhaps you can tell me whether it's all of them?

Level 0: (toplevel):
AIData,Animation,Armor,AudioSettings,Campaign,Comm andButton,CommandMap,CommandSet,ControlBarResizer, ControlBarScheme,CrateData,Object,
DamageFX,DrawGroupInfo,EvaEvent,FXList,GameData,St aticGameLOD,DynamicGameLOD,InGameUI,Locomotor,Misc Audio,Mouse,MouseCursor,
OnlineChatColors,MultiplayerSettings,MultiplayerCo lor,MusicTrack,ObjectCreationList,ParticleSystem,P layerTemplate,Rank,Road,Bridge,Science,
ShellMenuScheme,AudioEvent,SpecialPower,DialogEven t,Terrain,Upgrade,Video,WaterSet,Weapon,WebpageURL ,ButtonSet,MappedImage,ObjectReskin

Level 1 (all other levels):
Mission,ImagePart,AnimatingPart,Draw,Behavior,Side Sounds,ParticleSystem,Sound,ViewShake,TerrainScorc h,LightPulse,Tracer,FXListAtBonePos,
AttackDamageAreaRadiusCursor,AttackScatterAreaRadi usCursor,GuardAreaRadiusCursor,FriendlySpecialPowe rRadiusCursor,AttackContinueAreaRadiusCursor,
OffensiveSpecialPowerRadiusCursor,CreateDebris,Cre ateObject,ApplyRandomForce,DeliverPayload,FireWeap on,Attack,SideInfo,SkirmishBuildList,
WeaponSet,ArmorSet,UnitSpecificSounds,Body,Inherit ableModule,ClientUpdate,Prerequisites,UnitSpecific FX,DefaultConditionState,DeliveryDecal,
SkillSet1,SkillSet2,SkillSet3,SkillSet4,SkillSet5, Structure,ConditionState,Turret,TransitionState,Gr idDecalTemplate
Koen is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generals/zero hour Unit/building editing NEED HELP! Leutian Generals & Zero Hour Editing 17 07-10-2006 08:44 PM
The Basics... EchoMods.com Generals & Zero Hour Editing 24 01-08-2006 12:44 PM
Addon basics? ZombyDragon Red Alert 2 & Yuri's Revenge Editing 17 02-01-2004 10:10 AM
Super Modding Noob needs map.ini basics sYcknYss Generals & Zero Hour Editing 2 10-23-2003 04:08 PM
Does anybody know where I can get the basics of modding? sonofabandit Red Alert 2 & Yuri's Revenge Editing 21 07-15-2003 04:57 AM


All times are GMT -4. The time now is 07:48 PM.


Design By: Miner Skinz.com
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.