Jump to content


Photo

Spawned Units Do Not Disappear

summon spawnedunits

Best Answer Jokuc, 05 July 2019 - 12:25 AM

I am not very familiar with RotWK so I don't know these units, but it looks like you just forgot or missed to add the properties to the actual horde member object.

 

When you set CommandPoints = 0 on a Horde it just means the horde will cost 0 commandpoints to recruit. You need to set the number of CP each member of the horde takes up. For example if your horde has 10 members and you want the CP number to be 30 you set the CP of its members to 3. As for the units not disappearing it's most likely cause the member objects don't have the LifetimeUpdate module. As the commented part will tell you if you read them:

"// This one displays the timer, but the one in the unit does the work"

 

Just make a child object like so:

ChildObject NoldorWarrior_Summoned NoldorWarrior
    CommandPoints = 0

    Behavior = LifetimeUpdate ModuleTag_LifetimeUpdate
        MinLifetime        = DUNEDAIN_ALLIES_LIFETIME
        MaxLifetime        = DUNEDAIN_ALLIES_LIFETIME
        DeathType        = FADED
    End  
END

(note, I don't know if "NoldonWarrior" is the exact name for the member object, it is just an assumption)

 

Then you will have to replace the member object used in ChildObject NoldorWarriorHorde_Summoned (which right now probably is just the normal NoldorWarrior object) with this new ChildObject NoldorWarrior_Summoned

Go to the full post


  • Please log in to reply
2 replies to this topic

#1 OneV

OneV
  • Members
  • 53 posts

Posted 04 July 2019 - 11:17 PM

Hey guys,

 

I have been trying to add a summon to a hero and all has been going well except for a couple of things. 
The summon consists of 2 types of units: ElvenGreyHavensSpearmen and NoldorWarriors. The first type of unit works the way it is supposed to, but Noldor Warrior does not. Noldor Warriors take up command points when they are spawned and most importantly they are not going away after their time is up. Can someone please tell me how I can make this right? 

 

 

objectcreaionlist.ini

ObjectCreationList OCL_SpawnNoldorWarriors
    CreateObject
        ObjectNames = ElvenGreyHavensSpearmenHorde_Summoned
        Count = 3
        FadeIn = Yes
        FadeTime = 8000
        IgnoreCommandPointLimit = Yes
        Disposition = SPAWN_AROUND
        DispositionAngle = 60    ;SpawnAround uses this as the arc between guys
        DispositionIntensity = 450 ; and this for distance from center
    End
        CreateObject
        ObjectNames = NoldorWarriorHorde_Summoned
        Count = 3
        FadeIn = Yes
        FadeTime = 7000
        IgnoreCommandPointLimit = Yes
        Disposition = SPAWN_AROUND
        DispositionAngle = 60    ;SpawnAround uses this as the arc between guys
        DispositionIntensity = 275 ; and this for distance from center
    End
End


; ---------------------------------------------------------------------------------------
; Create A bunch of Noldor Warriors out of thin air. 
ObjectCreationList OCL_SpawnNoldorWarriorsEgg
    CreateObject
        ObjectNames = NoldorWarriorsSummonEgg
        IgnoreCommandPointLimit = Yes
        Disposition = LIKE_EXISTING
    End
End

GreyHavens

ChildObject ElvenGreyHavensSpearmen_Summoned ElvenGreyHavensSpearmen


    //***DESIGN parameters***
    EquivalentTo    = ElvenGreyHavensSpearmen
    CommandPoints    = 0
    IsTrainable        = No
    KindOf        = PRELOAD SELECTABLE CAN_CAST_REFLECTIONS INFANTRY PATH_THROUGH_EACH_OTHER SCORE THROWN_OBJECT GRAB_AND_DROP ATTACK_NEEDS_LINE_OF_SIGHT
    
    //***ENGINEERING parameters***


    Behavior = LifetimeUpdate ModuleTag_LifetimeUpdate
    // This one does the work, but the one in the horde displays the timer
        MinLifetime        = DUNEDAIN_ALLIES_LIFETIME
        MaxLifetime        = DUNEDAIN_ALLIES_LIFETIME
        DeathType        = FADED
    End    


      Behavior = SlowDeathBehavior ModuleTag_FadeDeath
        DeathTypes            = NONE +FADED
        FadeDelay            = 0
        FadeTime            = 5000
        DestructionDelay        = 5000
            FX                = INITIAL FX_UnSummonElvenAllies
        Sound                = INITIAL SpellGenericUnsummonFasterMS
    End
    Behavior = GrantUpgradeCreate ModuleTag_GrantForgedBlades
        UpgradeToGrant = Upgrade_ArnorForgedBlades
    End
    Behavior = GrantUpgradeCreate ModuleTag_GrantMithrilMail
        UpgradeToGrant = Upgrade_ArnorHeavyArmor
    End
    Behavior = GrantUpgradeCreate ModuleTag_GrantBasicTraining
        UpgradeToGrant = Upgrade_ArnorBasicTraining
    End
End


//-----------------------------------------------------------------------------------------
Object NoldorWarriorsSummonEgg
    Draw = W3DScriptedModelDraw ModuleTag_Draw
        DefaultModelConditionState
            Model = None
        End
    End
    
    KindOf    = INERT IMMOBILE UNATTACKABLE
    
    Body = ActiveBody ModuleTag_MakesKillWork
        MaxHealth    = 1
    End
    Behavior = LifetimeUpdate ModuleTag_HatchTrigger
        MinLifetime = 0.0
        MaxLifetime = 0.0
    End
    Behavior = SlowDeathBehavior ModuleTag_HatchProcess
        DestructionDelay    = 2000
        OCL            = FINAL OCL_SpawnNoldorWarriors
    End
End

arnorhordes.ini

 

ChildObject ElvenGreyHavensSpearmenHorde_Summoned ElvenGreyHavensSpearmenHorde
    IsTrainable = No
    CommandPoints = 0
    CommandSet = ElvenGreyHavensSpearmenHordeSummonedCommandSet
    EquivalentTo = ElvenGreyHavensSpearmenHorde


    DisplayName  =  OBJECT:HordeElvenGreyHavensSpearmen
    KindOf = SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT INFANTRY HORDE ARCHER MELEE_HORDE


    Behavior = HordeContain ModuleTag_HordeContain
        FrontAngle         = 270
        FlankedDelay         = 2000
        ObjectStatusOfContained = 
        InitialPayload         = ElvenGreyHavensSpearmen_Summoned 10
        Slots             = 10
        PassengerFilter     = NONE +INFANTRY
        ShowPips         = No
        ThisFormationIsTheMainFormation = Yes    ;Used to determine which armorset to use (and anything else we want!)
        RandomOffset         = X:0 Y:0
        MeleeBehavior         = Amoeba
        End


        RankInfo = RankNumber:1 UnitType:ElvenGreyHavensSpearmen_Summoned Position:X:50 Y:0        Position:X:50 Y:20        Position:X:50 Y:-20        Position:X:50 Y:40        Position:X:50 Y:-40 
        RankInfo = RankNumber:2 UnitType:ElvenGreyHavensSpearmen_Summoned Position:X:30 Y:0 Leader 1 0    Position:X:30 Y:20 Leader 1 1    Position:X:30 Y:-20 Leader 1 2    Position:X:30 Y:40 Leader 1 3    Position:X:30 Y:-40 Leader 1 4
        ;RankInfo = RankNumber:3 UnitType:ElvenGreyHavensSpearmen_Summoned Position:X:10 Y:0 Leader 2 0    Position:X:10 Y:20 Leader 2 1    Position:X:10 Y:-20 Leader 2 2    Position:X:10 Y:40 Leader 2 3    Position:X:10 Y:-40 Leader 2 4
        
        RanksToReleaseWhenAttacking     = 1 2 3


        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.


        AlternateFormation = ElvenGreyHavensSpearmenHordePorcupine
    End
    
    Behavior = LifetimeUpdate ModuleTag_LifetimeUpdate
        // This one displays the timer, but the one in the uint does the work 
        MinLifetime        = DUNEDAIN_ALLIES_LIFETIME
        MaxLifetime        = DUNEDAIN_ALLIES_LIFETIME
        DeathType        = FADED
    End    


    //Summoned Rangers can detect Stealthed Units    
    Behavior = StealthDetectorUpdate StealthDetectorUpdateModuleTag
        DetectionRange        = 100    // range to detect
        DetectionRate        = 500   // how often to rescan for stealthed things in my sight (msec)
        CancelOneRingEffect = Yes    // forces uses of one-ring to pop out of it
    End
End

Noldorwarriors.ini

 

ChildObject NoldorWarriorHorde_Summoned NoldorWarriorHorde
    IsTrainable = No
    CommandPoints = 0
    EquivalentTo = NoldorWarriorHorde
    
   Behavior = LifetimeUpdate ModuleTag_LifetimeUpdate
        // This one displays the timer, but the one in the uint does the work 
        MinLifetime        = DUNEDAIN_ALLIES_LIFETIME
        MaxLifetime        = DUNEDAIN_ALLIES_LIFETIME
        DeathType        = FADED
    End 
    Behavior = GrantUpgradeCreate ModuleTag_GrantForgedBlades
        UpgradeToGrant = Upgrade_ElvenForgedBlades
    End


End

elvenhordes.ini

 

ChildObject NoldorWarriorHorde_Summoned NoldorWarriorHorde
    IsTrainable = No
    CommandPoints = 0
    CommandSet = NoldorWarriorHordeSummonedCommandSet
    EquivalentTo = NoldorWarriorHorde


    DisplayName  =  OBJECT:NoldorWarriorHorde
    KindOf = SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT INFANTRY HORDE ARCHER MELEE_HORDE


    Behavior = HordeContain ModuleTag_HordeContain
        FrontAngle         = 270
        FlankedDelay         = 2000
        InitialPayload         = NoldorWarrior_Summoned 6
        Slots             = 6
        PassengerFilter     = NONE +INFANTRY
        ShowPips         = No
        ThisFormationIsTheMainFormation = Yes    ;Used to determine which armorset to use (and anything else we want!)
        RandomOffset         = X:0 Y:0
        MeleeAttackLeashDistance = 1    
        BannerCarriersAllowed    = ElvenMirkwoodArcherBanner                                        // types of units that are allowed as banner carriers
        BannerCarrierPosition    = UnitType:ElvenMirkwoodArcher        Pos:X:70.0 Y:20        // (DEFAULT) position of banner carrier
        
        RankInfo = RankNumber:1 UnitType:NoldorWarrior     Position:X:50 Y:7.5        Position:X:50 Y:-7.5        Position:X:50 Y:25        Position:X:50 Y:-25        Position:X:50 Y:42.5        Position:X:50 Y:-42.5
        RanksToReleaseWhenAttacking     = 1
    End


    Behavior = LifetimeUpdate ModuleTag_LifetimeUpdate
        // This one displays the timer, but the one in the uint does the work 
        MinLifetime        = DUNEDAIN_ALLIES_LIFETIME
        MaxLifetime        = DUNEDAIN_ALLIES_LIFETIME
        DeathType        = FADED
    End  
    
    Behavior = ExperienceLevelCreate ModuleTag_MPLevelBonus ;,;
        LevelToGrant = 10
        MPOnly = No
    End


  
End

 



#2 Jokuc

Jokuc

    Hardcore Procrastinator

  • Members
  • 187 posts
  • Location:Sweden
  •  Mapper

Posted 05 July 2019 - 12:25 AM   Best Answer

I am not very familiar with RotWK so I don't know these units, but it looks like you just forgot or missed to add the properties to the actual horde member object.

 

When you set CommandPoints = 0 on a Horde it just means the horde will cost 0 commandpoints to recruit. You need to set the number of CP each member of the horde takes up. For example if your horde has 10 members and you want the CP number to be 30 you set the CP of its members to 3. As for the units not disappearing it's most likely cause the member objects don't have the LifetimeUpdate module. As the commented part will tell you if you read them:

"// This one displays the timer, but the one in the unit does the work"

 

Just make a child object like so:

ChildObject NoldorWarrior_Summoned NoldorWarrior
    CommandPoints = 0

    Behavior = LifetimeUpdate ModuleTag_LifetimeUpdate
        MinLifetime        = DUNEDAIN_ALLIES_LIFETIME
        MaxLifetime        = DUNEDAIN_ALLIES_LIFETIME
        DeathType        = FADED
    End  
END

(note, I don't know if "NoldonWarrior" is the exact name for the member object, it is just an assumption)

 

Then you will have to replace the member object used in ChildObject NoldorWarriorHorde_Summoned (which right now probably is just the normal NoldorWarrior object) with this new ChildObject NoldorWarrior_Summoned


Edited by Jokuc, 05 July 2019 - 12:30 AM.


#3 OneV

OneV
  • Members
  • 53 posts

Posted 05 July 2019 - 02:49 AM

Jokuc, that's great! I was totally missing the word "Horde" in the unit's .ini file no matter how hard I was looking for my error. It solved both of the issues. Lesson learned! Thank you so much!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users