Jump to content
ztz2019

Here's my question about Jumpjet or Shadowteam

Recommended Posts

I tried to create the unit Jumpjet and just copied most of the code from shadowteam. There's a problem about firing in the air. I searched and found when shadowteam changed to flymode, the animationstate is ConditionsYes="LOCOMOTOR_NORMAL_UPGRADED", I tried to add a new animation about firing in the air and made the new state ConditionsYes="LOCOMOTOR_NORMAL_UPGRADED USING_WEAPON_A". However, it still firing like normalmode just on the ground. Is there sth. wrong with my code ?

Share this post


Link to post

I'm hesitating whether I could ask my questions in this topic or set a new one.

 

How to implement hijacking specialpower ?

And then anyone knows how to set pilotkillingshot come true? How to let a garrisoned structure resist garrison cleaning weapon?

 

 

How to make the disk grenade bounces when it hit onto ground ?

 

 

 

What should I do to make switch_weapon funtion effective on a squad unit ?

Once I tried to make confessor squad could switch machinegun and grenade. I created two function button just like firehawk's reloaded two kinds ammo, to set UpgradeToRemove and SpecialPowerDispatchSpecialPower to the real confessor unit. However, the unit would fire in a wired way and sometimes can't fire until I move them by mouse. Then I let confessor have only primary weapon, seperate the two weapon with different ObjectStatus .

Now the squad could fire smoothly, but still have problem that when I switch to another weapon, the later weapon's first shot will firing at the former weapon's last shot's place. It means when I use machinegun firing at section A, then stop and switch to grenade and aiming at section B, the squad will first firing to A and then firing to B normally.

 

 

How to implement pilot function like ZH or General? I mean when a unit dead, it created a new object that inherit the parent unit's experience.

In my opinion, I wanna create a unit that could replace to another by experience-upgrade, and the new one could inherit the old's experience. If it's difficult to come true, I want the unit could create a pilot function unit when it dies.

Share this post


Link to post

Imo from a modding community standpoint its better to have individual topics. This makes it easier to find things on forums and makes it more aproachable for new modders to pick up on things. If you group several different issues in one topic it might be abit daunting when confronted by walls of text.

 

Personaly you can ask as many questions or adres as many different issues in your OWN topic as you prefer, aslong as you can keep it all together for yourself.

For myself personaly i dont mind mutli question posts, i just personaly try not to respond to much to off topic discussions or thread "hijacking' of someone else his topic. Out of respect for the original poster and to avoid confussion in the discussion.

 

With that said:

--------------------------------------------------------------------------

1. Like Lauren said before....animation conditions have a priority system. The file gets read from top to bottom...so firing + flying needs to be above just firing or flying.

So basicly

<animation>

ConditionsYes: ConditionA ConditionB ConditionC

</animation>

 

needs to be above

 

<animation>

ConditionsYes: ConditionA ConditionB

</animation>

 

needs to be above

 

<animation>

ConditionsYes: ConditionA

</animation>

 

an example from the shadow

 

 

