remove condition?

Information and discussion for custom maps and mods.
Post Reply
bodomalo
Posts: 37
Joined: Tue Feb 20, 2018 7:35 pm

remove condition?

Post by bodomalo »

Is there a valid way to REMOVE a granted condition? or to turn it OFF?

I do not want it to be a timed condition.


Example: my warhead grants a condition "burning" to all targets around 3 fields.
with that condition vehicles burn, and are destroyed slowly.

I would like a way to stop this condition
- when the unit is 100% repaired

but there does not seem to be a way to remove conditions.
how do I toggle a condition on-off?
There is ToggleConditionOnOrder...but I do not understand its concept.

SirCake
Posts: 393
Joined: Thu Feb 04, 2016 5:40 pm

Post by SirCake »

You could use another condition and connect those two.

Didn't test it but I think the condition granted when on 100% health is called "Undamaged" or "undamaged". Or you might have to use GrantConditionOnDamageState to generate a condition that is called undamaged, not sure.

Now "burning && !undamaged" (burning and not undamaged) should be your condition for dealing damage to the unit when it burns and doesn't have 100% health. There is also || which means "or". Note that there have to be spaces before and after && and || but not after ! .

Check out Dune2k-Advanced on my moddb page!

bodomalo
Posts: 37
Joined: Tue Feb 20, 2018 7:35 pm

Post by bodomalo »

SirCake wrote: You could use another condition and connect those two.

Didn't test it but I think the condition granted when on 100% health is called "Undamaged" or "undamaged". Or you might have to use GrantConditionOnDamageState to generate a condition that is called undamaged, not sure.

Now "burning && !undamaged" (burning and not undamaged) should be your condition for dealing damage to the unit when it burns and doesn't have 100% health. There is also || which means "or". Note that there have to be spaces before and after && and || but not after ! .
I was thinking about that way, just now.
But, as soon as the damage state will be below 100% (!undamaged), the condition burn will simply start again.

I was hoping that I can "destroy" the condition "burning" with another weapon-warhead, that weapon should apply the condition "burning" again, but with a time=1 tick... (so it will actually stop the burning condition)
This might be an option, but it is too complicated to manage.
My only idea was to have a weapon (maybe for the repair station), that automatically fires onto my OWN units, with a warhead that gives the condition "burning" for 1 tick.

But is it possible to have an auto-attack-myself weapon?

bodomalo
Posts: 37
Joined: Tue Feb 20, 2018 7:35 pm

Post by bodomalo »

SirCake wrote: You could use another condition and connect those two.

Didn't test it but I think the condition granted when on 100% health is called "Undamaged" or "undamaged". Or you might have to use GrantConditionOnDamageState to generate a condition that is called undamaged, not sure.

Now "burning && !undamaged" (burning and not undamaged) should be your condition for dealing damage to the unit when it burns and doesn't have 100% health. There is also || which means "or". Note that there have to be spaces before and after && and || but not after ! .

so my follow-up question:
Is there a way to auto-target-myself with a specific weapon?

or auto-attack-myself
RequiresCondition burning

(so I would apply a new warhead that grants the condition "burning" again, but limited to 1 tick)

SirCake
Posts: 393
Joined: Thu Feb 04, 2016 5:40 pm

Post by SirCake »

I'm not sure I understand your question anymore.

A warhead should only apply a condition in the tick where the effect or damage is dealt.
I'd like to know how you managed to permanently apply a condition with a warhead. Maybe from there we can find an answer.
Are you using lua, because IF, the answer is really simple. But from what you were saying, I guess you are using yaml only.

Please post some example code for your weapon/warhead and the actor type which you want to burn.

Check out Dune2k-Advanced on my moddb page!

User avatar
Materianer
Posts: 199
Joined: Mon Jul 04, 2016 8:27 am

Post by Materianer »

I dont know if that helps you with your problem but watch in this map.
https://resource.openra.net/maps/25987/

You can set a negative healing on an actor here a church for example

Code: Select all

V25:
	SelfHealing:
		Step: -30
		Delay: 25
		HealIfBelow: 40000
	WithDamageOverlay@LightBurn1:
		DamageType: Incendiary
		Image: burn-ch
		MinimumDamageState: Light
		MaximumDamageState: Dead
	WithDamageOverlay@LightBurn3:
		DamageType: Incendiary
		Image: burn-xse
		MinimumDamageState: Medium
		MaximumDamageState: Dead
	WithDamageOverlay@LargeBurn5:
		DamageType: Incendiary
		Image: burn-xt
		MinimumDamageState: Heavy
		MaximumDamageState: Dead
bodomalo wrote: so my follow-up question:
Is there a way to auto-target-myself with a specific weapon?

or auto-attack-myself
RequiresCondition burning

(so I would apply a new warhead that grants the condition "burning" again, but limited to 1 tick)
Autotarget yourself without lua will not work i think, you could maybe set a warhead with area damage on an actor that hits nearby units.

Maybe its the best you explain us what you exactly want to do.

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

You can't autoattack yourself without using custom engine variants - I do have traits for this though, but they aren't committed to upstream yet.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

bodomalo
Posts: 37
Joined: Tue Feb 20, 2018 7:35 pm

