Jump to content

Photo

MoscowModer's Heart Piece message script


  • Please log in to reply
No replies to this topic

#1 Rocksfan13

Rocksfan13

    Looks best in Blue

  • Members
  • Real Name:Doug
  • Location:Earth

Posted 06 June 2018 - 09:09 AM

Hey guys, its been a while I know.

 

Trying to compile MoscowModer's Heart Piece Message script and keep getting a Variable not declared error.

 

Can someone help me out here?

 

Here is the code from the database:

 

//import "std.zh"

//Old version: supports only 4-piece heart containers
//Messages can be set automatically or manually
//D0 = First message
//D1-3 = Second-fourth messages; default to strings after D0
item script heartPieceMessageOld{
    void run (int m1, int m2, int m3, int m4){
        //Set m2-4 to follow m1 if not set explicitly
        if ( m2 == 0 ) m2 = m1+1;
        if ( m3 == 0 ) m3 = m1+2;
        if ( m4 == 0 ) m4 = m1+3;
        
        //Play the appropriate message
        if ( Game->Generic[GEN_HEARTPIECES] == 0 )
            Screen->Message(m1);
        if ( Game->Generic[GEN_HEARTPIECES] == 1 )
            Screen->Message(m2);
        if ( Game->Generic[GEN_HEARTPIECES] == 2 )
            Screen->Message(m3);
        if ( Game->Generic[GEN_HEARTPIECES] == 3 )
            Screen->Message(m4);
    }
}

//New version: supports any number of heart containers
//D0 = String # of first message
//All other messages *MUST* follow the first
item script heartPieceMessage{
    void run ( int message ){
        Screen->Message ( message + Game->Generic[GEN_HEARTPIECES] );
    }
}

 

 

EDIT: Nevermind. I figured it out on my own. I forgot to import std.zh, left the hashes in front to demarks a comment.


Edited by Rocksfan13, 06 June 2018 - 10:17 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users