Jump to content

Photo

Goomba Script


  • Please log in to reply
3 replies to this topic

#1 XMuppetSB

XMuppetSB

    Circle of Friends

  • Members
  • Real Name:Joseph Watson
  • Gender:Male
  • Location:San Antonio, Texas
  • Past Nicks:Pokegamer1989

Posted 14 February 2012 - 04:46 PM

I need a fix for the following script:

CODE

ffc script Goomba{
    void run(int enemyID){
        npc ghost = Ghost_InitAutoGhost(this, enemyID, GHF_NORMAL);
        int counter = -1;
        int step = ghost->Step;
        int rate = ghost->Rate;
        int homing = ghost->Homing;
        int haltrate = ghost->Haltrate;
        int zheight = ghost->Attributes[4];
        while(true){
            counter = Ghost_HaltingWalk4(counter, step, rate, homing, 0, haltrate, 48);      
            if(Link->Jump < 0 && Link->Z <= zheight){
                if(XYCollision(ghost) && CanSquash(ghost->Attributes[3])){
                    Game->PlaySound(ghost->Attributes[0]);
                    ghost->CollDetection = false;
                    Ghost_Data++;
                    if(ghost->Attributes[5]) Link->Jump = 3;
                    Ghost_Waitframes(this, ghost, true, true, ghost->Attributes[1]);
                    ghost->ItemSet = ghost->Attributes[2];
                    Ghost_HP = HP_SILENT;
                }
            }
            Ghost_Waitframe(this, ghost, true, true);
        }        
    }
    bool XYCollision(npc n){
        int ax = Link->X + Link->HitXOffset;
        int bx = n->X + Link->HitXOffset;
        int ay = Link->Y + Link->HitYOffset;
        int by = n->Y + Link->HitYOffset;
        return RectCollision(ax, ay, ax + Link->HitWidth, ay + Link->HitHeight, bx, by, bx + n->HitWidth, by + n->HitHeight);
    }
    bool CanSquash(bool boots){
        if(Link->Item[I_STOMPBOOTS]) return true;
        else return !boots;
    }
}



This is the Goomba Script originally written by blackbishop. The problem is, although I have the enemy type set to 'Other' and not 'Other (Floating)', it still does not obey sideview gravity, for it floats in sideview when it should be falling in sideview.

#2 XMuppetSB

XMuppetSB

    Circle of Friends

  • Members
  • Real Name:Joseph Watson
  • Gender:Male
  • Location:San Antonio, Texas
  • Past Nicks:Pokegamer1989

Posted 19 February 2012 - 10:20 PM

Sorry for the double post, but here's the quest file demonstrating the Goomba enemy:
http://www.mediafire...ot8kl4fov5ag5pg

#3 Saffith

Saffith

    IPv7 user

  • ZC Developers
  • Gender:Male

Posted 19 February 2012 - 10:39 PM

It's an issue with ghost.zh. It doesn't do falling in sideview. I'll be sure to fix it next update.

#4 XMuppetSB

XMuppetSB

    Circle of Friends

  • Members
  • Real Name:Joseph Watson
  • Gender:Male
  • Location:San Antonio, Texas
  • Past Nicks:Pokegamer1989

Posted 28 February 2012 - 07:52 PM

Now that ghost.zh has variables for handling sideview screens, would you mind updating this script so that this enemy falls in sideview? I tested this after getting the updated file, and it still ignores sideview gravity.
EIDT: Never mind. All I had to do was recompile the script.

Edited by XMuppetSB, 28 February 2012 - 07:53 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users