Jump to content

Photo

scripts woun't compile into my quest?


  • Please log in to reply
6 replies to this topic

#1 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 10 August 2008 - 11:25 AM

OK I'm trying to compile all these scripts into my quest (no I didn't make them) and they woun't

http://www.freewebs....ronald/fort 2.z
(right click save as)

Please help I need this fixed ASAP because I need these scripts for my next area

here is what ZQuest Says
IPB Image


#2 Plissken

Plissken

    What's with these homies dissing our girls?

  • Members

Posted 10 August 2008 - 11:33 AM

Add a new line at the end and put one more } on it. I checked, and it compiles fine after that.

#3 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 10 August 2008 - 11:42 AM

Scorry to ask this but if you got it to work could you post it so I can get it?

Becasue I tryed to fix it myself and have had alot of porblams even reading your post. (scripting hates me)


#4 Plissken

Plissken

    What's with these homies dissing our girls?

  • Members

Posted 10 August 2008 - 11:45 AM

CODE
import "std.zh" //this line loads the script variable document, with lots of constants for use with different functions

//-----------------------------
//-----------------------------
// Globle
//-----------------------------
//-----------------------------

//reserved for a globle script I may require

//-----------------------------
//-----------------------------
// Scripts
//-----------------------------
//-----------------------------

//this is the script that plays a message when Link picks up an item
item script message{
    void run(int s){
        Screen->Message(s);
    }
}


const int linkfalling = 0; // set here the first tile of your 5 tile Link Falling animation
const int linklava = 0; // set here the first tile of your 5 tile Link Drowning animation
const int fallingsfx = 0; // set here the SFX that plays when Link falls
const int lavasfx = 0; // set here the SFX that plays when Link drowns in lava
const int invis = 0; // set here the item ID of an item with Link Tile Modifier to make Link completely invisible

ffc script hole{
    void run(int lava, int warpx, int warpy, int combotype, int tile){    
        int sfx = fallingsfx;
        if(warpx == 0 && warpy == 0){Waitframes(5); warpx = Link->X; warpy = Link->Y;}
        if(tile == 0){tile = linkfalling;}
        if(combotype == 0){combotype = 35;}
        if(lava != 0){if(tile == linkfalling){tile = linklava;}sfx = lavasfx;}
        int timer; bool switch;
        int x; int y; bool falling;

        while(true){
            if(Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] == combotype && Link->Z == 0){
                if(Link->Action != LA_FROZEN && !falling){
                falling = true;
                }
                while(falling && Screen->ComboT[ComboAt(Link->X+8, Link->Y+8)] == combotype && Link->Z == 0 && timer < 5){
                    timer++;
                Waitframe();
                }
                for(timer = 0; timer < 40; timer++){
                    if(!switch){Game->PlaySound(sfx); switch = true; x = Link->X; y = Link->Y;}
                    Link->Item[invis] = true;
                    Link->Action = LA_FROZEN;
                    if(lava == 0) Screen->DrawTile(2, x, y, tile+Floor(timer/8), 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
                    else Screen->DrawTile(2, x, y, tile+Floor(timer/8), 1, 1, 6, 1, 0, 0, 0, 0, true, 128);
                Waitframe();
                }
                switch = false;
                Link->Item[invis] = false;
                Link->X = warpx; Link->Y = warpy;
                Link->Action = 0;
                Link->HP -= 8;
                Game->PlaySound(19);
            }
        Waitframe();
        }
    }
}


//this script, by pkmnfrk, is the script for the talkable NPCs
ffc script real_npc {
    void run(int m) {
        int d_x;
        int d_y;
        int a_x;
        int a_y;
        while(true) {
            d_x = this->X - Link->X;
            d_y = this->Y - Link->Y;
            a_x = Abs(d_x);
            a_y = Abs(d_y);            
            if(Link->InputL && a_x < 24 && a_y < 24 && Link->Z == 0) {
                Link->InputL = false;
                Screen->Message(m);
            }
        Waitframe();
        }
    }
}



//this script, also by pkmnfrk, deals with signposts
ffc script sign {
    void run(int m) {
        while(true) {
            while(Link->X < this->X || Link->X > this->X || Link->Y < this->Y || Link->Y > this->Y + 24 || Link->Dir != DIR_UP || !Link->InputL) {
                Waitframe();
            }
            Link->InputL = false;
            Screen->Message(m);

            while(Link->X >= this->X - 8 && Link->X <= this->X + 8 && Link->Y >= this->Y && Link->Y <= this->Y + 24 && Link->Dir == DIR_UP && Link->Z == 0) {
                Waitframe();
            }
            
            Screen->Message(0);
        }
    }
}

//this script plays the secret SFX when Link steps on certain trigger combos
ffc script triggerSFX{
    void run(int x, int y, int combo){
        int z = 1;
        while(z == 1){
            if(Screen->ComboD[ComboAt(x,y)] == combo){
                Game->PlaySound(27);
                z = 0;
            }
        Waitframe();
        }
    }
}

//this script plays a SFX
ffc script playSFX{
    void run(int sfx){
        Game->PlaySound(sfx);
    }
}

