you had two waitdraws in the global loop. might have been causing the problem. i didn't quite understand your problem, and i didn't test this so report back. with so many complex global scripts running that are all changing Link's position and drawing and stuff you're bound to have bugginess unless you make them all place nice. i don't have the time to look at all the other global scripts and learn them well enough to do this for you.
here's the updated version with the extra waitdraw removed, and some stuff shifted around to hopefully fix the problem.
global script CursedTreasureScript{
void run(){
//=======================Bracelets=================
holding_block = 0;
//=================================================
//======== Mooshpit ========
MooshPit_Init();
//==========================
//========== Bombs ========
BombsScreenShake();
//=========================
//======== Ghost ========
StartGhostZH();
//=======================
//======== Ice Combos ========
//Setup variables for ice combos.
Setup_IceCombos();
//Variable that stores Game->GetCurScreen() the previous frame.
int oldscreen = Game->GetCurScreen();
//============================
//=========Mine Cart==========
ScrollingDraws_Init();
Minecart_Init();
//============================
while(true){
//=======================Bracelets=================
PowerBracelet();
//=================================================
//======== Mooshpit ========
MooshPit_Update();
//==========================
//========== bombs =========
BombsScreenShake();
//==========================
//=========PegasusBoots==========
ScrollFix();
PegasusBoots();
//===============================
//======== Deku Leaf ========
if(Link->Z == 0){
if(!HitGround) Game->PlaySound(SFX_LAND);
HitGround = true;
}
//Check if Link has the Deku Leaf LTM item.
if(Link->Item[I_DEKULEAF_LTM]){
//Increment Glide_Time if it's greater than or equal to 0;
if(Glide_Time >= 0) Glide_Time++;
//Check if DEKU_DRAIN doesn't equal 0.
if(DEKU_DRAIN != 0){
//Increment draintimer and wrap it to DEKU_DRAIN. If it equals 0 after all that decrement MP.
draintimer = (draintimer + 1) % DEKU_DRAIN;
if(draintimer == 0) Link->MP--;
}
//If Glide_Time has reached DEKU_MAX_GLIDE_TIME or MP has reached 0 cancel the gliding by removing the LTM item.
if(Glide_Time == DEKU_MAX_GLIDE_TIME || Link->MP == 0) Link->Item[I_DEKULEAF_LTM] = false;
//Otherwise if not scrolling glide down to the ground.
else if(Link->Action != LA_SCROLLING){
looptimer = (looptimer + 1) % DEKU_LOOP;
if(looptimer == 0) Game->PlaySound(SFX_GLIDE);
DekuGlide();
}
//Check if Link just used the DekuLeaf and if so cancel the gliding by removing the LTM item.
if(UsedItem(I_DEKULEAF) && DEKU_CANCELLABLE) Link->Item[I_DEKULEAF_LTM] = false;
//Null the A and B buttons to prevent item use.
Link->InputA = false;
Link->InputB = false;
}
//===========================
//========ScrollDraws=======
ScrollingDraws_Update();
Waitdraw(); //Only one of this
//==========================
//======== Ghost ========
UpdateGhostZH2();
//=======================
//======== Ice Combos ========
Update_IceCombos(oldscreen);
oldscreen = Game->GetCurScreen();
//============================
//=========Mine Cart===========
Minecart_Update();
//=============================
Waitframe();
}
}
}
//This function makes it appear that Link is holding the leaf overhead and makes him fall slower.
void DekuGlide(){
//Check Link's Z position and if it's less than or equal to 0 cancel the glide by removing the LTM item.
if(Link->Z <= 0){
Link_Z = 0;
Link->Item[I_DEKULEAF_LTM] = 0;
}
//Otherwise load the itemdata of the LTM item and use it to draw the leaf on layer 4.
else{
itemdata id = Game->LoadItemData(I_DEKULEAF_LTM);
Screen->FastTile(4, Link->X, Link->Y - Link_Z - 8, (id->InitD[0]*10) + Link->Dir, id->InitD[1], 128);
}
//Set Link's Z position to Link_Z and subtract Link_Z by GRAVITY2.
Link->Z = Link_Z;
Link_Z -= GRAVITY2;
}
Edited by justin, 17 January 2018 - 08:52 AM.