<AnimationState
                    ParseCondStateType="PARSE_NORMAL"
                    ConditionsYes="DYING LOCOMOTOR_NORMAL_UPGRADED"
                    EnteringStateFX=""
                    FrameForPristineBonePositions="0"
                    ShareAnimation="False"
                    AllowRepeatInRandomPick="False"
                    SimilarRestart="False">
                    <Animation
                        AnimationName="NUSHDW_FLDB"
                        AnimationMode="ONCE"
                        Distance="0"
                        AnimationBlendTime="5"
                        AnimationSpeedFactorMin="1"
                        AnimationSpeedFactorMax="1"
                        WeaponTimingOrdering="PRIMARY_WEAPON"
                        WeaponTimingSlotID="1"
                        AnimationPriority="1"
                        FadeBeginFrame="-1"
                        FadeEndFrame="-1"
                        AnimationMustCompleteBlend="False"
                        UseWeaponTiming="False"
                        FadingIn="False" />
                </AnimationState>
                <AnimationState
                    ParseCondStateType="PARSE_NORMAL"
                    ConditionsYes="DYING"
                    EnteringStateFX=""
                    FrameForPristineBonePositions="0"
                    ShareAnimation="False"
                    AllowRepeatInRandomPick="False"
                    SimilarRestart="False">
                    <Animation
                        AnimationName="NUSHDW_DIEA"
                        AnimationMode="ONCE"
                        Distance="0"
                        AnimationBlendTime="5"
                        AnimationSpeedFactorMin="1"
                        AnimationSpeedFactorMax="1"
                        WeaponTimingOrdering="PRIMARY_WEAPON"
                        WeaponTimingSlotID="1"
                        AnimationPriority="1"
                        FadeBeginFrame="-1"
                        FadeEndFrame="-1"
                        AnimationMustCompleteBlend="False"
                        UseWeaponTiming="False"
                        FadingIn="False" />
                    <Animation
                        AnimationName="NUSHDW_DIEB"
                        AnimationMode="ONCE"
                        Distance="0"
                        AnimationBlendTime="5"
                        AnimationSpeedFactorMin="1"
                        AnimationSpeedFactorMax="1"
                        WeaponTimingOrdering="PRIMARY_WEAPON"
                        WeaponTimingSlotID="1"
                        AnimationPriority="1"
                        FadeBeginFrame="-1"
                        FadeEndFrame="-1"
                        AnimationMustCompleteBlend="False"
                        UseWeaponTiming="False"
                        FadingIn="False" />
                    <Animation
                        AnimationName="NUSHDW_DIEC"
                        AnimationMode="ONCE"
                        Distance="0"
                        AnimationBlendTime="5"
                        AnimationSpeedFactorMin="1"
                        AnimationSpeedFactorMax="1"
                        WeaponTimingOrdering="PRIMARY_WEAPON"
                        WeaponTimingSlotID="1"
                        AnimationPriority="1"
                        FadeBeginFrame="-1"
                        FadeEndFrame="-1"
                        AnimationMustCompleteBlend="False"
                        UseWeaponTiming="False"
                        FadingIn="False" />
                </AnimationState>
 

Notice how DYING Comes below DYING LOCOMOTOR_NORMAL_UPGRADED

 

try changing your code to reflect this order of priority. Also i would use ATTACKING over Using weapon A. ATTACKING is less sensetive to other animation conditions like reloading or inbetween shots. If you want to use Firing A or using weapon A i would advice defining the other reload and inbeween states aswell, else there is a chance it will use the default state for the none defined animation conditions.

 

----------------------------------------------------------------------------------------------------------------------------------

2. I havent used the hijackerupdate myself. But maybe you can just use the engineer contain module instead

 

 

<xs:extension base="ContainModuleData">
                <xs:sequence>
                    <xs:element name="CanEnterFilter" type="ObjectFilter" minOccurs="0" maxOccurs="1" />
                </xs:sequence>
                <xs:attribute name="ImmediatelyEnabled" type="SageBool" default="false" />
                <xs:attribute name="ReplaceWith" type="ObjectCreationListRef" />
                <xs:attribute name="NameOfVoiceToUseForFriendlyEnter" type="StringHash" use="optional" />
                <xs:attribute name="NameOfVoiceToUseForHostileEnter" type="StringHash" use="optional" />
                <!-- Various FXs for engineers entering and doing various things -->
                <xs:attribute name="FXForRepair" type="FXListRef" use="optional" />
                <xs:attribute name="FXForCapture" type="FXListRef" use="optional" />
                <xs:attribute name="FXForReplace" type="FXListRef" use="optional" />
                <xs:attribute name="FXForCaptureAndReplace" type="FXListRef" use="optional" />
                <!-- Note: all Eva events are played for the owner of the engineer entering the container -->
                <xs:attribute name="EvaEventForRepair" type="EvaEventIDType" use="optional" />
                <xs:attribute name="EvaEventForCapture" type="EvaEventIDType" use="optional" />
                <xs:attribute name="EvaEventForReplace" type="EvaEventIDType" use="optional" />
                <xs:attribute name="EvaEventForCaptureAndReplace" type="EvaEventIDType" use="optional" />
            </xs:extension>
 

