Jump to content

Photo

GB enemies


  • Please log in to reply
25 replies to this topic

#1 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 01 January 2015 - 11:14 AM

Yo, people!

Well, my 1st request of 2015 :cat: is to start a big project: create scripts of "normal" enemies.

I think many of these scripts already exist, but not in the database, for everyone to use.

So, I did 2 images with the GB enemies I haven't found yet:

 

GB_enemies01.png

 

GB_enemies02.png

 

 

enemy 01 - pokey (this enemy isn't 100% set up yet)

https://dl.dropboxus...05472/pokey.mp4

 

enemy 02 - fin piranha

https://dl.dropboxus...fin piranha.mp4

 

enemy 03 - boo buddy

 

enemy 04 - spark

https://dl.dropboxus...05472/spark.mp4

 

enemy 05 - thwimp

 

enemy 06 - blooper

https://dl.dropboxus...472/blooper.mp4

 

enemy 07 - cheep-cheep

https://dl.dropboxus...cheep-cheep.mp4

https://dl.dropboxus...heep-cheep2.mp4

 

enemy 08 - pincer (this enemy isn't 100% set up yet)

https://dl.dropboxus...5472/pincer.mp4

 

enemy 09 - three-of-a-kind (this enemy isn't 100% set up yet)

 

enemy 10 - bomber

https://dl.dropboxus...5472/bomber.mp4

 

enemy 11 - paraocto

https://dl.dropboxus...72/paraocto.mp4

 

enemy 12 - mad bomber

https://dl.dropboxus.../mad bomber.mp4

 

 

If someone already has some of these scripts and can put it here, THANK U SO MUCH! If not, let us work together to make our projects even better :)

 

edit: here is a demo file with the enemies (new file): https://dl.dropboxus...es_testfile.rar

all marked names are of enemies ready to use.

 

edit2: I'll put videos of all enemies to show better how are the original versions.


Edited by accela2me, 23 January 2015 - 06:16 PM.


#2 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 01 January 2015 - 05:14 PM

From Zephino
Spark
Flying Octorok
Holeworm

 
From me
Pokey
Three of a kind


#3 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 01 January 2015 - 07:45 PM

Freya, thanks so much! 5 scripts at once was amazing :)

But we need to complete 2 of them:

SPARK

variable NPCM_NOPUSH is undeclared.

 

PINCER

function ISHOLE is undeclared.

 

I will test each script placed here and make a file to show the settings.



#4 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 01 January 2015 - 07:52 PM

Oops, those are from constants and functions files hang on.

...Mean while I found Zephinos Bomber

oh wait this the MadBomber completely different. Oh well.

// MadBomber

// Attributes

ffc script MadBomber{
  void run(int enemyID){
    npc ghost;
    eweapon bomb;

    // set possbile places where MadBomber can rise
    int x[100];
    int y[100];    
    int j=0;
    for(int i=0;i<16*11;i++){
      if(Screen->ComboF[i]==CF_ENEMY0){
        x[j] = ComboX(i);
        y[j] = ComboY(i);
        j++;
      }
    }
    int num_holes = j;

    // Initialization
    ghost = Ghost_InitAutoGhost(this, enemyID, 0);//GHF_IGNORE_ALL_TERRAIN | GHF_IGNORE_NO_ENEMY);
    ghost->Misc[NPCM_NOPUSH] = 1;
    
    // attributes
    int haltTime = ghost->Haltrate*10; // the duration of a full cicle [16->160]
    int frameRate = ghost->ASpeed/2; // the time it takes for MadBomber to animate [24->12]
    int tileOffset1 = ghost->Attributes[0];
    int tileOffset2 = ghost->Attributes[1];
    if(tileOffset1==0) tileOffset1 = 2;
    if(tileOffset2==0) tileOffset2 = 4;
    
    // initialze variables
    int original_tile = ghost->OriginalTile;
    bool alive = true;
    int counter = 0;

    while(true){
      
      Trace(counter);
      
      // Throw bomb
      if(counter==frameRate){
        bomb = FireAimedEWeapon(EW_BOMB, Ghost_X, Ghost_Y+8, 0, 100, ghost->WeaponDamage, -1, SFX_BOMB, 0);
        SetEWeaponMovement(bomb, EWM_THROW_BOUNCE_STOP, 4);
        SetEWeaponLifespan(bomb,EWL_TIMER,92);
        SetEWeaponDeathEffect(bomb,EWD_EXPLODE,ghost->WeaponDamage);
      }
      
      // disappear
      if(counter==2*frameRate){
        ghost->OriginalTile = original_tile+tileOffset1;
      }
      if(counter==3*frameRate){
        ghost->OriginalTile = original_tile+tileOffset2;
      }
      if(counter==4*frameRate){
        Ghost_X = -16;
        Ghost_Y = -16;
        ghost->X = -16;
        ghost->Y = -16;
      }
      
      // reappear
      if(counter==(haltTime-(4*frameRate))){
        int loc = Rand(num_holes);
        Ghost_X = x[loc];
        Ghost_Y = y[loc];
        ghost->X = x[loc];
        ghost->Y = y[loc];
      }
      if(counter==haltTime-3*frameRate){
        ghost->OriginalTile = original_tile+tileOffset2;
      }
      if(counter==haltTime-2*frameRate){
        ghost->OriginalTile = original_tile+tileOffset1;
      }
      if(counter==haltTime-frameRate){
        ghost->OriginalTile = original_tile;
      }
      
      if(bomb->isValid()){
        UpdateEWeapon(bomb);
      }
      
      if(counter>=haltTime) counter = 0;
      else counter++;

      // Waitframe
      ghost->Misc[NPCM_NOPUSH] = 1;
      if(ghost->Stun == 0) alive = Ghost_Waitframe(this, ghost, true, false);
      else alive = Ghost_Waitframe2(this, ghost, true, false);
      if(!alive) break;
    }
    // to keep moving bombs after MadBomber is dead
    while(bomb->isValid()){
      UpdateEWeapon(bomb);
      Waitframe();
    }
    Quit();
  }
}

Here you go.

const int NPCM_NOPUSH = 4; 
// if >0, the enemy cannot be pushed (by weapons and shield), and cannot fall into pits

bool isHole(int ct){
 return ct==CT_HOLELAVA; 
 //I'm going to be arrogant and assume your using my Holelava script.
}

Edited by Freya, 01 January 2015 - 08:08 PM.


#5 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 01 January 2015 - 09:40 PM

Ohoho! Thanks again! And another script :bounce:

I didn't find the sprites in the EZGB tileset, so I picked up from a GIF and updated the 1st post.



#6 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 02 January 2015 - 08:08 AM

Do you care if your thwimps are solid?



#7 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 02 January 2015 - 11:10 AM

Of course the thwimps can be solid :)

