Random Corpses.
Moderator: Moderators
Random Corpses.
Um, pretty much like the random voices thing, only for corpses. Right now, they aren't random- they follow a linear progression. And, at least so far as I can tell, the whole corpse= lines in Killed() don't seem to actually do anything. Feel free to explain, if I've missed something there.
Also, while I'm asking for stuff, could somebody in the LUA community please develop a LuaCOB that will let me replace a dead Unit with another Unit upon Killed() and then assign that Unit to the Gaia?
I just want to be able to animate the dead a lot more interestingly, with control over smoke, flames, sparkly bitz, etc., etc. I think that the ideal way to go about this is to simply replace the dead Unit with another Unit that gets assigned to Gaia, so that nothing will target it further- then I can "just" animate the actual moment of death in Killed(), call a new Unit to replace the one I just destroyed, and have that new Unit do whatever it is I want it to. Dead things in Spring are, just like everything else having to do with Features, really bland, and need scripting support. I just haven't got the time this week to do further LUA stuff (trying to deliver a big build to the team and stuff), so if anybody has time and can write a complete script that will do this fairly-simple task, I'd really appreciate it (and yes, you'll get your name in our Credits, and yes, we're perfectly happy if you want to GPL whatever you write).
Also, while I'm asking for stuff, could somebody in the LUA community please develop a LuaCOB that will let me replace a dead Unit with another Unit upon Killed() and then assign that Unit to the Gaia?
I just want to be able to animate the dead a lot more interestingly, with control over smoke, flames, sparkly bitz, etc., etc. I think that the ideal way to go about this is to simply replace the dead Unit with another Unit that gets assigned to Gaia, so that nothing will target it further- then I can "just" animate the actual moment of death in Killed(), call a new Unit to replace the one I just destroyed, and have that new Unit do whatever it is I want it to. Dead things in Spring are, just like everything else having to do with Features, really bland, and need scripting support. I just haven't got the time this week to do further LUA stuff (trying to deliver a big build to the team and stuff), so if anybody has time and can write a complete script that will do this fairly-simple task, I'd really appreciate it (and yes, you'll get your name in our Credits, and yes, we're perfectly happy if you want to GPL whatever you write).
Yeah, I know, but that's not the same as, "on Killed(), roll a random number, pick 1 of 5 animations for the death sequence, then based on that death sequence, replace the Unit with 1 of 5 Units, assigned to Gaia, that each reflect the particulars of the death sequence in a natural way".
For example, what if my Giant Mech of Doom has one death sequence where it ends with one leg blown off, but the corpse always has two, intact legs? What about a gasoline tanker that blows up, and I want it to show a huge fireball, and then replace it with a model that is two different parts, all blackened and broken, and then have them do a further animation showing the spectacular results of the fiery BOOM! In DoW, units die in lots of ways, including what are referred to as "sync-kills", where a particular weapon causes a particular death sequence. Well sure, we now have HitByWeaponID, so we can detect those weapons- that's great, but, again, if we do that in Killed(), but then the resulting corpse has nothing to do with the death... we're breaking immersion here. Kind've important, if we're going to have pro-quality games, frankly.
For example, what if my Giant Mech of Doom has one death sequence where it ends with one leg blown off, but the corpse always has two, intact legs? What about a gasoline tanker that blows up, and I want it to show a huge fireball, and then replace it with a model that is two different parts, all blackened and broken, and then have them do a further animation showing the spectacular results of the fiery BOOM! In DoW, units die in lots of ways, including what are referred to as "sync-kills", where a particular weapon causes a particular death sequence. Well sure, we now have HitByWeaponID, so we can detect those weapons- that's great, but, again, if we do that in Killed(), but then the resulting corpse has nothing to do with the death... we're breaking immersion here. Kind've important, if we're going to have pro-quality games, frankly.
No, because that just sends me to a given Feature, which has to be in the FeatureDead hierarchy. When a Unit dies, that whole corpsenum thing refers back to the chain of Features called by FeatureDead, like this:
So, if you declare corpsenum == 4, then I think it automatically reverts to corpsenum 1, which in this case is misc_wreckage_2x2a. If you declare it to be 3, then it will be misc_wreckage_2x2a3, but when it dies, since that one doesn't list a featureDead, it simply disappears. See? Pretty gosh-darn inflexible, and since it uses Features, which we all know how much I hate anyhow, it won't support animation, custom sounds, etc.! This is not a terribly-good system, if you have units that are visually very different from one another, or want to have really awesome death animations- the amount of visual disconnect that's created is very annoying, frankly.
[/code]
Code: Select all
[misc_wreckage_2x2a]
{
world=All Worlds;
description=Misc. Wreckage;
object=wreckage/2x2a.s3o;
featuredead=misc_wreckage_2x2a2;
footprintx=2;
footprintz=2;
height=0.1;
blocking=0;
hitdensity=100;
metal=75;
damage=200;
reclaimable=1;
}
[misc_wreckage_2x2a2]
{
world=All Worlds;
description=Misc. Wreckage;
object=wreckage/2x2a2.s3o;
featuredead=misc_wreckage_2x2a3;
footprintx=2;
footprintz=2;
height=0.1;
blocking=0;
hitdensity=100;
metal=50;
damage=200;
reclaimable=1;
}
[misc_wreckage_2x2a3]
{
world=All Worlds;
description=Misc. Wreckage;
object=wreckage/2x2a3.s3o;
footprintx=2;
footprintz=2;
height=0.1;
blocking=0;
hitdensity=100;
metal=50;
damage=200;
reclaimable=1;
}
[/code]
Why dont you just use gadget:UnitDestroyed instead of messing with lua<->cob? far far simpler.
Try not to think fo lua as extending cob but simply as a scripting language in its own right. Sometimes its better to replace a limited spring feature entirely with your own in lua.
Look at the voices widget in CA for example.
Try not to think fo lua as extending cob but simply as a scripting language in its own right. Sometimes its better to replace a limited spring feature entirely with your own in lua.
Look at the voices widget in CA for example.
If you refer to a non-existing corpse number (say, number 4 in a 3-corpse sequence), then no corpse is created at all. Useful sometimes (for example when damage is so great the unit is blown up into pieces).
Also, if a number greater than 1 is specified for a corpse in Killed(), that corpse cannot be resurrected back to a unit.
I use corpsenum for floating vehicles which leave a blocking corpse on land but a non-blocking one in water (so that it doesn't stay at the surface). The downside is, of course, that the second corpse cannot be resurrected.
Also, if a number greater than 1 is specified for a corpse in Killed(), that corpse cannot be resurrected back to a unit.
I use corpsenum for floating vehicles which leave a blocking corpse on land but a non-blocking one in water (so that it doesn't stay at the surface). The downside is, of course, that the second corpse cannot be resurrected.
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07