Jump to content

Photo

Checking if link is standing on layer combo


  • Please log in to reply
1 reply to this topic

#1 Avaro

Avaro

    >w<

  • Members

Posted 17 June 2013 - 02:44 PM

Hey everybody, it's me again! I've got another scripting problem. Here is the script I want to use:

ffc script MyCoolScript{
    void run(){
        while(true){
            int comboLoc = ComboAt(Link->X + 8, Link->Y + 8); //stores the combo under link into "comboLoc"
            for(int i=0; i<=175; i++){
                if ( GetLayerComboD(1, i) == 123 && Screen->ComboD[comboLoc] == Screen->ComboD[i] ) { //if link is on combo 123 wich is on layer 1
                    //do something
                }
            }
            Waitframe();
        }
    }
}

This script should check if link is standing on combo 123 wich I place on layer 1 and then do something with the combo at the same position on layer 0. However, this script pretends, link is always at any time standing on that combo.

 

I can not find out what the error is.. :?



#2 grayswandir

grayswandir

    semi-genius

  • Members

Posted 17 June 2013 - 03:35 PM

If I understand correctly...

 

If you're just interested in the combo under link, you shouldn't be looping through all combos like that.

 

Screen->ComboD[comboLoc] == Screen->ComboD[i]

This part says "If link is standing on the same kind of combo that the combo at i is."

 

So it'll eventually trigger if Link is standing on any combo which, at another point on the screen, has combo 123 on layer 1 above it.

 

Just do (untested)

ffc script MyCoolScript{
    void run(){
        while(true){
            int comboLoc = ComboAt(Link->X + 8, Link->Y + 8); //stores the combo under link into "comboLoc"
            if ( GetLayerComboD(1, comboLoc) == 123) { //if link is on combo 123 wich is on layer
                int comboOnL0 = Screen->ComboD[comboLoc];
                //do something
            }
            Waitframe();
        }
    }
}

 


  • Avaro likes this


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users