To make an enemy as subtype biker but with anim fall

Steven1985

Active member
Hi,
I'd like to make an enemy as subtype biker but having in the file header anim fall that is played when his heath is 0, I can't put in it "subtype biker" below type enemy.
Thank you in advance.
 
Are you trying to make enemy which moves back n forth like a biker enemy but when he/she/it is defeated, he/she/it will play anim fall? The fall animation is similar to any default character right?
 
Are you trying to make enemy which moves back n forth like a biker enemy but when he/she/it is defeated, he/she/it will play anim fall? The fall animation is similar to any default character right?
Exactly. I'd like that when the enemy is hit, he plays normally anim pain but keeps on moving back 'n' forth like a biker and when his health is 0 he plays anim fall.
 
Alright, after finding proper character to show this, I've made this enemy called GoonRun.
As his name implies, this enemy runs all of the time and act like SoR2 biker. However, he reacts like normal enemy if struck by attacks.

HTH
 

Attachments

@Bloodbane I tested the enemy that you put and it's ok. I created a simpler form with aimove biker.
C:
name    Hogg
health    100
type    enemy
 
projectilehit   enemy obstacle trap
hostile player npc obstacle
candamage player npc obstacle

aimove biker

anim    idle
    loop    1
    move 8 #I had to put "move" otherwise the enemy does not move
    offset    70 79
    delay    4
    bbox    19 3 38 53
    #attack    57 31 82 49 35 1 0 0 0 0
    frame    data/chars/enemies/bosses/hogg/hogg1.gif
    frame    data/chars/enemies/bosses/hogg/hogg2.gif
  
anim pain
    loop    0
    offset    70 79
    delay    4
    frame    data/chars/enemies/bosses/hogg/hogg3.gif
  
anim fall
    offset 39 53
    delay 4 
    frame  data/chars/enemies/bosses/hogg/fall1.gif
    offset 100 51
    delay 4
    frame  data/chars/enemies/bosses/hogg/fall2.gif
    offset 61 56
    delay 4
    frame  data/chars/enemies/bosses/hogg/fall3.gif
    offset 78 26
    delay 4
    frame  data/chars/enemies/bosses/hogg/fall4.gif
Is all right however? And "nomove 0 1" works. :)
 
Well, if it works for you then you could use it.
I prefer using script so I could control where the enemy would pick the next z coord after leaving the screen.
 
It's hard to explain in detail. Here's the script though:
C:
anim    follow1
@script
    if(frame>=1){
      void self = getlocalvar("self");
      int x = getentityproperty(self, "x"); // Get current x coordinate
      int z = getentityproperty(self, "z"); // Get current y coordinate
      int Dir = getentityproperty(self, "direction"); // Get current facing direction
      int Screen = openborvariant("hResolution"); // Get screen length
      int XPos = openborvariant("xpos"); // Get scroll position
      int MinZ = openborvariant("PLAYER_MIN_Z");
      int MaxZ = openborvariant("PLAYER_MAX_Z");
      int R = rand()%15;
      int Zidth = MaxZ - MinZ;
      int Step = Zidth*0.17;
      int Tz;

      if(z <= MinZ + Step*2){
        Tz = MinZ + Step*3 + R;
      } else if(z <= MinZ + Step*4){
        Tz = MinZ + Step*5 + R;
      } else {
        Tz = MinZ + Step + R;
      }

      if((x >= XPos + Screen + 100) && Dir == 1){
        changeentityproperty(self, "direction", 0);
        changeentityproperty(self, "position", XPos + Screen + 100, Tz);
        changeentityproperty(self, "velocity", -2);
      } else if((x <= XPos - 100) && Dir == 0){
        changeentityproperty(self, "direction", 1);
        changeentityproperty(self, "position", XPos-100, Tz);
        changeentityproperty(self, "velocity", 2);
      }
    }
@end_script
...

Basically the script splits the field into 3 sections. Then when enemy goes offscreen, it checks the current z coord to see in which section enemy is then change it to next section. There's a small randomizer to move enemy slightly back or front.
 
Back
Top Bottom