Hmm.. about the scripts, I created all the 6 enemies, but there isn't enough information of how to set the tiles/combos, the values for attr 1, 2, 3...



#8 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 02 January 2015 - 11:25 AM

They're all autoghost enemies, so the setup is the same for all of them. Type will almost always be Other. Miscellaneous Attribute 11 is the combo it uses as its sprite. Set this to -1 if you want to use the tile set in the enemy editor instead (it will use that tile's CSet regardless). Miscellaneous Attribute 12 is the slot number of the enemy's script. You can set this to -1 also, and it will attempt to search out the script based on the enemy name instead. You'll want to use something like "enemynamewhatever@scriptnamegoeshere" for that. You also have to put the ghost functions in your global script but I assume you already know how to do that.



#9 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 02 January 2015 - 11:44 AM

I did this :) What is missing is how to organize the tiles/combos and the attr 1 to 10 (when necessary).



#10 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 02 January 2015 - 11:59 AM

You can set up the animation for a tile the same way you would set it up for any non-scripted enemy. If you use a combo for the enemy instead, well.

 

* GHF_4WAY

 *    Change the FFC's combo based on Ghost_Dir. This requires a particular
 *    setup. There must be four consecutive combos in the list, one for each
 *    direction: up, down, left, and right, in order. Set Ghost_Data to the
 *    upward-facing combo.
 * 
 * GHF_8WAY
 *    Set the FFC's combo based on direction, inclusing diagonals. This will
 *    also cause GHF_SET_DIRECTION to use all eight directions. The combo
 *    order is up, down, left, right, up-left, up-right, down-left, down-right.

 

It seems like none of the enemies here use this feature, so a single combo would suffice. A lot of these are set to use various attributes. 11 and 12 are the only ones standard to all autoghosted enemies. Everything else is up to the script creator. You can do a Ctrl + F for "attribute" to find them.

 

float Ghost_GetAttribute(npc ghost, int index, float default)

float Ghost_GetAttribute(npc ghost, int index, float default, float min,
                         float max)
 * Retrieves the value of ghost->Attribute[index] bound to the range min - max.
 * If the value is 0, default will be returned. default does not need to be
 * between min and max.

 

That function is used for some of them. Keep in mind that "index" is one off from the numbers you see in the enemy editor, so Miscellaneous Attribute 1 would be ghost->Attribute[0] in the code.



#11 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 02 January 2015 - 01:38 PM

Thanks so much for the explanation, Lejes! I was really needing to learn how to read these ghost enemy scripts.



#12 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 02 January 2015 - 06:12 PM

updated:

I noticed some weird things in the scripts:

 

1. Pokey: if another enemy using the attr 11 (const int GH_INVISIBLE_COMBO) is on the same screen that Pokey, it also gains the Pokey's body. I tested this with 3 enemies and the result is always the same.

 

2. Pincer: the 1st enemy's tile appears and disappears quickly and only then appears inside the hole combo. when it is defeated, its body also appears in random places on the screen.

 

3. Spark: actually, I think it's not a bug... I simply can't setup this script to the enemy always walk next to a solid combo. what is still missing?


Edited by accela2me, 04 January 2015 - 06:24 PM.


#13 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 05 January 2015 - 07:21 PM

The demo file is updated.

Can someone test the scripts to help me with the correct settings?



#14 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 05 January 2015 - 07:27 PM

Pokey doesn't use GH_INVISIBLE_COMBO.

I don't have time to set up the combos right now, it'll have to wait until tomorrow.



#15 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 06 January 2015 - 12:07 PM

I know :) But for some reason, the other enemies that use GH_INVISIBLE_COMBO are affected by the pokey script.

Ok, I'll wait for when you can test it. Thanks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users