https://imgur.com/tPyp460
something in this script causes the grass tile to appear in the top right corner of every screen its on, i don't know why :
const int SCRIPT_BARRIERS = 15; // Must refer to "Barrier"'s ffc script slot in the quest // ID's of barrier-related combos // Barriers in raised state const int BARRIER_A_RAISED = 15036; const int BARRIER_B_RAISED = 15038; // Barriers in lowered state const int BARRIER_A_LOWERED = 15037; const int BARRIER_B_LOWERED = 15039; // Barriers animating to raised state const int BARRIER_A_ANIMRAISE = 15041; const int BARRIER_B_ANIMRAISE = 15043; // Barriers animating to lowered state const int BARRIER_A_ANIMLOWER = 15040; const int BARRIER_B_ANIMLOWER = 15042; // Raised barriers that Link can walk on const int BARRIER_A_WALKABLE = 15044; const int BARRIER_B_WALKABLE = 15045; // Barrier switches const int BARRIER_A_SWITCH = 15046; const int BARRIER_B_SWITCH = 15047; const int BARRIER_SWITCH_DUMMY = 191; // ID of a switch hit detection dummy enemy const int BARRIER_SWITCH_DUMMY_HP = 32767; // Global array to store the state of barriers per dmap // If you have more than 16 dmaps you can change the capacity in the []'s // You may change the states in other scripts, but the changes will not be visible // until there is a new screen, so set them before Barriers_NewScreen() is called. bool barriers[255]; // false = blue barriers raised, true = red barriers raised global script slot2 { void run() { // Initialize variables used to listen on screen changes int curscreen = -1; int reqItem = 158; //Item that makes the FFC follower follow you int ffcNumber = 32; //The number of the FFC used. This script will "hijack" this one, so don't use it for anything else on screens when you expect the player to have a follower. int firstFollowerCombo = 23568; //combo of the first combo. In order, the concecutive combos must be "still up", "still down", "still left", "still right", "moving up", "moving down", "moving left", "moving right". int csetOfFollower = 11; bool firstCheck = false; //leave this alone ffc follower; int pastX; int currentX; int followerX[13]; int pastY; int currentY; int followerY[13]; int index; while (true) { // Keep track of screen changes // Run a Barrier script on every screen change if (Game->GetCurScreen() != curscreen) { curscreen = Game->GetCurScreen(); Barriers_NewScreen();} if(Link->Item[reqItem] == true){ if(Link->Action != LA_SCROLLING && follower->Data==0){ follower = Screen->LoadFFC(ffcNumber); follower->Data = firstFollowerCombo; follower->CSet = csetOfFollower; pastX = Link->X; follower->X = Link->X; pastY = Link->Y; follower->Y = Link->Y; for ( int i = 0; i < 13; i++ ){ followerX[i] = Link->X; followerY[i] = Link->Y; } firstCheck = true; } if(Link->Action != LA_SCROLLING){ if((Link->InputUp || Link->InputDown || Link->InputRight || Link->InputLeft)&&(!(Link->InputA || Link->InputB))){ pastX = follower->X; follower->X = followerX[0]; for(index=0; index<12; index++){ followerX[index] = followerX[index + 1]; } followerX[12] = Link->X; pastY = follower->Y; follower->Y = followerY[0]; for(index=0; index<12; index++){ followerY[index] = followerY[index + 1]; } followerY[12] = Link->Y; } if(follower->Y > pastY){ follower->Data = firstFollowerCombo + 5; } else if(follower->Y < pastY){ follower->Data = firstFollowerCombo + 4; } else if(follower->X > pastX){ follower->Data = firstFollowerCombo + 7; } else if(follower->X < pastX){ follower->Data = firstFollowerCombo + 6; } if(!(Link->InputUp || Link->InputDown || Link->InputRight || Link->InputLeft)){ if((follower->Data == (firstFollowerCombo + 4))||(follower->Data == (firstFollowerCombo + 5))||(follower->Data == (firstFollowerCombo + 6))||(follower->Data == (firstFollowerCombo + 7))){ follower->Data = follower->Data - 4; } else if((follower->Data == (firstFollowerCombo + 3))||(follower->Data == (firstFollowerCombo + 2))||(follower->Data == (firstFollowerCombo + 1))||(follower->Data == (firstFollowerCombo))){ } else{ follower->Data = firstFollowerCombo; } } } if(Link->Action == LA_SCROLLING){ firstCheck = false; }} Waitframe();}}} // Function that makes preparations for barriers on each screen and starts an FFC script void Barriers_NewScreen() { // Search for a barrier-related combo for (int i = 0; i <= 175; i++) { int cd = Screen->ComboD[i]; if (cd == BARRIER_A_RAISED || cd == BARRIER_A_LOWERED || cd == BARRIER_A_SWITCH || cd == BARRIER_B_RAISED || cd == BARRIER_B_LOWERED || cd == BARRIER_B_SWITCH) { // A barrier-related combo was found // Make initial changes to combos if (barriers[Game->GetCurLevel()]) { for (int j = i; j <= 175; j++) { int cd = Screen->ComboD[j]; if (cd == BARRIER_A_RAISED) Screen->ComboD[j] = BARRIER_A_LOWERED; else if (cd == BARRIER_B_LOWERED) Screen->ComboD[j] = BARRIER_B_RAISED; else if (cd == BARRIER_A_SWITCH) Screen->ComboD[j] = BARRIER_B_SWITCH;}} else { for (int j = i; j <= 175; j++) { int cd = Screen->ComboD[j]; if (cd == BARRIER_B_RAISED) Screen->ComboD[j] = BARRIER_B_LOWERED; else if (cd == BARRIER_A_LOWERED) Screen->ComboD[j] = BARRIER_A_RAISED; else if (cd == BARRIER_B_SWITCH) Screen->ComboD[j] = BARRIER_A_SWITCH;}} // So run FFCscript to control barriers int args[] = {0,0,0,0,0,0,0,0}; RunFFCScript(SCRIPT_BARRIERS, args); break;} }} // This lets you toggle barriers on any dmap bool ToggleBarriers(int dmap) { if (dmap == Game->GetCurLevel()) ToggleBarriers(); else barriers[dmap] = !barriers[dmap]; return barriers[dmap];} // This toggles barriers on the current dmap bool ToggleBarriers() { int curdmap = Game->GetCurLevel(); if (!barriers[curdmap]) { barriers[curdmap] = true; for (int i = 0; i <= 175; i++) { int cd = Screen->ComboD[i]; if (cd == BARRIER_A_RAISED || cd == BARRIER_A_WALKABLE || cd == BARRIER_A_ANIMRAISE) { Screen->ComboD[i] = BARRIER_A_ANIMLOWER;} else if (cd == BARRIER_B_LOWERED || cd == BARRIER_B_ANIMLOWER) { Screen->ComboD[i] = BARRIER_B_ANIMRAISE;} else if (cd == BARRIER_A_SWITCH) {Screen->ComboD[i] = BARRIER_B_SWITCH;}}} else { barriers[curdmap] = false; for (int i = 0; i <= 175; i++) { int cd = Screen->ComboD[i]; if (cd == BARRIER_B_RAISED || cd == BARRIER_B_WALKABLE || cd == BARRIER_B_ANIMRAISE) { Screen->ComboD[i] = BARRIER_B_ANIMLOWER;} else if (cd == BARRIER_A_LOWERED || cd == BARRIER_A_ANIMLOWER) { Screen->ComboD[i] = BARRIER_A_ANIMRAISE;} else if (cd == BARRIER_B_SWITCH) {Screen->ComboD[i] = BARRIER_A_SWITCH;}}} return barriers[curdmap]; } // This script controls barriers on the screen // The FFC is automatically created by Barriers_NewScreen() ffc script Barriers { void run() { // Initialize storage for bswitch hit dummies int bswitch_count; npc bswitch[8]; for (int i = 0; i <= 175; i++) { if (Screen->ComboD[i] == BARRIER_A_SWITCH || Screen->ComboD[i] == BARRIER_B_SWITCH) { npc bs = CreateNPCAt(BARRIER_SWITCH_DUMMY, ComboX(i), ComboY(i)); bs->HitWidth = 8; // Smaller hit box to avoid annoying collisions with Link bs->HitHeight = 8; bs->HP = BARRIER_SWITCH_DUMMY_HP; bswitch[bswitch_count++] = bs;}} // Change raised barriers to walkable ones if Link enters screen on a raised barrier int lcombo = LinkOnComboD(); bool onbarrier = (lcombo == BARRIER_A_RAISED || lcombo == BARRIER_B_RAISED); if (onbarrier) for (int i = 0; i < 176; i++) { if (Screen->ComboD[i] == BARRIER_A_RAISED) {Screen->ComboD[i] = BARRIER_A_WALKABLE;} else if (Screen->ComboD[i] == BARRIER_B_RAISED) {Screen->ComboD[i] = BARRIER_B_WALKABLE;}} while (true) { // Detect hits on bswitches, and change combos accordingly for (int j = 0; j < bswitch_count; j++) { if (bswitch[j]->HP < BARRIER_SWITCH_DUMMY_HP) { bswitch[j]->HP = BARRIER_SWITCH_DUMMY_HP; ToggleBarriers(); break;}} //break so that only one bswitch hit may register per frame // Make barriers walkable if Link is on raised barriers, or unwalkable if not lcombo = LinkOnComboD(); if (!onbarrier && (lcombo == BARRIER_A_RAISED || lcombo == BARRIER_B_RAISED)) { onbarrier = true; for (int i = 0; i <= 175; i++) { if (Screen->ComboD[i] == BARRIER_A_RAISED) {Screen->ComboD[i] = BARRIER_A_WALKABLE;} else if (Screen->ComboD[i] == BARRIER_B_RAISED) {Screen->ComboD[i] = BARRIER_B_WALKABLE;}}} else if (onbarrier && !(lcombo == BARRIER_A_WALKABLE || lcombo == BARRIER_B_WALKABLE)) { onbarrier = false; for (int i = 0; i <= 175; i++) { if (Screen->ComboD[i] == BARRIER_A_WALKABLE) {Screen->ComboD[i] = BARRIER_A_RAISED;} else if (Screen->ComboD[i] == BARRIER_B_WALKABLE) {Screen->ComboD[i] = BARRIER_B_RAISED;}}} Waitframe();} }} // A utility function that returns the ID of the combo that Link appears to stand on int LinkOnComboD() { return Screen->ComboD[ComboAt(Link->X+8, Link->Y+13)]; }
can someone help me figure out why this is happening?