//this script warps Link after a message string is displayed
ffc script a_combo{
    void run(int dly){
        while(true){
            dly--;
            if(dly>0){}
            else{
                if(Link->InputA){
                Link->InputA = false;
                this->Data = 3580;
                }
            }
        Waitframe();
        }
    }
}

//this script warped Link from the title screen when the player pressed 'start'
ffc script start_combo{
    void run(int dly){
        while(true){
            dly--;
            if(dly>0){}
            else{
                if(Link->InputStart){
                Link->InputStart = false;
                this->Data = 3580;
                }
            }
        Waitframe();
        }
    }
}

//this script, by Gleeok, makes an enemy follow an ffc
ffc script enemy_ghost{
    void run(int enemy_id, int other_ffc){
        npc ghost_enemy;
        ghost_enemy = Screen->CreateNPC(enemy_id);
        int tx = this->X;
        int ty = this->Y;
        ffc other = Screen->LoadFFC(other_ffc);
        int ox = other->X;
        int oy = other->Y;
        while (true){
            if(!(ghost_enemy->isValid())){ this->Data=0; Quit();}
            if (Screen->NumNPCs() >= 1){
                if(other_ffc == 0){
                    ghost_enemy->X = tx+8;
                    ghost_enemy->Y = ty+8;
                    tx = this->X;
                    ty = this->Y;
                }else{
                    ghost_enemy->X = ox+8;
                    ghost_enemy->Y = oy+8;
                    ox = other->X;
                    oy = other->Y;
                }    
            }
            Waitframe();
        }
    }
}

//
// "Mouse Cursor"
// FFC follows mouse.
// Use sparingly!
//
ffc script MouseCursor {
  void run() {
    while(true) {
      this->X = Link->InputMouseX+8;
      this->Y = Link->InputMouseY+8;
      Waitframe();
    }
  }
}

//
// "Put Item"
// Puts an item in a room.
//
ffc script PutItem {
  void run(int id, int z) {
    item it;
    it = Screen->CreateItem(id);
    it->X = this->X;
    it->Y = this->Y;
    it->Z = z;
  }
}

//
// "Buoyancy"
// The FFC bobs up and down, as if floating on water.
//
ffc script Buoyancy {
  void run(int speed, int dist) {
    int y = this->Y;
    float clk = Rand(360);
    while(true) {
      clk++;
      this->Y = y + Sin(clk*speed) * dist;
      Waitframe();
    }
  }
}

// "Buy Item"
// Standard shopping script.
// Buy the item by pressing A.
//
ffc script BuyItem {
void run(int itemid, int price, int notenoughmsg, int requireditem, int requiredmsg, int allready) {
  while(true) {
    while((Link->X < this->X - 8 && Link->Dir != DIR_RIGHT)
       || (Link->X > this->X + 8 && Link->Dir != DIR_LEFT)
       || (Link->Y < this->Y - 8 && Link->Dir != DIR_DOWN)
       || (Link->Y > this->Y + 8 && Link->Dir != DIR_UP)
       || (Link->X > this->X + 20 && Link->Dir == DIR_LEFT)
       || (Link->X < this->X - 20 && Link->Dir == DIR_RIGHT)
       || (Link->Y > this->Y + 24 && Link->Dir == DIR_UP)
       || (Link->Y < this->Y - 12 && Link->Dir == DIR_DOWN)
       || Link->Z > 0
       || this->Data == 0
       || !Link->InputL) {
      Waitframe();
    }
    Link->InputL = false;
    if (Link->Item[itemid]) {
      Screen->Message(allready);
    } else if (Game->Counter[CR_RUPEES] < price) {
      Screen->Message(notenoughmsg);
    } else if (requireditem != 0 && !Link->Item[requireditem]) {
      Screen->Message(requiredmsg);
    } else {
      Game->DCounter[CR_RUPEES] -= price;
      item purchase = Screen->CreateItem(itemid);
      purchase->X = Link->X;
      purchase->Y = Link->Y;
      Link->Action = LA_HOLD1LAND;
      Link->HeldItem = itemid;
      Game->PlaySound(SFX_PICKUP);
      Waitframe();
    }
    do {
      Waitframe();
    } while (Link->InputL);
  }
}
}



The only difference is I added one more line at the very bottom and put one "}" in it. Copy paste that into notepad, save as: whatever you want the name as.z

#5 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 10 August 2008 - 02:27 PM

Thats what I did but I still get an error a weerid one at that

Line 487 (WTF there are only 300 and somthing): Syntax Wrror, Unexpected Minus, Expecting Number, On Token - Tmp, Line 1: error P01 : Failure to parse Imported file STD.ZH (std.zh is in my ZC Folder)


#6 Kite

Kite

  • Members

Posted 10 August 2008 - 03:05 PM

The problem is the negative constant that is probably in your std.zh file.

You need to open it as a text file in order to fix the problem. Find the following in std.zh (line 487) and delete the entire line.

CODE
const int WDS_NOHIT             = -10;


Edit: If you can't get this to work, just use the std.zh from a version of ZC older than 846 until the next beta comes out.

#7 Old Inactive Member

Old Inactive Member

    I'm back sorta.

  • Members

Posted 10 August 2008 - 04:01 PM

Thanks Nick that worked


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users