[en] - Modding Corner > Coding

Coding in Edain 4.00

<< < (20/23) > >>

DrHouse93:
I'm trying to give to Mordor Archers their fire arrows, but granted by another upgrade (in this case, IsengardFireArrows, since the Mordor one doesn't work on the mission map I'm working on even if I put an Arsenal with the Influence of Sauron out-of-map). This is the code I'm using, which grants to Mordor Archers the visual effect only, but not the actual upgrade:

--- Code: ---Object MordorArcher

  ;------------- Fire arrow upgrade ----------------
  ReplaceModule ModuleTag_Fire
    Behavior         = WeaponSetUpgrade ModuleTag_FireNEW
        TriggeredBy     = Upgrade_IsengardFireArrows
    End
  End

  ReplaceModule FireArrows_Upgrade
      Behavior         = SubObjectsUpgrade FireArrows_UpgradeNEW
          TriggeredBy    = Upgrade_IsengardFireArrows
          ShowSubObjects    = ARROWFIRE
          HideSubObjects    = arrrow
      End
  End

End

Object MordorArcherHorde

  CommandSet = MordorArcherHordeCommandSet_EvilFordsOfIsen
  ReplaceModule ModuleTag_BasicTraining
    Behavior = LevelUpUpgrade ModuleTag_BasicTraining_EvilFordsOfIsen
        TriggeredBy = Upgrade_IsengardBasicTraining
        LevelsToGain = 1
        LevelCap = 2
    End
  End

  ReplaceModule ModuleTag_HordeContain
    Behavior = HordeContain ModuleTag_HordeContain_EvilFordsOfIsen
        FrontAngle         = FRONT_ANGLE_ARCHER
        FlankedDelay         = FLANKED_DELAY_ARCHER
        ObjectStatusOfContained =
        InitialPayload         = MordorArcher 20
        Slots             = 20
        PassengerFilter     = ANY +INFANTRY +BANNER
        ShowPips         = No
        RandomOffset = X:3 Y:3   
        MeleeBehavior         = Amoeba
        End
               
        BannerCarriersAllowed = IsengardGasthausBannerOrc        ; types of units that are allowed as banner carriers
        BannerCarrierPosition = UnitType:MordorArcher Pos:X:55.0 Y:0.0
       
        RankInfo = RankNumber:1 UnitType:MordorArcher Position:X:35 Y:0              Position:X:30 Y:25              Position:X:30 Y:-25              Position:X:40 Y:40              Position:X:40 Y:-40
        RankInfo = RankNumber:2 UnitType:MordorArcher Position:X:15 Y:0 Leader 1 0   Position:X:10 Y:20 Leader 1 1   Position:X:10 Y:-20 Leader 1 2   Position:X:15 Y:40 Leader 1 3   Position:X:15 Y:-40 Leader 1 4
        RankInfo = RankNumber:3 UnitType:MordorArcher Position:X:-5 Y:0 Leader 2 0   Position:X:-10 Y:20 Leader 2 1  Position:X:-10 Y:-20 Leader 2 2  Position:X:0 Y:40 Leader 2 3    Position:X:0 Y:-40 Leader 2 4
        RankInfo = RankNumber:4 UnitType:MordorArcher Position:X:-25 Y:0 Leader 3 0  Position:X:-30 Y:25 Leader 3 1  Position:X:-30 Y:-25 Leader 3 2  Position:X:-15 Y:40 Leader 3 3  Position:X:-20 Y:-38 Leader 3 4

        ; Normal Formations
        ;ComboHorde = Target:MordorAufseherHorde             Result:MordorAufseherArcherHordeComboHorde        InitiateVoice:OrcFighterVoiceJoinAnybody

        RanksToReleaseWhenAttacking = 1 2 3 4
        MeleeAttackLeashDistance  = 1   //How far the hordes    can    move from the center of    the    horde when melee attacking.                 
        BackUpMinDelayTime        = 1    //The minimum amount of    time to    delay before backing up
        BackUpMaxDelayTime        = 3000    //The maximum amount of    time to    delay before backing up
        BackUpMinDistance         = 1    //The minimum number of    cells to backup
        BackUpMaxDistance         = 3    //The maximum number of    cells to backup
        BackupPercentage          = 80%    //The amount of    chance that    a unit will    back up.
    End
  End

  AutoResolveWeapon
        RequiredUpgrades = Upgrade_IsengardFireArrows
        Weapon = AutoResolve_MordorArcherUpgradedWeapon
  End

  AutoResolveWeapon
        ExcludedUpgrades = Upgrade_IsengardFireArrows
        Weapon = AutoResolve_MordorArcherWeapon
  End

