Jump to content
Sign in to follow this  
Madin

Corrupter Auto heal units attempts

Recommended Posts

I am still trying to get the Corrupter to automatically heal friendly units when they are damaged.

 

I tried using a LUA scripted event, but it never worked ( I probably messed up the code ).

 

I am using the the Devourer has the test unit:

AIUpdate

AILuaEventsList="AlienDevourerTankFunctions">

ModelConditionEvent

		<ModelConditionEvent Name="Damaged">
			<Conditions>+DAMAGED</Conditions>
		</ModelConditionEvent>

		<ModelConditionEvent Name="ReallyDamaged">
			<Conditions>+REALLYDAMAGED</Conditions>
		</ModelConditionEvent>

Event List

	<EventList Name="AlienDevourerTankFunctions" Inherit="BaseScriptFunctions">
		<EventHandler EventName="OnCreated"	ScriptFunctionName="OnNODScorpionBuggyCreated" DebugSingleStep="false"/>
		<EventHandler EventName="Damaged"	ScriptFunctionName="OnUnitDamaged" DebugSingleStep="false"/>
		<EventHandler EventName="ReallyDamaged"	ScriptFunctionName="OnUnitReallyDamaged" DebugSingleStep="false"/>
	</EventList>

Scripts LUA

function OnUnitDamaged(self)
        ObjectBroadcastEventToAllies(self, "HealRequest", 300)
end

function OnUnitReallyDamaged(self)
        ObjectBroadcastEventToAllies(self, "HealRequest", 300)
end

 

Corrupter code:

 <SpecialPower id="ModuleTag_CorrupterGetIntoRangeHealBlast" SpecialPowerTemplate="SpecialPower_CorrupterGetIntoRangeHealBlast" UpdateModuleStartsAttack="true"/>
 <SpecialAbilityUpdate id="ModuleTag_CorrupterGetIntoRangeHealBlastUpdate" SpecialPowerTemplate="SpecialPower_CorrupterGetIntoRangeHealBlast" UnpackTime="0s" PackTime="0s" StartAbilityRange="100.0" Options="CHECK_SPECIALPOWER_REQUIREMENTS_DURING_UPDATE" ChainedButton="Command_AlienCorrupterTioxinHealCannon"/>
 <SpecialPower id="ModuleTag_SpecialPower_CorrupterHealBlast" SpecialPowerTemplate="SpecialPower_CorrupterHealBlast" AttributeModifierAffectsSelf="true" UpdateModuleStartsAttack="true"/>
 <WeaponFireSpecialAbilityUpdate id="SpecialPower_CorrupterHealBlastUpdate" SpecialPowerTemplate="SpecialPower_CorrupterHealBlast" SpecialWeapon="AlienCorrupterTioxinHealCannon" StartAbilityRange="150.0" PersistentPrepTime="0.1s" BusyForDuration="1.5s" UnpackTime="0.1s" WhichSpecialWeapon="1" AbilityAbortRange="100.0" Options="CHECK_SPECIALPOWER_REQUIREMENTS_DURING_UPDATE"/>

AILuaEventsList="AlienCorrupterEventsList">

<LogicCommand Options="NEED_TARGET_ALLY_OBJECT" Type="SPECIAL_POWER" id="Command_CorrupterGetIntoRange">
 <SpecialPower>SpecialPower_CorrupterGetIntoRangeHealBlast</SpecialPower>
 </LogicCommand>
<LogicCommand Options="NEED_TARGET_ALLY_OBJECT" Type="SPECIAL_POWER" id="Command_AlienCorrupterTioxinHealCannon">
 <SpecialPower>SpecialPower_CorrupterHealBlast</SpecialPower>
 </LogicCommand>
<LogicCommandSet id="AlienCorrupterCommandSet">
 <Cmd>Command_StanceDrillDown</Cmd>
 <Cmd>Command_CorrupterGetIntoRange</Cmd>
 <Cmd>Command_AlienCorrupterTioxinHealCannon</Cmd>
 <Cmd>Command_Uncombine</Cmd>
 <Cmd>Command_AttackMove</Cmd>
 </LogicCommandSet>

<SpecialPowerTemplate id="SpecialPower_CorrupterGetIntoRangeHealBlast" TargetType="OBJECT" Flags="NEEDS_OBJECT_FILTER TARGET_NEEDS_OBJECT_STATUS NO_FORBIDDEN_MODEL_STATES" DisallowedTargetObjectStatus="CLONED USER_PARALYZED INSIDE_GARRISON" DisallowedTargetModelStates="HEALTH_PERCENT_100" WaypointModeTerminal="false">
<ObjectFilter Rule="NONE" Relationship="ALLIES">
 <IncludeThing>AlienAnnihilatorTripod</IncludeThing>
 <IncludeThing>AlienCorrupter</IncludeThing>
 <IncludeThing>AlienDevourerTank</IncludeThing>
 <IncludeThing>AlienExplorer</IncludeThing>
 <IncludeThing>AlienGunWalker</IncludeThing>
 <IncludeThing>AlienHarvester</IncludeThing>
 <IncludeThing>AlienMastermind</IncludeThing>
 <IncludeThing>AlienSeekerTank</IncludeThing>
 </ObjectFilter>
 </SpecialPowerTemplate>
