Kwen
|
Category: |
Code |
Level: |
Intermediate
|
Created: |
Wednesday August 26, 2009 - 18:41 |
Updated: |
Wednesday August 26, 2009 - 18:47 |
Views: |
6421 |
Summary: |
Explains how to add toggling formations to your hordes. |
|
Rating
Staff says
3.0
|
Members say
4.0
|
Average
3.6/5.0
|
5 votes
|
Formations are very common throughout bfme. They allow for differing positions of your units to give them a tactical advantage in certain situations.
Of course you know how these work if you play the game at all. But coding them in can be a trick.
In this tutorial I will explain how to add the porcupine formation to MordorPikeman (A new unit I added. Basically just a re-named Uruk Pikeman.) This is assuming you know the basics and be fully able to code in a functional Unit and Horde.
To do so you will have to edit the following files:
CommandSet.ini
MordorPikemanHorde.ini
The first thing you'll have to do is make absolutely sure your horde works to its fullest prior to doing this.
Then open evilfactionhordes.ini, Find IsengardPikemanHorde.
At the bottom of the horde you'll find this:
Code |
ChildObject IsengardPikemanHordePorcupine IsengardPikemanHorde
; Note - for alternate formations, all info outside of the Contain Behavior module is ignored.
; Any modifications need to be done via the Attribute Modifiers in the contain module.
Behavior = HordeContain ModuleTag_HordeContain
ObjectStatusOfContained =
InitialPayload = IsengardPikeman 10
Slots = 10
PassengerFilter = NONE +INFANTRY
ShowPips = No
ThisFormationIsTheMainFormation = No ;Used to determine which armorset to use (and anything else we want!)
; Banner Carrier info
;BannerCarriersAllowed = IsengardBannerOrc ; types of units that are allowed as banner carriers
;BannerCarrierPosition = UnitType:IsengardPikeman Pos:X:15.0 Y:0.0 ; (DEFAULT) position of banner carrier for fighter horde
BannerCarriersAllowed = IsengardBannerOrc ; types of units that are allowed as banner carriers
BannerCarrierPosition = UnitType:IsengardBannerOrc Pos:X:27.0 Y:5.0 ; (DEFAULT) position of banner carrier for fighter horde
RankInfo = RankNumber:1 UnitType:IsengardPikeman Position:X:22 Y:-32 Position:X:22 Y:-10 Position:X:22 Y:10 Position:X:22 Y:32
RankInfo = RankNumber:2 UnitType:IsengardPikeman Position:X:2 Y:-32 Position:X:2 Y:-10 Position:X:2 Y:10 Position:X:2 Y:32
RankInfo = RankNumber:3 UnitType:IsengardPikeman Position:X:-22 Y:-10 Position:X:-22 Y:10
ComboHorde = Target:IsengardFighterHorde Result:IsengardFighterPikemanComboHorde InitiateVoice:UrukPikemanVoiceJoinAnybody
ComboHorde = Target:IsengardFighterHordeBlock Result:IsengardFighterPikemanComboHorde InitiateVoice:UrukPikemanVoiceJoinAnybody
ComboHorde = Target:IsengardUrukCrossbowHorde Result:IsengardCrossbowPikemanComboHorde InitiateVoice:UrukPikemanVoiceJoinAnybody
ComboHorde = Target:IsengardUrukCrossbowHordeWedgeFormation Result:IsengardCrossbowPikemanComboHorde InitiateVoice:UrukPikemanVoiceJoinAnybody
AlternateFormation = IsengardPikemanHorde
AttributeModifiers = IsengardPikemanHordePorcupineBonus
UsePorcupineBody = Yes
UseSlowHordeMovement = Yes
End
End
|
This is a childobject of the original horde, but in a different arrangement, with a different speed, and with different stats. The rest is the same.
Copy this and put it at the bottom of MordorPikemanHorde.
Now, a lot of name changing. Use a find/replace to change all IsengardPikeman to MordorPikeman
(Do not change "AttributeModifiers = IsengardPikemanHordePorcupineBonus" unless you plan to make the bonus different.)
Essentially in the childobject, change all Isengard to Mordor. It should now look like:
Code |
ChildObject MordorPikemanHordePorcupine MordorPikemanHorde ;(Must be the name of the original Horde.)
; Note - for alternate formations, all info outside of the Contain Behavior module is ignored.
; Any modifications need to be done via the Attribute Modifiers in the contain module.
Behavior = HordeContain ModuleTag_HordeContain
ObjectStatusOfContained =
InitialPayload = MordorPikeman 10
Slots = 10
PassengerFilter = NONE +INFANTRY
ShowPips = No
ThisFormationIsTheMainFormation = No ;Used to determine which armorset to use (and anything else we want!)
; Banner Carrier info
;BannerCarriersAllowed = MordorBannerOrc ; types of units that are allowed as banner carriers
;BannerCarrierPosition = UnitType:MordorPikeman Pos:X:15.0 Y:0.0 ; (DEFAULT) position of banner carrier for fighter horde
BannerCarriersAllowed = MordorBannerOrc ; types of units that are allowed as banner carriers
BannerCarrierPosition = UnitType:MordorBannerOrc Pos:X:27.0 Y:5.0 ; (DEFAULT) position of banner carrier for fighter horde
RankInfo = RankNumber:1 UnitType:MordorPikeman Position:X:22 Y:-32 Position:X:22 Y:-10 Position:X:22 Y:10 Position:X:22 Y:32
RankInfo = RankNumber:2 UnitType:MordorPikeman Position:X:2 Y:-32 Position:X:2 Y:-10 Position:X:2 Y:10 Position:X:2 Y:32
RankInfo = RankNumber:3 UnitType:MordorPikeman Position:X:-22 Y:-10 Position:X:-22 Y:10
;(Comment these out. They define combo-hordes.)
; ComboHorde = Target:IsengardFighterHorde Result:IsengardFighterPikemanComboHorde InitiateVoice:UrukPikemanVoiceJoinAnybody
; ComboHorde = Target:IsengardFighterHordeBlock Result:IsengardFighterPikemanComboHorde InitiateVoice:UrukPikemanVoiceJoinAnybody
; ComboHorde = Target:IsengardUrukCrossbowHorde Result:IsengardCrossbowPikemanComboHorde InitiateVoice:UrukPikemanVoiceJoinAnybody
; ComboHorde = Target:IsengardUrukCrossbowHordeWedgeFormation Result:IsengardCrossbowPikemanComboHorde InitiateVoice:UrukPikemanVoiceJoinAnybody
AlternateFormation = MordorPikemanHorde
AttributeModifiers = IsengardPikemanHordePorcupineBonus
UsePorcupineBody = Yes
UseSlowHordeMovement = Yes
End
End
|
Make sure this line states: "AlternateFormation = MordorPikemanHorde"
Now, in the MordorPikemanHorde make sure the alternate formation states: "AlternateFormation = MordorPikemanHordePorcupine"
This is important so the code will recognize that the two are interchangeable.
Now. The coding in the Horde code is done.
Open up CommandSet.ini
Find CommandSet IsengardPikemanHordeCommandSet
Copy the line 2 = Command_ToggleFormationPikeman
Add it to MordorPikemanHordeCommandSet.
Now, test.
There you go. Your Unit should now be able to toggle formation.