Jump to content
iowatyre

Autoheal until % of HP

Recommended Posts

I would like to ask how to implement autoheal until 50% of HP. Is it here? Tried modelconditions, didn't work. Any help would be appreciated.

            <AutoHealBehavior
                id="C07BF5C1"
                RequiresAllTriggers="False"
                RequiresAllConflictingTriggers="False"
                Permanent="False"
                WaypointMode="False"
                WaypointModeTerminal="True"
                HealingAmount="60"
                HealingDelay="0.5s"
                StartHealingDelay="1s"
                Radius="0"
                KindOf=""
                HealFXList=""
                SpawnFXList=""
                RespawnMinimumDelay="0s"
                InitiallyActive="True"
                AffectsWholePlayer="False"
                AffectsContained="False"
                HealOnlyIfNotUnderAttack="False"
                HealOnlyIfNotInCombat="False"
                HealOnlyOthers="False"
                NonStackable="False"
                RespawnNearbyHordeMembers="False">
                <AllowFilter
                    Rule="ANY"
                    Relationship="SAME_PLAYER"
                    Alignment="NONE"
                    Include=""
                    Exclude=""
                    StatusBitFlags=""
                    RejectStatusBitFlags=""
                    AcceptModelCondition="REALLYDAMAGED DYING"
                    RejectModelCondition="PRISTINE DAMAGED"/>
            </AutoHealBehavior>
 

Share this post


Link to post

1. the allowfilter is mostlikely coupled to the radius attribute, and it will prob only effect other then self objects.

2. I can't think of a direct (existing) way to do what you want, but you could prob do it with lua scripting and iirc there are modelcondtions for 0-25-50-75-100 % health, so those might be interesting to use as triggers instead of the dmg conditions.

Share this post


Link to post

I think 50% health or damaged conditions can works, I recall I saw xml use health condition once, don't recall where and why

 

Maybe you can also make upgrade that will disable the AutoHealBehavior once health had reached 100% to create a loop?

Don't know if it possible though

Share this post


Link to post

Thanks for the tip Ravendark. Another question though, how would I stop the autoheal? I had the autoheal start at 25% HP below. Any ideas?

Edited by iowatyre

Share this post


Link to post

You can trigger the autohealnehavior with a upgrade

<TriggeredBy>upgrade_starthealing</TriggeredBy>

or something like it.

if you remove that upgrade (using a modelconditionevent +HEALTH_PERCENT_50) it will stop healing.

so start with:
 

function OnReach25Health(self)
            ObjectGrantUpgrade( self, "Upgrade_StartHealing" )
end

function OnReach50Health(self)
            ObjectRemoveUpgrade( self, "Upgrade_StartHealing" )
end

and in your evenlist

<ModelConditionEvent Name="Reach25Health">
            <Conditions>+HEALTH_PERCENT_25</Conditions>

</ModelConditionEvent>

<ModelConditionEvent Name="Reach50Health">
            <Conditions>+HEALTH_PERCENT_50</Conditions>

</ModelConditionEvent>

<!-- Add these handlers to each unit that needs self healing -->
        <EventHandler EventName="Reach25Health" ScriptFunctionName="OnReach25Health" DebugSingleStep="false"/>
        <EventHandler EventName="Reach50Health" ScriptFunctionName="OnReach50Health" DebugSingleStep="false"/>

try that
 

  • Upvote 1

Share this post


Link to post

Thanks for the reply. Unfortunately, it didn't work. Chose to use a powerpack upgrade instead. Does anyone know how to implement a drop pod unit creation? The one that makes the unit immediately arrive on a drop pod at the rally point instead of coming out of the warfactory?

Share this post


Link to post
Quote

The one that makes the unit immediately arrive on a drop pod at the rally point instead of coming out of the warfactory?

AFAIK you will need to spawn the pod first and then tell it to spawn the real unit after some time pass/upon self destruct.

there are also few other ways but the one above is the most common one.

 

 

Edited by Egozi44

Share this post


Link to post

I had the pod working, but it doesn't arrive on the rally point. It is always on the top of the warfactory. I tried BuildCompletion="APPEARS_AT_RALLY_POINT". Still didn't work. 

Share this post


Link to post

Umm, I recall I had the same issue when I tested it for something else back at the day but I don't recall how I fix it (if I even did... well I do recall it working at some point so I probably...did? )

maybe it had something to do with the pod not being a moveable unit in the kind of? 

 

I need to peek on the pod'a xml when I get home, one thing that keep flicking my head is that the pod is more or less a prop, similar to dummy just with few more visual approaches, it missing a lot of things normal unit should have so I won't be surprised if it just not set to be movable on default. 

Edited by Egozi44

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.

×