<SpecialPowerTemplate id="SpecialPower_CorrupterHealBlast" TargetType="OBJECT" MaxCastRange="100" Flags="NEEDS_OBJECT_FILTER TARGET_NEEDS_OBJECT_STATUS NO_FORBIDDEN_MODEL_STATES" DisallowedTargetObjectStatus="CLONED USER_PARALYZED INSIDE_GARRISON" DisallowedTargetModelStates="HEALTH_PERCENT_100">
<ObjectFilter Rule="NONE" Relationship="ALLIES">
 <IncludeThing>AlienAnnihilatorTripod</IncludeThing>
 <IncludeThing>AlienCorrupter</IncludeThing>
 <IncludeThing>AlienDevourerTank</IncludeThing>
 <IncludeThing>AlienExplorer</IncludeThing>
 <IncludeThing>AlienGunWalker</IncludeThing>
 <IncludeThing>AlienHarvester</IncludeThing>
 <IncludeThing>AlienMastermind</IncludeThing>
 <IncludeThing>AlienSeekerTank</IncludeThing>
 </ObjectFilter>
 </SpecialPowerTemplate>
<WeaponTemplate id="AlienCorrupterTioxinHealCannon" Name="AlienCorrupterTioxinHealCannon" AttackRange="150.0" WeaponSpeed="999999.0" FiringLoopSound="ALI_Corrupter_BeamWeaponLoopMS" FiringLoopSoundContinuesDuringReload="true" AcceptableAimDelta="10d" RadiusDamageAffects="ALLIES" AntiMask="ANTI_GROUND ANTI_STRUCTURE" ClipSize="0" CanFireWhileMoving="true" ReAcquireDetailType="PER_CLIP">
 <FiringDuration MinSeconds="0.1s" MaxSeconds="0.1s"/>
<!--<ClipReloadTime MinSeconds="0s" MaxSeconds="0s" xmlns="uri:ea.com:eala:asset" />
 -->
<Nuggets>
 <ActivateStreamNugget Lifetime="0.75s" StreamId="0"/>
<!-- Heal to all allies 
 -->
<DamageNugget Damage="40.0" Radius="30.0" DamageType="HEALING">
<SpecialObjectFilter Rule="NONE" Relationship="ALLIES">
 <IncludeThing>AlienAnnihilatorTripod</IncludeThing>
 <IncludeThing>AlienCorrupter</IncludeThing>
 <IncludeThing>AlienDevourerTank</IncludeThing>
 <IncludeThing>AlienExplorer</IncludeThing>
 <IncludeThing>AlienGunWalker</IncludeThing>
 <IncludeThing>AlienHarvester</IncludeThing>
 <IncludeThing>AlienMastermind</IncludeThing>
 <IncludeThing>AlienSeekerTank</IncludeThing>
 </SpecialObjectFilter>
 </DamageNugget>
 </Nuggets>
 </WeaponTemplate>

ScriptEvents:

		<ScriptedEvent Name="HealRequest" />

	<EventList Name="AlienCorrupterEventsList" Inherit="BaseScriptFunctions">
		<EventHandler EventName="HealRequest"	ScriptFunctionName="OnAlienCorrupterReceiveHealRequest" DebugSingleStep="false"/>
	</EventList>

ScriptsLua:

function OnAlienCorrupterReceiveHealRequest(self,requester)
        ObjectDoSpecialPower(requester, "SpecialPower_CorrupterGetIntoRangeHealBlast")
end

Is there an easier way to do this?

Share this post


Link to post

You don't cast the special power on an object, so it either wont go off at all or it goes off at the Corrupter itself.

Dunno if it works but try ObjectDoSpecialPower(self, "SpecialPower_CorrupterGetIntoRangeHealBlast", requester) or something. Also from the way you've set it up it looks like the unit who wants to get healed is the one firing the SP.

Share this post


Link to post

This might be a big wild shot in the dark if your above code wont work but:

 

Thinking along the line of rage induction/halucination effect, to get the corruptor to target friendlies:

 

Have damaged units fire of a special weapon or aura that only induces rage into corruptors within a certain area.

Give the corruptor a second heal weapon that can only fire at units that have damaged modelcondition states and requires the rage status to be able to fire (think its EMOTION_DISSIDENT or something like that.) i think you need a secondary heal only weapon because the normal corruptor stream will start doing damage because allies become hostile to it during the rage.

 

