Duke4.net Forums: Question: Alternative Death Animations for Enemies? - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Question: Alternative Death Animations for Enemies?  "For Enemy AI"

User is offline   Mitchell F 

#1

Hi, I'm a relatively unskilled coder so sorry if this is a newbie question.

I have been trying to give the Troop an alternate death animation, so that sometimes his head will explode. This is really just copy pasting the code for "ATROOPYDYING" and "ATROOPDEAD" and changing the names of the actions. For some reason, though, when it comes time for him to be dead, he gets back up and glitches out. He becomes unhittable and starts shooting at the player. I know that the issue isn't with the dying animation, because if I have him use the alternate dying action and then use the vanilla ATROOPDEAD dead action then there's not a problem (aside from his head being unexploded of course).

Is this just something that the game is not meant to do and I'll need a creative work around like using "killit" and then spawning the dead body? I can supply the code, but like I said it's identical to the original code other than the names of actions being changed. I'm kind of at my wit's end and I don't know what to try next.

Regards.

This post has been edited by Mitchell F: 13 October 2018 - 01:10 AM

0

User is online   Mark 

#2

If you want the new death action on just certain Troopers you could code it depending on the pal of the Trooper. No need to duplicate a chunk of code. Or you can use the ifrnd command to choose randomly between the 2 actions. Again, no need to duplicate code.
0

#3

The AMC TC has the head exploding animation on Troopers and other Alien enemies if you're in need of sprites. As for codes I'm sure they won't mind telling you how they did it ^_-

Unless, if I understood correctly, you're looking for an alternative way of displaying said alternative deaths ?

This post has been edited by TheDragonLiner: 13 October 2018 - 06:28 AM

0

User is online   Danukem 

  • Duke Plus Developer

#4

View PostMitchell F, on 13 October 2018 - 12:59 AM, said:

This is really just copy pasting the code for "ATROOPYDYING" and "ATROOPDEAD" and changing the names of the actions.


There's something else that you need to do. Maybe more than one thing. It's hard to say without seeing your code. Based on your description, the trooper is able to resume normal AI functions while dead, because your new death animtions are not being handled the same way that the old death animations are. Most likely, it something simple such as a part of the code where it says "ifaction ATROOPLYINGDEAD break" but there is no equivalent break for your new lying dead action.
0

User is offline   Mitchell F 

#5

View PostTrooper Dan, on 13 October 2018 - 09:30 AM, said:

Most likely, it something simple such as a part of the code where it says "ifaction ATROOPLYINGDEAD break" but there is no equivalent break for your new lying dead action.


You were exactly right. You're a godsend Dan!
0

User is offline   F!re-Fly 

#6

A subject already treated: the possibility of killing a Liztroop while seated (JUSTSIT), when he shits (ONTOILET) and when he suffers (ATROOPSUFFERDEAD). All this instantly by "HITRADIUS" It would be nice to add these values in the monster code.
0

User is offline   RPD Guy 

#7

Hi,

In Brutal Duke I simply kill the current TROOP actor and spawn my custom actor.
I did this because the original game code is very confusing.
I don't know if this is a good choice, but it works very fine.


GAME.CON:

[...]
// Choose where you want to trigger your animation
state checktroophit
    ifaction ATROOPSUFFERING {
        stopsound LIZARD_BEG
        ifwasweapon SHOTSPARK1 {
            ifvare p_curr_weapon SHOTGUN_WEAPON {
                ifpdistl 2048 {
                    // I've chosen here.
                    state troop_spawn_behead // TROOP.CON
                } else {
                    sound PRED_DYING
                    cstat 0
                    strength 0
                    action ATROOPSUFFERDEAD
                    break                  
                }
[...]


TROOP.CON:

[...]

// My actor's definition
define TROOPBEHEAD 9007
spritenoshade TROOPBEHEAD

action a_troop_behead       0 3 1 1 16
action a_troop_behead_floor 2 1 1 1 1

useractor enemy TROOPBEHEAD
    fall
    state getDefaultShade
    state getOwnerPal
    ifaction 0 {
        sizeat 40 40
        cstat 0
        state blood_gushing
        state blood_gushing_sounds
        ifcount 50 {
            action a_troop_behead
        }
    }
    ifaction a_troop_behead {
        ifactioncount 3 {
            sound GORE_DRIP1
            ifrnd 128 {
                cstat 4
            } else {
                cstat 0
            }
            action a_troop_behead_floor
            ifrnd 128 {
                sound SQUISHED
            } else {
                sound SQUISHED2
            }
            spawn BLOODPOOL
            break
        }
    }

[...]

// Here I switch the actors. (Called in state checktroophit, GAME.CON)
state troop_spawn_behead
    state troop_head_jibs
    ifrnd 128 {
        sound SQUISHED
    } else {
        sound SQUISHED2
    }
    spawn TROOPBEHEAD // Here my custom actor will spawn
    addkills 1
    killit // Here the default TROOP actor will disappear
    break
ends
[...]


Don't forget to do your custom actor (TROOPBEHEAD) to inherit it's owner pal number.

Download and take a look over the code here --> https://forums.duke4...rk-in-progress/

This post has been edited by RPD Guy: 18 October 2018 - 11:02 AM

0

User is offline   F!re-Fly 

#8

I managed to modify the alternative deaths of Liztroop. He can now die instantly, when he is seated or when he is at the toilets. Death when it dies? I preferred to do nothing for now.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options