Just use a vehicle in the object filter.

like:

 

 

<EngineerContain xmlns="uri:ea.com:eala:asset"
        id="ModuleTag_EngineerContain"
        NameOfVoiceToUseForHostileEnter="VoiceCaptureBuilding"  //you could use some hatch opening sound maybe
        EvaEventForCapture="EnemyBuildingCaptured"  // not sure if you can create a new eva event for notifying when a tank is neging hijacked. but its a possibility
        FXForCapture="FX_Building_Captured"                      //you could use some pistol sounds or anything that could sound like vehicle crew dying
        FXForCaptureAndReplace="FX_Building_Captured"           //you could use some acknowledgement of captureing the vehicle sound here
        ImmediatelyEnabled="true">
        <CanEnterFilter Rule="NONE">
            <IncludeThing>HijackerUnit</IncludeThing> the only unit that can enter vehicle
           
        </CanEnterFilter>
    </EngineerContain>
 

And you put this in the vehicle(s) that shouldbe able to be captured.

 

----------------------------------------------------------------------------------------------------------------------------------------

3. you should be able to define the bouncing in the projectile, namely in the bezier projectile module part

 

 

 

<xs:attribute name="BounceCount" type="SageInt" />       //number of time it bounces
                <xs:attribute name="BounceDistance" type="SageReal" />  // how far it will bounce

                                                                                                                // the following can be used to add a bezier curve to the bounce...basicly the hight and angle between bounces
                <xs:attribute name="BounceFirstHeight" type="SageReal" />  
                <xs:attribute name="BounceSecondHeight" type="SageReal" />
                <xs:attribute name="BounceFirstPercentIndent" type="Percentage" />
                <xs:attribute name="BounceSecondPercentIndent" type="Percentage" />
                                                                                                                   
               <xs:attribute name="GroundBounceFX" type="FXListRef" />  // everytime the grenade hits dirt you can generate dirt splashing up
                
                <xs:attribute name="GroundBounceWeapon" type="WeaponRef" />  // you can even make it do damage everytime it hits the ground
 

 

4. Weapon switch

 

Try using the GiveOrRestoreSpecialPower:

 

 

<RemoveUpgradeUpgrade
                id="ModuleTag_CommandSet_RemoveFor_01">
                <TriggeredBy>Upgrade_Weapon1</TriggeredBy>
                <UpgradeToRemove>Upgrade_Weapon2</UpgradeToRemove>
            </RemoveUpgradeUpgrade>

<RemoveUpgradeUpgrade
                id="ModuleTag_CommandSet_RemoveFor_02">
                <TriggeredBy>Upgrade_Weapon2</TriggeredBy>
                <UpgradeToRemove>Upgrade_Weapon1</UpgradeToRemove>
            </RemoveUpgradeUpgrade>

<StatusBitsUpgrade
                id="ModuleTag_StatusBitUpgradeFor01"
                StatusToSet="WEAPON_UPGRADED_01"
                StatusToClear="WEAPON_UPGRADED_02 WEAPON_UPGRADED_03">
                <TriggeredBy>Upgrade_Weapon1</TriggeredBy>
            </StatusBitsUpgrade>

<StatusBitsUpgrade
                id="ModuleTag_StatusBitUpgradeFor01"
                StatusToSet="WEAPON_UPGRADED_01"
                StatusToClear="WEAPON_UPGRADED_02 WEAPON_UPGRADED_03">
                <TriggeredBy>Upgrade_Weapon2</TriggeredBy>
            </StatusBitsUpgrade>

<SpecialPowerTemplate
        id="SpecialPower_GrantpackUpgrade"
        TargetType="NONE"
    />
<SpecialPowerTemplate
        id="SpecialPower_GrantPackUpgrade"
        TargetType="NONE"
    />

<GiveOrRestoreUpgradeSpecialPower 
        id="ModuleTag_Give_Weapon1_SpecialPowerUpdate"
        SpecialPowerTemplate="SpecialPower_GrantUnpackUpgrade"
        UpgradeToGive="Upgrade_Weapon1"
    />

 <GiveOrRestoreUpgradeSpecialPower
        id="ModuleTag_Give_Weapon2_SpecialPowerUpdate"
        SpecialPowerTemplate="SpecialPower_GrantPackUpgrade"
        UpgradeToGive="Upgrade_Weapon2"
    />

you add this to the unit itself and the squad it is in, you need to give the squad a button for wsitching in its command set tho, the unit itself doesnt need a button iirc. You can use the existing buttons for the pack/unpack special powers....as ive noticed there are some issues at times with creating new buttons in kanes wrath.

You might need to add a production update to both tho for the upgrades to work.

 

 

<ProductionUpdate
                id="ModuleTag_ProductionUpdate"
                Type="UPGRADE"
                GiveNoXP="true" />
 

 

5. I remember Golan (if it was him) devised a way to bring the Generals pilot mechanic into TW..but that was a long time ago and not sure if he still roams the forums or modding community these days.

 

I would try it the following way....and this is from the top of my head..so would need some major trial and error testing:

 

Give the vehicle a 3 createobjectdie modules, one for each lvl of veterancy

like:

 

<CreateObjectDie
                id="ModuleTag_CreateObjectDieVETERAN"
                UpgradeRequired="Upgrade_Veterancy_VETERAN"
                UpgradeForbidden="Upgrade_Veterancy_HEROIC Upgrade_Veterancy_ELITE"
                CreationList="OCL_Veteran_Pilot">
                <DieMuxData
                    DeathTypes="ALL" />
            </CreateObjectDie>   

<CreateObjectDie
                id="ModuleTag_CreateObjectDieHEROIC"
                UpgradeRequired="Upgrade_Veterancy_HEROIC"
                UpgradeForbidden="Upgrade_Veterancy_ELITE"
                CreationList="OCL_Heroic_Pilot">
                <DieMuxData
                    DeathTypes="ALL" />
            </CreateObjectDie>


 <CreateObjectDie
                id="ModuleTag_CreateObjectDieELITE"
                UpgradeRequired="Upgrade_Veterancy_ELITE"
              
                CreationList="OCL_Elite_Pilot">
                <DieMuxData
                    DeathTypes="ALL" />
            </CreateObjectDie>

then you create a object creationlist for each pilot

 

 

<ObjectCreationList
        id="OCL_Veteran_Pilot">
        <CreateObject
            Options="IGNORE_ALL_OBJECTS"
            Disposition="LIKE_EXISTING">
            <CreateObject>Veteran_Pilot</CreateObject>
        </CreateObject>
    </ObjectCreationList>

<ObjectCreationList
        id="OCL_Heroic_Pilot">
        <CreateObject
            Options="IGNORE_ALL_OBJECTS"
            Disposition="LIKE_EXISTING">
            <CreateObject>Heroic_Pilot</CreateObject>
        </CreateObject>
    </ObjectCreationList>

<ObjectCreationList
        id="OCL_Elite_Pilot">
        <CreateObject
            Options="IGNORE_ALL_OBJECTS"
            Disposition="LIKE_EXISTING">
            <CreateObject>Elite_Pilot</CreateObject>
        </CreateObject>
    </ObjectCreationList>


 

 

And Veteran_, Elite_ and Heroic_pilot will be the actuall units.

 

As for getting the pilots to enter a new vehicle and give them the experience....i would use the engineer contain again but only for the pilots being able to enter and using the replaceself option like the juggernauthusk doesto spawn a new unti..a veterancy corresponding version of it.

