Plug your old global script here as well, and I will compare how you inserted this. It may be the position of your waitframe() that is causing this. I need to see how you had it set up before you added this, as you have some levels of encapsulation going on that I don't want to muddle up.
I think that your game is locking up because the waitframe() is outside your while loop, so ZASM never knows when to stop and draw. In other words, your waitframe() seems to be inside the void run() function, but outside your while(true) loop, so the loop runs forever.
I don;t know what you intended to be inside that though. For example, this is after and outside your while loop:
if(Link->Action != LA_SCROLLING) { Update_HoleLava(startx, starty, olddmap, oldscreen, startdir); if(Link->Z==0 && !Falling && (oldscreen != Game->GetCurDMapScreen() || olddmap != Game->GetCurDMap())) { olddmap = Game->GetCurDMap(); oldscreen = Game->GetCurDMapScreen(); startx = Link->X; starty = Link->Y; startdir = Link->Dir;
It would be very helpful if the nesting was, err, organised. There are add-ons for Notepad++ (and other utilities) to automate that, although the name escapes me at present.
In the meanwhile, try this:
//Common Constant, only need to define once per script file. const int BIG_LINK = 0; //Set this constant to 1 if using the Large Link Hit Box feature. //Constants used by Bottomless Pits & Lava. const int CT_HOLELAVA = 128; //Combo type to use for pit holes and lava."No Ground Enemies by default" const int CF_PIT = 98; //The combo flag to register combos as pits. const int CF_LAVA = 99; //The combo flag to register combos as lava. const int WPS_LINK_FALL = 88; //The weapon sprite to display when Link falls into a pit. "Sprite 88 by default" const int WPS_LINK_LAVA = 89; //The weapon sprite to display when Link drowns in lava. "Sprite 89 by default" const int SFX_LINK_FALL = 38; //The sound to play when Link falls into a pit. "SFX_FALL by default" const int SFX_LINK_LAVA = 55; //The sound to play when Link drowns in Lava. "SFX_SPLASH by default. const int CMB_AUTOWARP = 888; //The first of your four transparent autowarp combos. const int HOLELAVA_DAMAGE = 8; //Damage in hit points to inflict on link. "One Heart Container is worth 16 hit points" //Global variables used by Bottomless Pits & Lava. int Falling; bool Warping; //Global variables used by Attack Ring float ATTACKRING_POWER = 1; //How much to multiply damage by (allows decimals) const int MISC_LW_BOOSTED = 0; //Weapon->Misc[] slot for boosted weapons const int MISC_WEAP_BOOSTED = 0; global script slot2 { void run() { //Initialize variables used to store Link's strating position on Screen Init. int olddmap = Game->GetCurDMap(); int oldscreen = Game->GetCurDMapScreen(); int startx = Link->X; int starty = Link->Y; int startdir = Link->Dir; //Clear global variables used by Bottomless pits. Falling = 0; Warping = false; //Main Loop while(true) { //Stops enemies from dropping ammunition items that Link doesn't have a way to carry (Bomb bag, quiver, etc.). for ( int i = 1; i <= Screen->NumItems(); i++) { item drop = Screen->LoadItem(i); if ( (drop->ID == I_ARROWAMMO1 && !Link->Item[I_QUIVER1]) || ( drop->ID == I_ARROWAMMO10 && !Link->Item[I_QUIVER1]) || ( drop->ID == I_ARROWAMMO30 && !Link->Item[I_QUIVER1]) || ( drop->ID == I_ARROWAMMO5 && !Link->Item[I_QUIVER1]) || ( drop->ID == I_BOMBAMMO1 && !Link->Item[I_BOMBBAG1]) || ( drop->ID == I_BOMBAMMO4 && !Link->Item[I_BOMBBAG1]) || ( drop->ID == I_BOMBAMMO8 && !Link->Item[I_BOMBBAG1]) || ( drop->ID == I_BOMBAMMO30 && !Link->Item[I_BOMBBAG1]) ) Remove (drop); //hard-coded Self-upgrading drops if ( (drop->ID == I_SWORD1 && !Link->Item[I_SWORD1])) Remove (drop); //This checks if you have the wooden sword, if not, it removes the drop if ( (drop->ID == I_SWORD1 && Link->Item[I_SWORD1])) drop->ID = I_SWORD2; //This checks if you have the wooden sword, if you do, it changes the picked up item to the white sword if ( (drop->ID == I_SWORD2 && Link->Item[I_SWORD2])) drop->ID = I_SWORD3; //THis checks if you have the white sword, if you do, it replaces it with the magic sword if ( (drop->ID == I_SWORD3 && Link->Item[I_SWORD3])) drop->ID = I_SWORD4; //This checks if you have the magic sword, if you do, it replaces it with the master sword //Attack Ring script body for(int i = 1; i <= Screen->NumLWeapons(); i++){ lweapon weap = Screen->LoadLWeapon(i); if(weap->Misc[MISC_WEAP_BOOSTED] == 0){ weap->Damage *= ATTACKRING_POWER; weap->Misc[MISC_LW_BOOSTED] == 1; } } } Waitframe(); } if(Link->Action != LA_SCROLLING) { Update_HoleLava(startx, starty, olddmap, oldscreen, startdir); if(Link->Z==0 && !Falling && (oldscreen != Game->GetCurDMapScreen() || olddmap != Game->GetCurDMap())) { olddmap = Game->GetCurDMap(); oldscreen = Game->GetCurDMapScreen(); startx = Link->X; starty = Link->Y; startdir = Link->Dir; } } } } //Handles Pit Combo Functionality. void Update_HoleLava(int x, int y, int dmap, int scr, int dir) { lweapon hookshot = LoadLWeaponOf(LW_HOOKSHOT); if(hookshot->isValid()) return; if(Falling) { Falling--; if(Falling == 1) { int buffer[] = "holelava"; if(CountFFCsRunning(Game->GetFFCScript(buffer))) { ffc f = Screen->LoadFFC(FindFFCRunning(Game->GetFFCScript(buffer))); Warping = true; if(f->InitD[1]==0) { f->InitD[6] = x; f->InitD[7] = y; } } else { Link->X = x; Link->Y = y; Link->Dir = dir; Link->DrawXOffset -= Cond(Link->DrawXOffset < 0, -1000, 1000); Link->HitXOffset -= Cond(Link->HitXOffset < 0, -1000, 1000); Link->HP -= HOLELAVA_DAMAGE; Link->Action = LA_GOTHURTLAND; Link->HitDir = -1; Game->PlaySound(SFX_OUCH); if(Game->GetCurDMap()!=dmap || Game->GetCurDMapScreen()!=scr) Link->PitWarp(dmap, scr); } NoAction(); Link->Action = LA_NONE; } } else if(Link->Z==0 && OnPitCombo() && !Warping) { Link->DrawXOffset += Cond(Link->DrawXOffset < 0, -1000, 1000); Link->HitXOffset += Cond(Link->HitXOffset < 0, -1000, 1000); int comboflag = OnPitCombo(); SnaptoGrid(); Game->PlaySound(Cond(comboflag == CF_PIT, SFX_LINK_FALL, SFX_LINK_LAVA)); lweapon dummy = CreateLWeaponAt(LW_SCRIPT10, Link->X, Link->Y); dummy->UseSprite(Cond(comboflag == CF_PIT, WPS_LINK_FALL, WPS_LINK_LAVA)); dummy->DeadState = dummy->NumFrames*dummy->ASpeed; dummy->DrawXOffset = 0; dummy->DrawYOffset = 0; Falling = dummy->DeadState; NoAction(); Link->Action = LA_NONE; } }
I can't promise anything without a deeper analysis, but that at least has waitframe() inside your while loop and may stop the game from crashing; it may also stop other things from working, as I don;t know what each of these things is doing yet. (I suggest commenting anything that you can.)
Edited by ZoriaRPG, 02 August 2013 - 11:18 AM.