Post by bodomalo »

SirCake wrote: I'm not sure I understand your question anymore.

A warhead should only apply a condition in the tick where the effect or damage is dealt.
I'd like to know how you managed to permanently apply a condition with a warhead. Maybe from there we can find an answer.
Are you using lua, because IF, the answer is really simple. But from what you were saying, I guess you are using yaml only.

Please post some example code for your weapon/warhead and the actor type which you want to burn.
So far, this is how I apply a condition named "firehit"

Code: Select all

Napalmcar:
	Inherits: ^FlameWeapon
	ReloadDelay: 4
	Range: 4c0
	Burst: 6
	BurstDelays: 2
	-Projectile:
	Projectile: GravityBomb
		Image: BOMBLET
		Shadow: true
	Warhead@1Dam: SpreadDamage  
		Spread: 341
		Damage: 5000
		Falloff: 1000, 668, 535, 150, 18, 7, 0
		Versus:
			Wood: 35
			Heavy: 80
	Warhead@condi: GrantExternalCondition  
		Condition: firehit
		Range: 2c255
    ValidTargets: Ground, Infantry, Vehicle


and on the vehicle:

Code: Select all

	WithIdleOverlay@BURNER:
		Sequence: burner
		Offset: -156,0,50 
		RequiresCondition: firehit             
	SelfHealing:
		Step: -50
		Delay: 10
		HealIfBelow: 99
		RequiresCondition: firehit 
This lets every vehicle have a fire animation on it, and a negative SelfHealing, as soon as the condition "firehit" is given to the unit (distance 2 .25 fields)
The negative effect of healing does only work below 99% of damage...so at 100% it has just the burning animation, but does not suffer damage....

If I add:
Duration: 200
to the warhead, it will burn for 200 ticks. (But this again is stupid, because even if I repair the vehicle, it will burn for 200 ticks...also after the repair)

My goal is to stop the condition "firehit" forever when
a) it reaches a 100% health
or
b) it comes close to the fix building / repair vacility (repair weapon maybe)

It does not help to have a 2nd condition...

bodomalo
Posts: 37
Joined: Tue Feb 20, 2018 7:35 pm

Post by bodomalo »

Materianer wrote: Autotarget yourself without lua will not work i think, you could maybe set a warhead with area damage on an actor that hits nearby units.

Maybe its the best you explain us what you exactly want to do.
What I want:

A suicide car that only has a small explosion (not the nuke), if it explodes, nearby vehicles should start burning, and suffer a slow death.

The owner should be able to repair his vehicle and STOP the fire.

(So far I am able to stop the damage at 100% (fire animation is still shown), but as soon as the vehicle is hit again, and reaches 99% health, the self-destruction will start again, as the condition fire-hit is permanent....)

I could give the condition a duration (which will not solve the problem of burning vehicles that are at 100% health as long as the duration time is not over)


My only idea so far is to create a kind of fireman unit, and you have to attack your own burning vehicle with that firemans "weapon", and its warhead overrides the "firehit" condition, (including a duration of 1 tick instead of unlimited). (I did not test that anway, I dislike the idea of having a "fireman" unit..and the idea that you need to attack your own unit with it... way too complicated)

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

What if you tie taht logic to the husk of the suicide car?

Asin, give the suicide car a "husk" actor which has the image of a fire, and damage everything around it through a proximity condition which grants affected units around a negative selfhealing.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

bodomalo
Posts: 37
Joined: Tue Feb 20, 2018 7:35 pm

Post by bodomalo »

Graion Dilach wrote: What if you tie taht logic to the husk of the suicide car?

Asin, give the suicide car a "husk" actor which has the image of a fire, and damage everything around it through a proximity condition which grants affected units around a negative selfhealing.
Not a bad idea. Different approach.

Just a little bit strange is: If another (not involved) vehicle comes closer to the husk (after the explosion), it will start burning...
or if you drive away 10 fields, it stops burning, if you turn and come back closer, the vehicle starts burning again. Little bit strange effect.


BTW: Is the any damagestate between "heavy, critical and undamaged" ?
I was playing around with damagestates and would like to check for a "99% or below" state...or "!undamaged"

bodomalo
Posts: 37
Joined: Tue Feb 20, 2018 7:35 pm

Post by bodomalo »

Another question:
Can I count the number of times a condition has been granted?

RequiresCondition: burning < 1

Does not help me at the moment...but maybe I could have 2 conditions and
check it like that:

Code: Select all

 RequiresCondtion&#58; burning > stopburning

SirCake
Posts: 393
Joined: Thu Feb 04, 2016 5:40 pm

Post by SirCake »

Hey, just realized you are using a trait that is only used in TS mod (unfinished and unsupported) once.
It is highly likely that what you want is not possible with the current engine. I had that situation quite a number of times. You can use some lua hacks (add a lua script to your map) to get around this though. (Or just accept it and use a timed condition which isnt too far of for fire anyways)

I am 100% sure you can use LUA Trigger.OnRemovedFromWorld, GrantCondition(lua version), RevokeCondition to get to the behaviour you want. Might take some tinkering and performance optimization, but you should be able to get there if you really want it.

Check out Dune2k-Advanced on my moddb page!

Post Reply