Edited by Ravendark

Share this post


Link to post

the only thing i am doubting atm is that i defined UpgradeRequired and UpgradeForbidden correctly in the createdie modules. I just noticed they are defined in there as squences and not attributes. will have another look at that.

couldbe it needs to be defined as :

<UpgradeRequired>Upgrade_Veterancy_VETERAN</UpgradeRequired>

and

<UpgradeForbidden>Upgrade_Veterancy_Heroic Upgrade_Veterancy_Elite</UpgradeForbidden>

Edited by Ravendark

Share this post


Link to post

Thanx, now I'm trying to implement Boris call on Airstrike.

 

And I can't make fighters leave when disaim the target.

005X3nOQjw1ep6o6xk8vdj30zk0k0wux.jpg

Share this post


Link to post

kindof depends what you are using to create the special weapon and the rest of your code. Did you include the

 

 

<RunOffMapBehavior
                id="ModuleTag_RunOffMapBehavior"
                FlyingOffMap="true"
                RequiresSpecificTrigger="true" />
 

in your bombers code?

 

are you using a orca strike like special power or are you triggering the special power directly from your weapon? post your code if you please.

Share this post


Link to post

No,

 

kindof depends what you are using to create the special weapon and the rest of your code. Did you include the

 

 

<RunOffMapBehavior
                id="ModuleTag_RunOffMapBehavior"
                FlyingOffMap="true"
                RequiresSpecificTrigger="true" />
 

in your bombers code?

 

are you using a orca strike like special power or are you triggering the special power directly from your weapon? post your code if you please.

No, I mean cancel the airstrike when you disaiming the target, now when you disaiming, it will still fire on target and then runoff the map.

Share this post


Link to post
<WeaponTemplate

id="SovietCommandoCallBombingRun"

AttackRange="300.0"

MinimumAttackRange="50"

WeaponSpeed="999999.0"

RadiusDamageAffects="ENEMIES"

ClipSize="1"

Flags="NONE"

CanFireWhileMoving="false"

ReAcquireDetailType="PER_CLIP"

PreAttackType="PER_TARGET"

AcceptableAimDelta="10d"

AntiMask="ANTI_STRUCTURE">

<PreAttackDelay

MinSeconds="0.5s"

MaxSeconds="0.5s" />

<FiringDuration

MinSeconds="0.9s"

MaxSeconds="0.9s" />

<ClipReloadTime

MinSeconds="0.1s"

MaxSeconds="0.1s" />

<Nuggets>

<ActivateLaserNugget

Lifetime="1.1s"

LaserId="1">

<SpecialObjectFilter

Rule="ANY"

Include="STRUCTURE VALID_TARGET_FOR_C4"

Exclude="INFANTRY VEHICLE"/>

</ActivateLaserNugget>

<SpecialPowerNugget

SpecialPowerTemplate="SpecialPowerCommandoBombingRun">

<SpecialObjectFilter

Rule="ANY"

Include="STRUCTURE VALID_TARGET_FOR_C4"

Exclude="INFANTRY VEHICLE"/>

</SpecialPowerNugget>

<TintObjectsNugget

PreColorTime="0.5s"

SustainedColorTime="7.0s"

PostColorTime="1.5s"

Frequency="1"

Amplitude="0">

<Color R="0.2" G="0" B="2"/>

</TintObjectsNugget>

</Nuggets>

</WeaponTemplate>


This is my calling on strike weapon, and it's wired that when I aiming at myself structure, the TintObjectsNugget will take effect and my structure turn blue(R="0.2" G="0" B="2"), but all other enemy's structure still normal color, won't get blue.

005X3q9sjw1ep6wwwt5iwj30eo061q4n.jpg

Share this post


Link to post

You could try by using a much bigger Preattack delay, so you have a chance to abort, and if that fails you ight have to code the airstrike as button special power instead of a from weapon special power..i know you can abort preperation times in special powers (see gdi rifle man dig in specilapower...you can move away and abort that)

