Jump to content
Sign in to follow this  
Ravendark

Ablative/regenerative Armor brainstorm

Recommended Posts

I've been playing with this idea of adding some sort of shield tech to vehicles and infantry on my gdi'ish side. This ofc based of the Scrin shield coding. One thing that held me back was: i don't really want my mod to be to futuristic..specialy for earth based sides. I also don't wnt to go full realism, but plausable has always been my aim.

 

Today while browsing some of the xml files an idea popped in my head:

 

Ablative armor:

Normal shields work on a deplete and restart cycle. I want my ablative armor to be sort of a one-shot shield...when its depleted it wont regenerate. But if you get a vehicle into a repairbay(garrison) or repaired it will re-enable the armor/shield.

 

I was thinking:

Create a upgrade:

<UpgradeTemplate id="Upgrade_GDI_Ablative_Armor"
        Type="OBJECT"
        BuildCost="1000"
        BuildTime="60.0s"
       >
        <GameDependency
            <ForbiddenUpgrade>Upgrade_RemoveAblativeArmor</ForbiddenUpgrade>
            <ForbiddenUpgrade>Upgrade_ReEnable_AblativeArmor</ForbiddenUpgrade>
            ForbiddenModelConditions="USER_10 USER_11 SHIELDBODY_ENABLED"/>
</UpgradeTemplate>

In my tank:

<Body>
            <ShieldBody
                id="ModuleTag_Ablative_Armor_Body"
                MaxHealth="10000"
                ShieldAmount="2500"
                ShieldArmor="ForcefieldFilterDamageArmor"
                ShieldRechargeIdleTime="5s"
                ShieldActiveModelCondition="USER_10" />
</Body>
<ScriptedModelDraw
                id="ModuleTag_Draw_Ablative_Armor"
                OkToChangeModelColor="true">
                <ModelConditionState
                    ParseCondStateType="PARSE_DEFAULT"></ModelConditionState>
                <ModelConditionState
                    ParseCondStateType="PARSE_NORMAL"
                    ConditionsYes="USER_10">
                    <Model
                        Name="AblativeArmorSkin01" />               /** this will be some sort of armor overlay **/
                </ModelConditionState>

               <ModelConditionState
                    ParseCondStateType="PARSE_NORMAL"
                    ConditionsYes="USER_11">
                    <Model
                        Name="AblativeArmorSkin01" />     /** this will be some sort of armor overlay **/
                  <Texture
                        Original="Undamaged_ablative"  /** shows damaged/depleted ablative armor **/
                        New="damaged_ablative" />        /** shows damaged/depleted ablative armor **/
                </ModelConditionState>
</ScriptedModelDraw>

Eventlist:

<ModelConditionEvent Name="RemoveAblativeArmor">
            <Conditions>-USER_10</Conditions>
</ModelConditionEvent>

When the shield/armor(USER_10) fades remove the shield/armor upgrade

<EventList Name="TankEventsList" Inherit="">
        <EventHandler EventName="RemoveAblativeArmor" ScriptFunctionName="onDepletedRemoveAblativeArmor" DebugSingleStep="false"/>
        <EventHandler EventName="ReEnableAblativeArmor" ScriptFunctionName="onReEnableAblativeArmor" DebugSingleStep="false"/>
</EventList>
function onDepletedRemoveAblativeArmor(self)
    ObjectGrantUpgrade( self, "Upgrade_RemoveAblativeArmor" )
end

Back to the vehicle:

<StatusBitsUpgrade
                id="ModuleTag_StatusBitUpgrade_01"
                StatusToClear="SHIELDBODY_ENABLED">
                <TriggeredBy>Upgrade_RemoveAblativeArmor</TriggeredBy>
</StatusBitsUpgrade>
<UpgradeTemplate id="Upgrade_RemoveAblativeArmor"
        Type="OBJECT"
       >
</UpgradeTemplate>

I don't know for sure if i need to remove the initial upgrade that triggers the shieldbody_enable statusbit so this might be redundant:

<RemoveUpgradeUpgrade
                id="ModuleTag_RemoveInitialUpgrade01">
                <TriggeredBy>Upgrade_RemoveAblativeArmor</TriggeredBy>
                <UpgradeToRemove>Upgrade_GDI_Ablative_Armor</UpgradeToRemove>
</RemoveUpgradeUpgrade>
<RemoveUpgradeUpgrade
                id="ModuleTag_RemoveInitialUpgrade02">
                <TriggeredBy>Upgrade_RemoveAblativeArmor</TriggeredBy>
                <UpgradeToRemove>Upgrade_ReEnable_AblativeArmor</UpgradeToRemove>
</RemoveUpgradeUpgrade>

Then to re-enable it again after a repair (depending if i use repair drones or a garrison repair it might differ abit)

<StatusBitsUpgrade
                id="ModuleTag_StatusBitUpgrade_02"
                StatusToSet="SHIELDBODY_ENABLED">
                <TriggeredBy>Upgrade_ReEnable_AblativeArmor</TriggeredBy>
</StatusBitsUpgrade>
<UpgradeTemplate id="Upgrade_ReEnable_AblativeArmor"
        Type="OBJECT"
       >
</UpgradeTemplate>

For repair drones:

<ObjectStatusEvent Name="ReEnableAblativeArmor">
            <Conditions>-UNDERGOING_REPAIR</Conditions>
</ObjectStatusEvent>

For Garrison/repairpad style:

<ModelConditionEvent Name="ReEnableAblativeArmor">
            <Conditions>-GARRISONED</Conditions>
</ModelConditionEvent> 

Function should remain the same for both

function onReEnableAblativeArmor(self)
    ObjectGrantUpgrade( self, "Upgrade_ReEnable_AblativeArmor" )
end
<RemoveUpgradeUpgrade
                id="ModuleTag_Remove_RemoveUpgrade01">
                <TriggeredBy>Upgrade_ReEnable_AblativeArmor</TriggeredBy>
                <UpgradeToRemove>Upgrade_RemoveAblativeArmor</UpgradeToRemove>
</RemoveUpgradeUpgrade>

i could maybe replace all the

<RemoveUpgradeUpgrade></RemoveUpgradeUpgrade>

with

ObjectRemoveUpgrade(GameObject target, string upgradeName)

in lua...but i thought i heared/read somewhere that it was bugged or am i mistaking it with another bugged function?

 

Any thoughts, suggestions, improvements on this?

Edited by Ravendark

Share this post


Link to post

While I can't really help with suggestions I can say that I like the idea : P

 

If you ever plan to do something similar to NOD you may consider import that shield mecha from TT

 

though it may won't be for your taste xD

Edited by Egozi44

Share this post


Link to post

Atm it seems that even if you didn't research it the first time, when you repair stuff it will get the armor, so use one upgrade that triggers the shield overall (playerupgrade) and one to check if it's active, though you can just do that by checking for the shieldbody enabled thingy, and setting it. Open the WB, check the scripts for the scrupt which can set object statuses, use it with random stuff, save the map, check the xml for the script name and then use ExecuteAction

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×