Jump to content

Photo

Anything wrong with these scripts?


  • Please log in to reply
21 replies to this topic

#16 Joe123

Joe123

    Retired

  • Members

Posted 23 November 2007 - 02:01 PM

CODE
import "std.zh"

int FEATHER_LEVEL = 0;

global script main_script {
    void run() {
        while(true){
            if(FEATHER_LEVEL == 2){
                if(Link->MP <16){
                    Link->Item[253] = false;
                    Link->Item[91] = true;
                }
                else{Link->Item[253]= true;}
            }
            if(FEATHER_LEVEL == 3){
                if(Link->MP <16){
                    Link->Item[252] = false;
                    Link->Item[253] = false;
                    Link->Item[91] = true;
                }
                if(Link->MP <32 && Link->MP>=16){
                    Link->Item[252] = false;
                    Link->Item[253] = true;
                    Link->Item[91] = false;
                }
                else{Link->Item[252]= true;}
            }
        Waitframe();
        }
    }
}

item script feather1{
    void run() {
    if(FEATHER_LEVEL == 0){FEATHER_LEVEL=1;}
    }
}
item script feather2{
    void run() {
    if(FEATHER_LEVEL < 2){FEATHER_LEVEL=2;}
    }
}
item script feather3{
    void run() {
    if(FEATHER_LEVEL < 3){FEATHER_LEVEL=3;}
    }
}


There was a missing right brace.



#17 Majora

Majora

    Unironic Marxist-Leninist

  • Members

Posted 23 November 2007 - 11:09 PM

It compiled, and works... for the most part.

I assigned the scripts to the items. The Golden Feather reverts to the Silver Feather perfectly. The only problem, is that the Silver Feather reverts to the item directly to the right of it in the Subscreen (which happens to be the Potion). All the numbers are set up correctly.

#18 Joe123

Joe123

    Retired

  • Members

Posted 24 November 2007 - 06:01 AM

What's the item number of your potion that it's reverting to?

#19 Majora

Majora

    Unironic Marxist-Leninist

  • Members

Posted 24 November 2007 - 04:01 PM

Actually, it seems to revert to the item directly to the right. In any case, the Red potion is #30. I used cheats to give myself enough items to be able to select the feather, and it reverted to #90, the letter (used I think).

#20 Joe123

Joe123

    Retired

  • Members

Posted 25 November 2007 - 05:19 AM

I think it might be removing the feather from your subscreen so that the cursor moves onto the potion, then adding it again. After it's reverted to the potion, can you select the feather again?

CODE
global script main_script {
    void run() {
        while(true){
            if(FEATHER_LEVEL == 2){
                if(Link->MP <16){
                    Link->Item[91] = true;
                    Link->Item[253] = false;
                }
                else{Link->Item[253]= true;}
            }
            if(FEATHER_LEVEL == 3){
                if(Link->MP <16){
                    Link->Item[91] = true;
                    Link->Item[252] = false;
                    Link->Item[253] = false;
                }
                if(Link->MP <32 && Link->MP>=16){
                    Link->Item[253] = true;
                    Link->Item[252] = false;
                }
                else{Link->Item[252]= true;}
            }
        Waitframe();
        }
    }
}


Try that.

Edited by Joe123, 25 November 2007 - 05:24 AM.


#21 Majora

Majora

    Unironic Marxist-Leninist

  • Members

Posted 08 December 2007 - 07:18 PM

http://img01.picoodl...mmm_fb7e95d.png

#22 Joe123

Joe123

    Retired

  • Members

Posted 09 December 2007 - 06:25 AM

*sigh*
You have to declare a global integer before the script Majora. I'm sure someone said that before.

AFTER import 'std.zh'

and BEFORE the script

put:
int FEATHER_LEVEL;

ok? =P


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users