Share this post


Link to post

You could try by using a much bigger Preattack delay, so you have a chance to abort, and if that fails you ight have to code the airstrike as button special power instead of a from weapon special power..i know you can abort preperation times in special powers (see gdi rifle man dig in specilapower...you can move away and abort that)

I know, but it still no way to cancel bombing on target when the fighters already appear.

 

And my new Rocketeer firing animation appears normally, thanx.

 

Now I'm trying to implement tne forgotten/nod tick tank diggin ability, have you got any ideas about it? Such as Tib Essence mod's same one?

 

Then I've made Natasha's LineDamage come true. Just like sonic tanks LinearNugget, but more faster move and dead, though targeting at structure and changing color still can't implement.

Share this post


Link to post

the only way i can think of atm on how to get more control over the bomber aricraft, is not using a airstrike like specialpower but a drone like weaponset + bomber drones (think planetary assault carrier) method....have the bombers orbit arround the commando (who uses the spawn/ slave owner logic) high enough to have them out of camera view, then when you target a structure use the slave logic in the weapon to order the bomber drones to attack a target. if you move away or give a stop command the drones should move back to their orbit out of camera view...theoretcly.

 

you could just code the tick tank as an mcv or trying using the shadowteam lift /land special power but remove the triggers flight/landing code part. you could then trigger a armor upgrade with the same special powers that gives it more armor when digged in and vice versa...also you can use the loco switch special power the shadows use to make the unit unmovable while burrowed.

Share this post


