Posted: Tue Jan 20, 2009 11:11 pm Post subject:
Upgrades Continued: An introduction to modules [ZH]
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.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum