User Tag List

Results 1 to 8 of 8

Thread: [Critical] Trying to set ComboS[] on layer 2 - ZC Terminates

  1. #1
    Mad, Mad, Author ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    763
    Mentioned
    68 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    2,926
    Level
    17
    vBActivity - Bars
    Lv. Percent
    54.55%
    Daily Activity
    0%
    Weekly Activity
    70%
    Monthly Activity
    146.85%

    Sick Bug [Critical] Trying to set ComboS[] on layer 2 - ZC Terminates

    In trying to set ComboS for combos on layer 2, using SetLayerComboS(), I find that while it works perfect for Layer 1, if the same instructions are executed for layer 2, ZC crashes--meaning that ZC fully terminates.

    If you want the script that causes this, I can send it across. I can also provide a quest with the instructions implemented, for debugging.
    Last edited by Tamamo; 12-16-2015 at 05:17 PM.


    Script Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | stdArguments.zh (v.6.9.9/1) | | Timers.zh (v.1.5)
    ZScript | ZC Dev | ZC 2.53 | Alucard's: stdCombos.zh (v1.1) | stdWeapons.zh | particles.z
    All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0.

  2. #2
    ZC Ambassador Tamamo's Avatar
    Join Date
    May 2011
    Location
    Kyoto
    Age
    27
    Posts
    749
    Mentioned
    79 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    4,816
    Level
    21
    vBActivity - Bars
    Lv. Percent
    79.92%
    Daily Activity
    0%
    Weekly Activity
    120%
    Monthly Activity
    484.85%
    It may have something to do with Screen->LayerMap() or Screen->LayerScreen()
    Did you try putting in the values manually?
    Also what solidity value are you using?

    This is the function from std.zh
    Code:
    //A shorthand way to set a combo's solidity on the current layer.
    //Layer 0 is the screen itself.
    void SetLayerComboS(int layer, int pos, int solidity) {
      if (layer == 0)
        Screen->ComboS[pos] = solidity;
      else
        Game->SetComboSolid(Screen->LayerMap(layer), Screen->LayerScreen(layer), pos, solidity);
    }

  3. #3
    Mad, Mad, Author ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    763
    Mentioned
    68 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    2,926
    Level
    17
    vBActivity - Bars
    Lv. Percent
    54.55%
    Daily Activity
    0%
    Weekly Activity
    70%
    Monthly Activity
    146.85%
    Here is the codeblock:

    Code:
    if ( SWITCHHOOK_USE_LAYER_2 ) { //2
    	for ( int q = 0; q < 176; q++ ) { 	//Pass through the screen combos to find a match...
    		int cmb2 = GetLayerComboI(2,q); 	//loading them along the way...
    		cmb2X = ComboX(q);	//The combo number for the for loop pass...
    		cmb2Y = ComboY(q);	//... X and Y
    		int loc = ComboAt(cmb2X,cmb2Y);
    
    		if ( ( comboF && cmb2 == comboF ) || ( !comboF && cmb2 == CF_SWITCHHOOK ) ) { 	
    						//If D0 is assigned a value above 0, check to see if it matches
    						//that combo inherent flag, otherwise check if it matches the one
    						//assigned to the constant CF_SWITCHSHOT.
    			
    						//If it does....
    			//int cmb_under = 
    			
    			//if ( switching ) {
    			if ( ComboCollision(loc,l) ) {	//and there is collision between that combo and the hookshot...
    				
    			//!We need to check every layer...too..for combos on layers higher than 0. (?)
    				l->DeadState = WDS_DEAD;	//Kill the hookshot.
    				
    				if ( sfx ) Game->PlaySound(sfx); //Play the sound defined in the item script,
    				if ( !sfx && SFX_SWITCHHOOK ) Game->PlaySound(SFX_SWITCHHOOK);  //or the constant if the item editor arg isn't set.
    					
    				//Store Link's starting position.
    				lx = CenterLinkX();
    				ly = CenterLinkY();
    					
    				//Store the switchshot combo to move.
    				cmb2X = ComboX(q);	//The combo number for the for loop pass...
    				cmb2Y = ComboY(q);	//... X and Y
    				cmb2D = GetLayerComboD(2,q); //The original data of the switchhook combo.
    				cmb2S = GetLayerComboS(2,q); //The original solidity of the switchshot combo. 
    				cmb2C = GetLayerComboC(2,q); //The original CSet.
    				
    				//Store the combo datum for the cumbo that Link is on. 
    				
    				cmb2LD = GetLayerComboD(2,ComboAt(Link->X, Link->Y)); //The combo under Link.
    				cmb2LS = GetLayerComboS(2,ComboAt(Link->X, Link->Y)); //The solidity of the combo under Link.
    				cmb2LX = GridX(lx); //The X position
    				cmb2LY = GridY(ly); //The Y position
    				cmb2L = ComboAt(cmb2LX,cmb2LY); //The screen index for that combo (Nth of 276).
    				cmb2LC = GetLayerComboC(2,ComboAt(Link->X, Link->Y));
    				
    					
    				//Change the combo where Link WAS, to the switchshot combo.
    				SetLayerComboD(2,cmb2L,cmb2D); //Set its data
    				SetLayerComboS(2,cmb2L,cmb2S); //and solidity.
    				
    				//!Setting solidity on layer 2 crashes ZC....BUT
    				//!the solidity seems to be preserved anyway.
    				
    				SetLayerComboC(2,cmb2L,cmb2C); //and CSet.
    				
    				
    				//Move Link to where the old switchshot combo that we moved, WAS.
    				Link->X = cmb2X;
    				Link->Y = cmb2Y;
    				
    					
    				//Move the switchshot combo to where LINK was before he moved...
    				SetLayerComboD(2,q,cmb2LD); //Set the combo data
    				SetLayerComboS(2,q,cmb2LS); //and the solidity.
    				SetLayerComboC(2,q,cmb2LC); //and CSet.
    
    				
    				this->Script = 0; //Free the FFC for later use.
    				this->Data = 0;
    				Quit();
    			}
    		}
    	}
    }
    Last edited by ZoriaRPG; 11-28-2015 at 04:17 AM.


    Script Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | stdArguments.zh (v.6.9.9/1) | | Timers.zh (v.1.5)
    ZScript | ZC Dev | ZC 2.53 | Alucard's: stdCombos.zh (v1.1) | stdWeapons.zh | particles.z
    All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0.

  4. #4
    Developer ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,610
    Mentioned
    206 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,128
    Level
    32
    vBActivity - Bars
    Lv. Percent
    35.08%
    Daily Activity
    0%
    Weekly Activity
    470%
    Monthly Activity
    403.26%
    So, does this depend on other things or does this work:
    Code:
    ffc script crash{ void run(){ while(true){ Waitframe(); SetLayerComboS(2, 0, 0); } } }
    This post contains the official Gleeok™ seal of approval. Look for these and other posts in an area near you.

  5. #5
    ZC Ambassador Tamamo's Avatar
    Join Date
    May 2011
    Location
    Kyoto
    Age
    27
    Posts
    749
    Mentioned
    79 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    4,816
    Level
    21
    vBActivity - Bars
    Lv. Percent
    79.92%
    Daily Activity
    0%
    Weekly Activity
    120%
    Monthly Activity
    484.85%
    Confirmed with Gleeoks crash ffc script.
    I traced Screen->LayerMap and Screen->LayerScreen, and got the correct values so that's not the issue.

  6. #6
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    34
    Posts
    3,291
    Mentioned
    140 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    5,835
    Level
    23
    vBActivity - Bars
    Lv. Percent
    68.5%
    Daily Activity
    0%
    Weekly Activity
    470%
    Monthly Activity
    146.85%
    You don't have the same problem with ComboD, ComboI, etc., right? For some reason, the code for SetComboSolid is different than the others, and it appears to calculate the screen incorrectly.
    [téknolŕiz]

    ffcscript.zh 1.1.1 - Updated 2014-08-19
    ghost.zh 2.8.1 - Updated 2016-09-16
    tango.zh 1.2.0 - Updated 2016-09-16

  7. #7
    Mad, Mad, Author ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    763
    Mentioned
    68 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    2,926
    Level
    17
    vBActivity - Bars
    Lv. Percent
    54.55%
    Daily Activity
    0%
    Weekly Activity
    70%
    Monthly Activity
    146.85%
    Quote Originally Posted by Saffith View Post
    You don't have the same problem with ComboD, ComboI, etc., right? For some reason, the code for SetComboSolid is different than the others, and it appears to calculate the screen incorrectly.
    It was only ComboS, although i didn't use ComboF, or ComboT in the code where I had this problem. I used ComboD, ComboC, and ComboI--all three worked with no errors--but ComboS caused it to crash. I'll send you the whole script, if you wish.


    Script Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | stdArguments.zh (v.6.9.9/1) | | Timers.zh (v.1.5)
    ZScript | ZC Dev | ZC 2.53 | Alucard's: stdCombos.zh (v1.1) | stdWeapons.zh | particles.z
    All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0.

  8. #8
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    34
    Posts
    3,291
    Mentioned
    140 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    5,835
    Level
    23
    vBActivity - Bars
    Lv. Percent
    68.5%
    Daily Activity
    0%
    Weekly Activity
    470%
    Monthly Activity
    146.85%
    This should be fixed now.
    [téknolŕiz]

    ffcscript.zh 1.1.1 - Updated 2014-08-19
    ghost.zh 2.8.1 - Updated 2016-09-16
    tango.zh 1.2.0 - Updated 2016-09-16

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social