End
--- Ende Code ---

What am I getting wrong?
(Also, I've being already capable of giving them the Isengard banner, rather than the Mordor one, so I really don't understand why it's not working for Fire arrows)

FG15:
The problem is that the WeaponSetUpgrade  is just a fake one, which has no effect. The actual effect of the fire arrow upgrade is defined in the weapon itself, which can't be changed.

My suggestion would be to just grant the unit the normal upgrade when it gets your upgrade.

DrHouse93:
Damn, I hate these stupid engine limitations >_>
Btw, I tried also in a different way. I used a code on the map like this:


--- Code: ---* IF *
Player_1 has purchased the upgrade Upgrade_TechnologyMordorFireArrows
* THEN *
Give unit "Arsenal" (An actual Arsenal of Mordor placed out-of-map) this upgrade "Upgrade_PlantShield" (which should be the upgrade granted to it by the Influence of Sauron, thus unlocking Fire arrows for Orc Archers)
--- Ende Code ---

However, that doesn't work, as well. The faction set to be used is Isengard, maybe that is the reason?

DrHouse93:
How can I make a building's rubble to stay on the battlefield when they're supposed to vanish? (so the player can click on it and rebuild the building)

EXAMPLE:

I've managed to use the Gondor Border Stronghold as a citadel for a map I'm working on. However, once destroyed, you can't rebuild it. How can I make its rubble stay on the battlefield (like for Helm's Deep's Arcade, or Minas Tirith's Citadel), rather than disappearing? (so the player can click on it and rebuild the fortress)

EDIT: I tried with:

--- Zitat ---ReplaceModule ModuleTag_08
    Behavior                  = StructureCollapseUpdate ModuleTag_08NEW
        MinCollapseDelay        = 000
        MaxCollapseDelay        = 000
        CollapseDamping         = .5
        MaxShudder              = 0.6
        MinBurstDelay           = 250
        MaxBurstDelay           = 800
        BigBurstFrequency       = 4
        FXList                  = INITIAL   FX_FortressCollapse
        ;FXList                  = ALMOST_FINAL  FX_FortressCollapse
        DestroyObjectWhenDone    = No  #It was 'Yes' originally
        CollapseHeight            = 155
    End
  End

  AddModule
    Behavior = KeepObjectDie ModuleTag_IWantRubble
      DeathTypes = ALL
    End
  End
--- Ende Zitat ---

but it didn't work

Glorfindel23:
Edited*

Hi, I've a problem with the fire arrow upgrade :
When I make the fire arrow of a faction granted by the upgrade fire arrow of another faction the damage upgrade and the fire on the arrow working but not the annimation, the units continue to shoot normal arrow.
(I've seen the post above but this is not the same problem)

Can you help me please, this is my code :

--- Zitat ---Object ElvenLorienArcher

ReplaceModule ModuleTag_WeaponSetUpgra deTag
    Behavior = WeaponSetUpgrade ModuleTag_WeaponSetUpgra deTagMithlond
        TriggeredBy = Upgrade_BruchtalFireArro ws
        CustomAnimAndDuration   = AnimState:USER_4 AnimTime:0 TriggerTime:0
    End
End
ReplaceModule ModuleTag_FireArrowSwapU pgrade
    Behavior = SubObjectsUpgrade ModuleTag_FireArrowSwapU pgradeMithlond
        TriggeredBy       = Upgrade_BruchtalFireArro ws
        ShowSubObjects    = FireArowTip
    End
End

End

Object ElvenLorienArcherHorde
CommandSet = ElvenLorienArcherHordeCo mmandSet_EdainNew

ReplaceModule ModuleTag_ProductionLega lity3
    Behavior = StatusBitsUpgrade ModuleTag_ProductionLega lity3New
        TriggeredBy = Upgrade_BruchtalFireArro ws
    End
End

End

CommandSet ElvenLorienArcherHordeCo mmandSet_EdainNew
   1    = Command_ToggleStance   
        2       = Command_SpecialAbilityGr enzwächterPatrouille
        3       = Command_PurchaseUpgradeB ruchtalFireArrows
        4       = Command_SpecialAbilityLe mbasbrotPassive
   5   = Command_PurchaseUpgradeB ruchtalHeavyArmor   
   12    = Command_CaptureBuilding
   13    = Command_AttackMove
   14    = Command_Stop
   16     = Command_SetStanceBattle
   17     = Command_SetStanceAggress ive
   18     = Command_SetStanceHoldGro und
End


--- Ende Zitat ---


And also, how can I delete the banner carrier of a unit ?

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln