Ok I am thoroughly confused now. I read in manual section 3.4.4.
3.4.4. "self.destruct"
To set up an enemy destruction animation find the line that says "def self.destruct" after the
line "module Enemies" and the one below that says "case id". There are various when-then
branches where you can set up which weapon belongs to which type. Use the following
template to set up the configuration:
when ID then return ANIMA
ID - weapon ID in the database
ANIMA - animation ID in the database
example:
when 7 then return 12
In the example above after the enemy with ID 7 dies the animation with ID 12 would be
played once. Keep in mind that a "cloaked" enemy will "die" using his default animation
regardless of the "cloaking" spriteset. Default value is 0.
So searching the ABS scripts I find the referred to lines in first script
module Enemies
def self.type(id)
return 0
end
def self.range(id)
return 1.5
end
def self.enemy_set(id)
return ''
end
def self.destruct(id)
return 0
end
end
end
Though I do not find the referred to "case id" nor the "various when-then branches" there. So I assume that is because I haven't created them yet. What confuses me though is the bit about using the enemy's weapon ID to identify which enemy's death sprite should be used. That doesn't make any sense to me.
I could understand if it needed to know the weapon of the actor causing the enemy's destruction so that it would know what kind of death sprite should be used such as a flaming dance of death for when a flamethrower is used to slay the enemy or exploding into a gory mess when a grenade is thrown at it but I don't understand what the weapon type of the enemy has to do with what it's death animation should look like.
Also I was under the impression that enemies did not have specific weapon identifications associated with them as actors do. Or has that changed from 95 to 98? I was last using 1.95 and only just now updated to 1.98 when I set out to try wink's suggestion. Is there any way I can just use the enemy's database slot number in the when/then statements to tell BABS which death sprite to use? Another thing too is it refers to the animation's ID in the database. I wasn't aware that animations were listed in the database. I have been just naming my animations a certain way so that Blizz recognizes them and uses them automatically without any reference to the database.
And also that would be cool if, as suggested above, I could provide for different death animations depending on what weapon is used to slay the enemy. Also, it says the animation would be played once. Then what? Would it still disappear as before? As I said in my previous post I need it to stay there and not disappear untill the actors have a chance to loot it's corpse. Also it would be cool if it could stay there and slowly change from a full sized body to a shriveling dessicated one and finally to a skeleton and some bits of clothing which is really just two more sprites that dont even need to be animated or I guess they could be added into the death animation if the usual four frames could be extended to six and the last two frames only played much further apart in game time.
EDIT: Ok I tried sticking with the above instructions. I moved my enemy's death sprite from the character folder to the animation folder and imported it and added it in the database as a new entry 101 in animations. Then I added the following line in the abs1 config script under "def self.destruct" : "when 33 then return 101" so it looks like this:
def self.destruct(id)
when 33 then return 101
return 0
end
33 is the database ID of the enemy I am using. But when I test it I get an error for that line I inserted. Did I get the syntax wrong? Should I put an else before the "return 0" ? I'll try that.