A second idea would be trying to make a hybrid coruptor/repair drone unit? altho the attach update might look funny if the unit starts to move...you could do a paralize effect on anything being healed/repaired maybe?

 

edit: from a quick test i did the repair drone thing works rather well...the only thing you wont have is the weapon stream effect obviously. also you dont really need to paralize the unit to heal it, i used the gdi apc as test healer and it basicly pulls up to the unit and heals it, you can tweak this rather nicely with the attachupdate settings. The question is: is this something you want like this? you will have a unit that heals/repairs but more along the lines of a red alert medic/mechanic.

Edited by Ravendark

Share this post


Link to post

You don't cast the special power on an object, so it either wont go off at all or it goes off at the Corrupter itself.

Dunno if it works but try ObjectDoSpecialPower(self, "SpecialPower_CorrupterGetIntoRangeHealBlast", requester) or something. Also from the way you've set it up it looks like the unit who wants to get healed is the one firing the SP.

 

ObjectDoSpecialPower(self, "SpecialPower_CorrupterGetIntoRangeHealBlast" has the Corrupter fire at itself only. I remember a long time ago that Golan had some code that allowed for a structure to target another structure using the 'ObjectDoSpecialPower', but that information is long gone in one of the official EA forum purges.

 

A second idea would be trying to make a hybrid coruptor/repair drone unit? altho the attach update might look funny if the unit starts to move...you could do a paralize effect on anything being healed/repaired maybe?

 

edit: from a quick test i did the repair drone thing works rather well...the only thing you wont have is the weapon stream effect obviously. also you dont really need to paralize the unit to heal it, i used the gdi apc as test healer and it basicly pulls up to the unit and heals it, you can tweak this rather nicely with the attachupdate settings. The question is: is this something you want like this? you will have a unit that heals/repairs but more along the lines of a red alert medic/mechanic.

I am interested to see some of the code that went into this!

It is definitely worth investigating.

Share this post


Link to post

the code isnt that impressive its basicly the repair drone coding added to the apc...minus the slave part.

 

 

<PassiveAreaEffectBehavior
                id="ModuleTag_PassiveAreaEffect"
                EffectRadius="1"
                HealingPointsPerSecond="150"
                AffectAttached="true"
                AffectUnderAttack="true"
                NonStackable="false"
                HealFX="FX_Repair" >
                <AllowFilter
                    Rule="ANY"
                    Include="VEHICLE HUGE_VEHICLE"
                    Exclude="AIRCRAFT"
                    Relationship="ALLIES" />
            </PassiveAreaEffectBehavior>
        
            <AttachUpdate
                id="ModuleTag_Attach"
                Range="200"
                CloseEnoughRange="50.0"
                Teleport="false"
                UseGeometry="true"
                DetachWhenParentHealed="true"
                RequireFullyHealedToDetach="true"
                ScanForNewParentWhenDetached="true"
                DetachWhenParentOutOfSlavedRange="false"
                InitialAttachDelay="4.0s"
                ParentStatus="UNDERGOING_REPAIR"
                Flags="FIND_BEST_PARENT UNCONTAINED_ONLY SAME_PLAYER_ONLY ONE_ATTACH_PER_PARENT"
                >
                <ObjectFilter
                    Rule="ANY"
                    Include="VEHICLE HUGE_VEHICLE"
                    Exclude="AIRCRAFT"
                    Relationship="ALLIES" />
            </AttachUpdate>
 

if you add this to your corruptor it will auto move to damaged units and heal them....something to do would be to add some tiberiumlike/oozing effect insted of the repair sparks...and maybe find a way to to create an effect or stream from corruptor to target.

 

Edited by Ravendark
  • Upvote 1

Share this post


Link to post

Another quick test with a engineer set to heal infantry. works rather well....add some healing (little red or green crosses effect) effects instead of the welding sparks and you have your basic Tiberian sun medic..more or less.

 

  • Upvote 1

Share this post


Link to post

Another quick test with a engineer set to heal infantry. works rather well....add some healing (little red or green crosses effect) effects instead of the welding sparks and you have your basic Tiberian sun medic..more or less.

 

One thing that you didn't try/show but what I am quite interested in: can you still move the apc/engineer that is currently healing something away or is it in a locked state?

Share this post


Link to post

its in a locked state, the only thing i tried about that was setting RequireFullyHealedToDetach="true" to false but that didnt work, weirldy enough it perma binded the healer to the unit making it attach and follow it arround everywhere even when fully healed. Also it priority is healing over anything else so far, wich might be a undesirable effect in a combat unit.

 

What might be possible to do is maybe use the +SELECTED event condition to block the attach or area healing module from working....maybe.

 

i might work on this some more later to see what i can rig up.

Share this post


Link to post

Probably a detach special power, and a state toggle for autoheal/no autoheal

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.

×