Link to post
KindOf="XXX XXX... SLAVE_OWNER" (AssaultCarrier has this)
<CombinedInfoModule
DockingBone="ZT_HEAD" />(spawnfighter's taxi place, like Assault Carrier )
<SpawnBehavior
id="ModuleTag_SpawnFighter"
SpawnNumberData="1"
InitialBurst="1"
SpawnReplaceDelayData="20s"
SpawnInsideBuilding="true"
FadeInTime="1s"
CombineOnCreate="true"
PassExperienceToSpawned="true">
<SpawnTemplate>GDISuperSonic</SpawnTemplate>
</SpawnBehavior>

 

<AI>
<AIUpdate
id="ModuleTag_AI"
AutoAcquireEnemiesWhenIdle="YES"
MaxCombineChildren="1">(The same between SpawnNumberData & InitialBurst)
<UnitAITargetChooserData
SympathyRange="100.0"
IdleScanDelay="0.01s" />
</AIUpdate>
</AI>

 

 

No matter which DockingBone I changed(ZT_HEAD, ZT_RHAND...or the new out of view bone), the spawn unit fighter always at the base location, but no negative influence on its attacking and flying.

93Y53A.png

 

The SonicFighter is just exchange model from Carrier's spawn InvaderFighter

Edited by ztz2019

Share this post


Link to post

i used something similar once for tryong to mimic a A10 CAS strike...basicly keep the A10's circling a area by slaving them to a dummy that acted as a targeting dummy. Ill see if i have the code somewhere still left.

Share this post


Link to post

the only thing i am doubting atm is that i defined UpgradeRequired and UpgradeForbidden correctly in the createdie modules. I just noticed they are defined in there as squences and not attributes. will have another look at that.

couldbe it needs to be defined as :

<UpgradeRequired>Upgrade_Veterancy_VETERAN</UpgradeRequired>

and

<UpgradeForbidden>Upgrade_Veterancy_Heroic Upgrade_Veterancy_Elite</UpgradeForbidden>

I've implement the bounce of grenade now. But the grenade can't explore and take damage when hit the target the first time until bounce once and detonate. Edited by ztz2019

Share this post


Link to post

What do you mean?

Is it not bouncing at all?

Or does it bounce thill it touches something then it explodes?

Share this post


Link to post

What do you mean?

Is it not bouncing at all?

Or does it bounce thill it touches something then it explodes?

It won't explode when hit on sth., must bounce once time and then explodes, so it can't take damage if not far enough between target thing.

 

And CommieDog said remove "NO_COLLIDE" from "KindOf", and now it could work.

Share this post


Link to post

you might have to include

 

ProjectileCollidesWith="ALLIES ENEMIES NEUTRAL STRUCTURES WALLS"

 

in your weapon aswell if you havent allrdy.

Share this post


Link to post

Now I implement deploy ability of Scorpion Tank. Just like ShadowTeam's Glideroff. However, I can't activate new atrributemodifier for the deployed/ unpacking Tank. I tried to use <triggeredby>upgrade_unpack</triggeredby> to activate it, with the specialpower give_upgrade module, but no response.

Share this post


Link to post

you could try a few methods to trigger the armor upgrade:

 

1. you can add the attributemodifier itself to the swithclocomotorupgrade module:

 

 

TriggerAttributeModifier=""
AttributeModifierDuration="0s" not sure if you need to enter a really large number here to make it permanent thill next wsitch or if you leave this section out of the code it could default to infinite time thill next switch.
 

 

 

2. You probably have a modelcondition for when your tank is burrowed...example User_10 or something like that.

 

You could trigger an upgrade based of modelconditions through lua.

 

Example:

 

in your unit

 

 

<ModelConditionEvent Name="Burrowed">
            <Conditions>+User_10</Conditions>
</ModelConditionEvent>
<ModelConditionEvent Name="UnBurrowed">
            <Conditions>-User_10</Conditions>
</ModelConditionEvent>
 

in your scriptsevents.xml

 

 

<EventList Name="NODTickTankFunctions" Inherit="BaseScriptFunctions">
        <EventHandler EventName="Burrowed"    ScriptFunctionName="OnTickTankBurrow" DebugSingleStep="false"/>
        <EventHandler EventName="UnBurrowed"    ScriptFunctionName="OnTickTankUnBurrow" DebugSingleStep="false"/>
</EventList>
 

in your scripts.lua

 

 

function OnTickTankBurrow(self)
    ObjectGrantUpgrade( self, "Upgrade_BurrowedArmor" )
end

function OnTickTankUnBurrow(self)
    ObjectRemoveUpgrade( self, "Upgrade_BurrowedArmor" )
end
 

Needs testing ofc.

Share this post


Link to post

you could try a few methods to trigger the armor upgrade:

 

1. you can add the attributemodifier itself to the swithclocomotorupgrade module:

 

 

TriggerAttributeModifier=""
AttributeModifierDuration="0s" not sure if you need to enter a really large number here to make it permanent thill next wsitch or if you leave this section out of the code it could default to infinite time thill next switch.
 

 

 

2. You probably have a modelcondition for when your tank is burrowed...example User_10 or something like that.

 

You could trigger an upgrade based of modelconditions through lua.

 

Example:

 

in your unit

 

 

<ModelConditionEvent Name="Burrowed">
            <Conditions>+User_10</Conditions>
</ModelConditionEvent>
<ModelConditionEvent Name="UnBurrowed">
            <Conditions>-User_10</Conditions>
</ModelConditionEvent>
 

in your scriptsevents.xml

 

 

<EventList Name="NODTickTankFunctions" Inherit="BaseScriptFunctions">
        <EventHandler EventName="Burrowed"    ScriptFunctionName="OnTickTankBurrow" DebugSingleStep="false"/>
        <EventHandler EventName="UnBurrowed"    ScriptFunctionName="OnTickTankUnBurrow" DebugSingleStep="false"/>
</EventList>
 

in your scripts.lua

 

 

function OnTickTankBurrow(self)
    ObjectGrantUpgrade( self, "Upgrade_BurrowedArmor" )
end

function OnTickTankUnBurrow(self)
    ObjectRemoveUpgrade( self, "Upgrade_BurrowedArmor" )
end
 

Needs testing ofc.

Thanx, I'll try

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×