Project Perfect Mod

Home   Forum   Site Menu   C&C 1: Tiberian Dawn   C&C Red Alert 1   C&C 2: Tiberian Sun   C&C: Red Alert 2   C&C Renegade   C&C: Generals   C&C 3: Tiberium Wars   C&C: Red Alert 3   C&C 4: Tiberian Twilight   Fallout 3   OpenRA   Starcraft 1   Starcraft 2   Warcraft 3   Editing Tools   PPM Network   Affiliates   Community Links   Official Game Links   Browse Classic Site



Upgrades Continued: An introduction to modules [ZH]
January 21, 2009 - 00:11


Requirements:  A basic understanding of modding generals, and prior work in adding new units and crating upgrades.

Step 1 Creating the upgrade:  If you have not already, read this tutorial (http://www.ppmsite.com/forum/viewtopic.php?t=21740) and create an upgrade of some sort.  Create a button for it and add it some CommandSet that you will be able to access in game.

Step 2 Intro to modules:  Modules are the things in generals which allow units to follow certain behaviors that normal units won’t follow, such as switching weapons, upgrading armour, and a whole slew of things.  However, for this tutorial, I will focus in on some of the common modules used in unit upgrades.  Modules are in the entry of the unit you want to receive the upgrade, and are usually found toward the end of the entry under “Engineering Parameters”.  Each module has a number assigned to it and they must be unique within each object.  Lets look at a basic upgrade for the humvee:

 Behavior = WeaponSetUpgrade ModuleTag_09
   TriggeredBy = Upgrade_AmericaTOWMissile
 End

This module grants the humvee tow missiles.  Or actually it switches the humvee’s weapon set after the tow missile upgrade has been purchased.  Let’s dissect the entry.  The first line contains two important parts.  The first one is the “Behavior =“ which dictates what kind of module it is.  In this case it is “WeaponSetUpgrade” which clearly states what it does*.  The second part of the first line is the modules number.  Just make sure for the given object that no two modules have the same number.  The second line is very important, because it lists the upgrade which is trigger for the module.  Finally the entry is ended with End (how appropriate).  So you got Upgrade, your module, and now what?  It varies according from module to module, but since this one upgrades the weapon set, we have to make sure there is a new weapon set.  With the Humvee there is (duh) but supposing you made a new unit you would have to add one.  What you would do is copy the original weapon set and change the condition from none to PLAYER_UPGRADE.  This tells the game to use this weapon set when the unit is upgraded.  So you mod the new weapon set anyway you see fit.

Another common module is the armor upgrade.  However, instead of changing the armorset, this just adds more health.

 Behavior = MaxHealthUpgrade ModuleTag_09
   TriggeredBy   = Upgrade_AmericaCompositeArmor
   AddMaxHealth  = 100.0
   ChangeType    = ADD_CURRENT_HEALTH_TOO
 End
A very interesting module is the replace object module.  This can be used for a number of things ranging from a GLA hole upgrading itself to a building or even an MCV deploying into a ConYard.

 Behavior = ReplaceObjectUpgrade ModuleTag_12
   ReplaceObject = GLACommandCenter
   TriggeredBy = Upgrade_BecomeRealGLACommandCenter
 End

Well, that concludes this lesson.  The best way to learn more is to experiment!

* do not know of all of the behaviors, but I will try to make a list of them for reference.

Posted by DaFool
Comments (2)



eXTReMe Tracker