Posted: Tue Dec 08, 2009 7:02 pm Post subject:
Do animations give a damn about warhead?
I have a unit that uses an animation in its weapon to self-destruct. The animation uses a specific warhead i have defined that should damage only armor type Concrete and has InfDeath=1 (twirl die). However the animation seems to damage everything equally much, and infantry end up with the "run-around-burning" death instead of the one i defined in the warhead. This leads me to believe warhead simply does not work on animations. Or am i doing something wrong? I have the both the warhead and the animation listed in the warheads and animations sections of Rules.ini.
Is there any other way to do this? I would like that the unit self-destructs, but the self-destruction should not cause damage to anything else than the unit itself, because the damage it deals to its targets comes from the weapon it fires. QUICK_EDIT
I just found out that it indeed works correct and perfectly fine the way it is.
You just have to understand how TS uses the warheads and anims, which is imo a very wise solution by WW.
TS knows 2 different types of anims: normal frame based anims and debris.
1. frame based anims like fire use by default the warhead "Fire2" which is set with the key "FlameDamage2=" in rules.ini [CombatDamage]. This is necessary to make sure, that the warhead has Sparky=no, or every anim with damage would create a feedback loop that creates more and more flames.
The damage on these anims is done on each frame, thus they also allow floating point damage like "0.06".
2. art.ini debris (like meteors) use perfectly fine the warhead which you assign to them. They just don't use the animation of the warhead, to again prevent a feedback loop where an art.ini debris creates a warhead anim which in turn could create an art.ini debris again.
The damage on these anims is done only once on impact, thus they only allow integer damage (Damage=0.99 would be changed to Damage=0).
After alot of testing I managed to make a nearly working suicide animation that does not damage other things apart from the suiciding unit. Problem is that i can't contain the damage to one square only, it sometimes spills to the nearby squares slightly. Using concrete armor on the suiciding unit or structure and making the animation warhead damage only concrete can make the problem nearly dissapear (still affects deployed tick tanks and a few structures). Here's the code:
Code:
[SUICIDEANIM]
Elasticity=0.0 ; This should prevent it from moving any further?
MaxXYVel=1.0 ; Can't make this less, and this is the key that causes the problem, the debris won't hit the very center of the square
MinZVel=0.0 ; Blow right on top of the square instantly
MaxZVel=0.0
ExpireAnim=EXPLOMED ; Can be whatever you want
Damage=2000 ; Needs to be quite a bit more than your suiciding unit has health, because the debris won't hit the very center of the square. My unit has 100hp and 1000 damage was not enough.
DamageRadius=0 ; Don't think this has ANY effect at all
Warhead=YourWarhead ; Make sure Spread=0 on the warhead
IsMeteor=true ; To make debris work
Spawns=METDEBRI ; To make debris work
SpawnCount=0 ; Don't want anything spawned
LoopStart=0 ; Not sure these are needed
LoopEnd=8
LoopCount=-1
RandomRate=0,0 ; What does this do????
DetailLevel=0 ; Make sure this is played
Surface=yes ; Not sure any of these 3 have any relevance
Flat=yes
Sticky=yes
Can anyone think of a way to limit the debris damage to only the square where the suiciding unit or building was? It hardly is a problem for my unit since it uses concrete armor, but if it could be limited to one square it would allow you to use any armor type you want. QUICK_EDIT
Tried another method of doing it with particles. Only way i could make a particle attached to a weapon damage the shooter itself was by giving the weapon UseFireParticles=yes, giving the weapon an attached particle system that behaves like fire, and that particle system holds a particle that behaves like gas. Something like this:
I coulnd't get this to work but with some adjustments i know it works, cause i tried a slightly modified version of the FireSteamSys and it did damage the shooter itself. But the real problem is that if you use this way, you can't use the units normal weapon. The main weapon gets overrided by the flame shooter. What i wanted to do is make the weapon spawn the suicideparticle AND shoot its normal weapon. This can be done with spark particles (but they won't cause any damage). Gas particles can't be used on a weapon, only in warhead. Fire particles on the other hand seem to override any weapon you had given the unit (at least it didn't use the projectile i had given the weapon, which should have used airburst logic). QUICK_EDIT
try the following. I haven't tested it but it should work and kill the firing unit. However i doubt that this won't do damage on adjacent cells.
btw, check your units FireFLH in art.ini. If this is too far to the front (the F value), the muzzleflash anim or particlesystem will always hit the adjacent cell, regardless what you set on your warhead.
With your original code the results were mixed. Sometimes the unit blew up, but more often the unit next to it with concrete armor blew up, and not the unit itself. I tried giving the particle some image to see what was going on, and there was a smoke hovering above the unit. Not sure why it damaged things near it more often though.
EDIT: Not sure why i keep talkin about a unit, it's a building i am testing this on. The building is size 1x1 and has no PrimaryFireFLH defined. I tested with PrimaryFireFLH=-50,0,0 too, and i couldn't get it to work. Still sometimes the nearby units exploded instead of the suiciding one.
I tried tweaking the settings and the most working thing i got is this:
This will destroy the suiciding unit always, and might cause very little damage to a few squares next to it (often 1 up to 3). The damage is so slight that i wouldn't mind it at this point anymore. However there is a catch (seems like there always is when you get something working in this game...). Because the particle BehavesLike=Gas, the suiciding unit that gets destroyed will spawn a baby visceroid. I'm guessing there is no way to avoid this without breaking the chemical missile and other things that are supposed to spawn them. It would be alot easier to do this if there was a list somewhere that explains more of the keys related to particles. QUICK_EDIT
If it's a building, just give it an ActiveAnim
e.g.
Code:
ActiveAnim=SUICIDEANIM
[SUICIDEANIM]
Image=INVISO
Damage=1
Rate=900 ;play the anim as fast as possible (900 frames per minute)
LoopStart=0
LoopEnd=1
LoopCount=-1
This should destroy the building very fast and due to the very low damage, no adjacent cell will receive damage. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Unfortunately the building is a mine that is deployed and waits for an enemy to get close. The problem i'm having with it is i have a special weapon that i want it to use, but i can't get the unit to self-destruct without causing damage to others near it. Just want it to use its main weapon and not cause damage by anything else. The particle system thing works perfect apart from the visceroid problem . With the debris thing you put a certain armor type at risk of being instantly destroyed (given the concrete armor works pretty well for this). QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum