User Tag List

Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 37

Thread: Cane Of Somaria Is Here At Last

  1. #1
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,276
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.91%

    Cane Of Somaria Is Here At Last

    Rejoice, everyone! I have good news and bad news! Good news? Push flags work as Inherent Flags, but more importantly... I MADE A SCRIPT FOR THE CANE OF SOMARIA. AND IT WORKS!!!!

    Code:
    // Cane of Somaria- Changes certain attributes of FFC 32 on the
    // current screen "Player" is on. It modifies the combo used,
    // combo type, flags, etc. In the end, it looks like a block.
    // This item will also change the location of the FFC so it
    // always "spawns" 2 tiles away from Link in the direction he
    // is currently facing. Becuase of limited knowledge, this
    // script currently does not prevent you from walking onto the
    // block. Any mention of "SomariaBlock" in the script refers to
    // Freeform Combo 32. Have fun.
    
    import "std.zh"
    item script CaneSomaria
    {
    	void run()
    	{
    		int sound=30;
    		ffc SomariaBlock= Screen->LoadFFC(32);
    		if(Link->Dir == 0)
    		{
    			SomariaBlock->X = Link->X;
    			SomariaBlock->Y = Link->Y - 16;
    		}
    		else if(Link->Dir == 1)
    		{
    			SomariaBlock->X = Link->X;
    			SomariaBlock->Y = Link->Y + 16;
    		}
    		else if(Link->Dir == 2)
    		{
    			SomariaBlock->X = Link->X - 16;
    			SomariaBlock->Y = Link->Y;
    		}
    		else if(Link->Dir == 3)
    		{
    			SomariaBlock->X = Link->X + 16;
    			SomariaBlock->Y = Link->Y;
    		}
    		float remainder = SomariaBlock->X % 16;
    		if ( remainder <= 8 )
    		{
    			SomariaBlock->X = SomariaBlock->X - remainder;
    		}
    		else
    		{ 
    			SomariaBlock->X = SomariaBlock->X + 16 - remainder;
    		}
    		SomariaBlock->Data = A;
    		SomariaBlock->CSet = B;
    	}
    }
    Replace A with the number of the combo this block uses and B with its Cset. It has no combo type BECAUSE IT CAN BE PUSHED REGARDLESS OF ENEMIES. The bad news? ...I can't make the block solid. Oh yeah, this script puts the block one space away from Link, but you can increase that if you wish.

    If you can make this block solid, let me know IMMEDIATELY so I can finally perfect this. By the way, yes, the FFC the Item (yes, ITEM) uses moves depending on where you are. Make it solid, and we've got the best puzzle EVER. Please help me. Oh yeah, thanks to C-Dawg for helping me learn how to script this. Thanks to him for also helping me with some code. Lastly, thanks to Fire Wizzrobe for telling me how to define "remainder" as a variable. Enjoy.

  2. #2
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,276
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.91%

    Cane of Somaria v2.0

    Not sure what the rule for double-posting is here, but this is important.

    I've revised the code. HERE IS CANE OF SOMARIA V2.0!

    Code:
    // Cane of Somaria- Changes attributes of combo 2 tiles in front of Link if it is not solid.
    // If the combo is solid, this script does nothing.
    // Variables:
    // d0- The combo that the Cane switches a screen's combo to. Simply enter the combo number seen in the combo editor!
    // d1- The CSet of the new combo. Only use 0-11 for best results.
    // d2- Secret Flag of the new combo.
    // d3- Inherent Flag of the new combo.
    // d4- Combo type of the new combo.
    // d5- Solidity of the new combo. Note: SOLIDITY USES THE BINARY SYSTEM. 1111 is total solidity, which is 15 in decimal.
    
    import "std.zh"
    item script CaneSomaria
    {
    	void run()
    	{
    		int SomariaBlockX = Link->X;
    		int SomariaBlockY = Link->Y;
    		int d0 = 2123;
    		int d1 = 10;
    		int d2 = 61;
    		int d3 = 79;
    		int d4 = 0;
    		int d5 = 15;
    		if(Link->Dir == 0)
    		{
    			int BlockCheckY = Link->Y - 32;
    			int BlockCheckX = Link->X;
    			float BlockRmndrX = BlockCheckX % 16;
    			if ( BlockRmndrX <= 8 )
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if ( BlockRmndrY <= 8 )
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockY = SomariaBlockY - 32;
    				float remainder = SomariaBlockX % 16;
    				if ( remainder <= 8 )
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if ( remainderY <= 8 )
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = d0;
    				Screen->ComboC [SomariaBlockPosition] = d1;
    				Screen->ComboF [SomariaBlockPosition] = d2;
    				Screen->ComboI [SomariaBlockPosition] = d3;
    				Screen->ComboT [SomariaBlockPosition] = d4;
    				Screen->ComboS [SomariaBlockPosition] = d5;
    			}
    		else if(Link->Dir == 1)
    		{
    			int BlockCheckY = Link->Y + 32;
    			int BlockCheckX = Link->X;
    			float BlockRmndrX = BlockCheckX % 16;
    			if ( BlockRmndrX <= 8 )
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if ( BlockRmndrY <= 8 )
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockY = SomariaBlockY + 32;
    				float remainder = SomariaBlockX % 16;
    				if ( remainder <= 8 )
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if ( remainderY <= 8 )
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = d0;
    				Screen->ComboC [SomariaBlockPosition] = d1;
    				Screen->ComboF [SomariaBlockPosition] = d2;
    				Screen->ComboI [SomariaBlockPosition] = d3;
    				Screen->ComboT [SomariaBlockPosition] = d4;
    				Screen->ComboS [SomariaBlockPosition] = d5;
    			}
    
    		}
    		else if(Link->Dir == 2)
    		{
    			int BlockCheckY = Link->Y;
    			int BlockCheckX = Link->X - 32;
    			float BlockRmndrX = BlockCheckX % 16;
    			if ( BlockRmndrX <= 8 )
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if ( BlockRmndrY <= 8 )
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockX = SomariaBlockX - 32;
    				float remainder = SomariaBlockX % 16;
    				if ( remainder <= 8 )
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if ( remainderY <= 8 )
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = d0;
    				Screen->ComboC [SomariaBlockPosition] = d1;
    				Screen->ComboF [SomariaBlockPosition] = d2;
    				Screen->ComboI [SomariaBlockPosition] = d3;
    				Screen->ComboT [SomariaBlockPosition] = d4;
    				Screen->ComboS [SomariaBlockPosition] = d5;
    			}
    		}
    		else if(Link->Dir == 3)
    		{
    			int BlockCheckY = Link->Y;
    			int BlockCheckX = Link->X + 32;
    			float BlockRmndrX = BlockCheckX % 16;
    			if ( BlockRmndrX <= 8 )
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if ( BlockRmndrY <= 8 )
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockX = SomariaBlockX + 32;
    				float remainder = SomariaBlockX % 16;
    				if ( remainder <= 8 )
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if ( remainderY <= 8 )
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = d0;
    				Screen->ComboC [SomariaBlockPosition] = d1;
    				Screen->ComboF [SomariaBlockPosition] = d2;
    				Screen->ComboI [SomariaBlockPosition] = d3;
    				Screen->ComboT [SomariaBlockPosition] = d4;
    				Screen->ComboS [SomariaBlockPosition] = d5;
    			}
    		}
    	}
    }
    }
    For some reason, it compiler expects an extra } at the end, which is LINE 255. Yes, TWO HUNDRED FIFTY-FIVE LINES.

    The d-variables are for all 6 of the combo settings. I listed what each is at the top, but I want you to know this: THE VALUE OF COMBOS IS IN BINARY. For example, 15 in decimal equals 1111 in binary, which, when put as the value for ComboS, makes the affected combo totally solid. I'd suggest using only 0 or 15 for the combo. However.... If you'd rather have the combo be half solid, for Caves... Well, let me check first and I'll get back to you.

    My new version uses an actual combo instead of an FFC. To make things better: THIS BLOCK CAN BE PUSHED AND IS SOLID. Thus, I'm almost done. Plus, the block won't spawn on solid combos! I coded THAT myself. The bugs? The item does nothing when used in any direction except north. I need someone to check this for me. Also, I have no idea (yet) how to make only one block appear at a time. To go with the tradition of OoA, the block has an inherent Sword trigger. You can remove that if you wish by writing 0 (or any other flag number) to d3. Other things?

    ...What? It's not enough that the block is solid? And can be removed? Oh well. Trigger one block, AND THEY'RE ALL TRIGGERED. It's because I used 2 flags already. Big deal. Oh yeah, hope you like it. Oh yeah, and by changing the solidity value checker-thing, you could make a Cane that creates a Cave if you use it on a wall with full solidity.... O_o

    ENJOY!

  3. #3
    Developer
    ZC Developer

    Join Date
    Aug 2006
    Location
    Australia
    Age
    37
    Posts
    2,777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,851
    Level
    25
    vBActivity - Bars
    Lv. Percent
    37.69%

    Re: Cane Of Somaria Is Here At Last

    Well, in both LttP and FSA, when you waved the Cane and a block was already onscreen, the block vanished and released four magic beams in compass directions.

    You can check to see if a block is already onscreen by ensuring that the block combo ID is never used elsewhere in the quest, and iterating through the screen combos and checking if instances of that combo ID are present.
    Code:
     for (int i=0; i<176; i++)
       if (Screen->ComboD[i]==d0)
       {
         //remove block, and place four "wand magic" weapons at its location
       }
    I don't think weapon creation exists in ZScript yet, but I've seen ZASM codes for it.

  4. #4
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,276
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.91%

    Re: Cane Of Somaria Is Here At Last

    _L_, jman, other devs, you may want to get ready for an onslaught of requests for the Cane of Somaria to be implemented straight into ZC. Why?

    No words can express the joy I have because... I JUST PERFECTED THE CANE OF SOMARIA. Granted, right now it's only the Oracle of Ages version, but I'll work on the LttP/FSA version at a later time, when making Wand Magic spawn in 4 different directions is a bit more feasible. So, without further ado, I bring you...

    THE CANE OF SOMARIA: ORACLE OF AGES VERSION. This is version 3.0 of my Cane of Somaria script. It has EVERYTHING: Only one block can be on the screen at a time, it can be pushed, slashing it gets rid of it, and anything you'd expect the OoA Cane of Somaria to do (Minus any picking up, of course).

    Code:
    // Cane of Somaria (OoA version)- When used, this item will create a block in front of Link if the block in front of him isn't solid. 
    // If the combo is solid, this script does nothing.
    // Variables:
    // Cmb- The combo that the Cane switches a screen's combo to. Simply enter the combo number seen in the combo editor!
    // CmbC- The CSet of the new combo. Only use 0-11 for best results.
    // CmbS- Secret Flag of the new combo.
    // SomariaCheck- A special variable used only for checking if a Somaria Block is already on-screen. Creating a Block
    // sets this Variable to 1. Destroying one sets it to 0. This variable is checked only by one function. DO NOT MESS WITH IT!!!!
    // CmbR- The combo the Block resets to when SomariaCheck is set to 1 when you use this item.
    // CmbRC- CSet the of the reset combo.
    // CmbRS- Secret Flag of the reset combo.
    
    import "std.zh"
    item script CaneSomariaOoA
    {
    	int SomariaBlockX = 0;
    	int SomariaBlockY = 0;
    	int SomariaCheck = 0;
    	int SomariaBlockPosition = 0;
    	int CurScreen = 0;
    	int LastScreen = 0;
    	int CurMap = 0;
    	int LastMap = 0;
    	int Cmb = A;
    	int CmbC = B;
    	int CmbS = C;
    	int CmbR = D;
    	int CmbRC = E;
    	int CmbRS = F;
    
    	void run()
    	{
    		CurScreen = Game->GetCurScreen();
    		CurMap = Game->GetCurMap();
    		if (CurScreen != LastScreen)
    		{
    			SomariaCheck = 0;
    		}
    		else if (CurMap != LastMap)
    		{
    			SomariaCheck = 0;
    		}
    		if (SomariaCheck == 1)
    		{
    			SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    			if (Screen->ComboS [SomariaBlockPosition] == 15)
    			{
    				Screen->ComboD [SomariaBlockPosition] = CmbR;
    				Screen->ComboC [SomariaBlockPosition] = CmbRC;
    				Screen->ComboF [SomariaBlockPosition] = CmbRS;
    				SomariaCheck = 0;
    			}
    		}
    		if (Link->Dir == 0)
    		{
    			int BlockCheckY = Link->Y - 32;
    			int BlockCheckX = Link->X;
    			float BlockRmndrX = BlockCheckX % 16;
    			if (BlockRmndrX <= 8)
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if (BlockRmndrY <= 8)
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockY = Link->Y - 32;
    				SomariaBlockX = Link->X;
    				float remainder = SomariaBlockX % 16;
    				if (remainder <= 8)
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if (remainderY <= 8)
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = Cmb;
    				Screen->ComboC [SomariaBlockPosition] = CmbC;
    				Screen->ComboF [SomariaBlockPosition] = CmbS;
    			}
    		}
    		else if (Link->Dir == 1)
    		{
    			int BlockCheckY = Link->Y + 32;
    			int BlockCheckX = Link->X;
    			float BlockRmndrX = BlockCheckX % 16;
    			if (BlockRmndrX <= 8)
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if (BlockRmndrY <= 8)
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockY = Link->Y + 32;
    				SomariaBlockX = Link->X;
    				float remainder = SomariaBlockX % 16;
    				if (remainder <= 8)
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if (remainderY <= 8)
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = Cmb;
    				Screen->ComboC [SomariaBlockPosition] = CmbC;
    				Screen->ComboF [SomariaBlockPosition] = CmbS;
    			}
    
    		}
    		else if (Link->Dir == 2)
    		{
    			int BlockCheckY = Link->Y;
    			int BlockCheckX = Link->X - 32;
    			float BlockRmndrX = BlockCheckX % 16;
    			if (BlockRmndrX <= 8)
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if (BlockRmndrY <= 8)
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockX = Link->X - 32;
    				SomariaBlockY = Link->Y;
    				float remainder = SomariaBlockX % 16;
    				if (remainder <= 8)
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if (remainderY <= 8)
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = Cmb;
    				Screen->ComboC [SomariaBlockPosition] = CmbC;
    				Screen->ComboF [SomariaBlockPosition] = CmbS;
    			}
    		}
    		else if (Link->Dir == 3)
    		{
    			int BlockCheckY = Link->Y;
    			int BlockCheckX = Link->X + 32;
    			float BlockRmndrX = BlockCheckX % 16;
    			if (BlockRmndrX <= 8)
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if ( BlockRmndrY <= 8 )
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockX = Link->X + 32;
    				SomariaBlockY = Link->Y;
    				float remainder = SomariaBlockX % 16;
    				if (remainder <= 8)
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if (remainderY <= 8)
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = Cmb;
    				Screen->ComboC [SomariaBlockPosition] = CmbC;
    				Screen->ComboF [SomariaBlockPosition] = CmbS;
    			}
    		}
    		LastScreen = CurScreen;
    		LastMap = CurMap;
    		SomariaCheck = 1;
    	}
    }
    Replace "A" with the number of the combo the Cane will "spawn". If you wish to have a poof, use the "poof" animation as the starting combo and have it cycle to the pushable block. Just... Be careful. This script places the block on layer 0, so try to put the ground on Layers 1 or 2, okay? And give the poof the push flag, too. :) "B" is the Cset of the starting combo. "C" is its Secret Flag. I have it set to 79 because in OoA, hitting the block with your Sword made it vanish. You can replace that with anything else if you want, EXCEPT THE PUSH FLAG. Unless you LIKE pushing non-solid ground. No fun, is it? That's why every pushable combo in the cycle MUST HAVE THE PUSH FLAG AS AN INHERENT COMBO. That way it vanishes. Since trigger flags remove themselves when you trigger them (even as normal flags), it's perfectly fine to use the Sword flag as a normal flag. However, no singular flags can be put on them this way. May I suggst 2.11's Slash->Next combo? Seriously, that'd be MUCH better (WHY DIDN'T I THINK OF THAT UNTIL JUST NOW?! XD). So, you can just leave "C" at 0 if you wish. "D" is the combo that is used to "remove" the Block if one is on the screen. Set it like you would Cmb, but remember, this one HAS to cycle back to normal, walkable ground! "E" is the CSet the combo uses when it "resets" to normal ground. Simple, no? Finally, "F" is, as you'd expect, the Secret Flag of the combo when "reset".

    If you create a block but leave the screen, SomariaCheck (the Variable that tells if a Block is on the screen or not) will stay at 1 (Block is on the screen). Thus, you'd expect the script to try to remove a Block that isn't there anymore, right? That's what the CurScreen, LastScreen, CurMap, and LastMap variables are for. If CurScreen doesn't equal LastScreen, SomariaCheck is set to 0. If it does, then if CurMap and LastMap don't equal each other, SomariaCheck is set to 0. If all are equal to their Last counterparts, nothing happens.

    But what if you make a Block, leave the screen, and come back without making a block on the other screen? The Block will be gone, but SomariaCheck is still 1! Wouldn't that make the script try to "remove" a Block that isn't there? Not a chance! I figured that in case something went wrong in the checking of the value of SomariaCheck, another check would be needed just in case. I never knew that THIS is what it'd be for. After checking the value of SomariaCheck, if it's 1, the script ALSO checks for Total Solidity (Screen->ComboS[] == 15) at the SomariaBlock's last location. If total solidity is there, the values of CmbR, CmbRC, and CmbRS are placed there. If not, it obviously means you switched screens and came back, so there's no Block there. And it actually works. It then resets SomariaCheck back to 0 (Just for completeness and because of common sense- It's not really needed, but SomariaCheck is 1 if there IS a block on the screen, so common sense says that it doesn't need to be 1 anymore if a block isn't there. ).

    The rest places the block onto the screen. Now... I'd suggest you leave the script alone after this point, but just in case you wish to make the block spawn one tile in front of you instead, here you go:

    Code:
    // Cane of Somaria (OoA version)- When used, this item will create a block in front of Link if the block in front of him isn't solid. 
    // If the combo is solid, this script does nothing.
    // Variables:
    // Cmb- The combo that the Cane switches a screen's combo to. Simply enter the combo number seen in the combo editor!
    // CmbC- The CSet of the new combo. Only use 0-11 for best results.
    // CmbS- Secret Flag of the new combo.
    // CmbI- Inherent Flag of the new combo.
    // CmbT- Combo type of the new combo.
    // CmbS- Solidity of the new combo. Note: SOLIDITY USES THE BINARY SYSTEM. 1111 is total solidity, which is 15 in decimal.
    // SomariaCheck- A special variable used only for checking if a Somaria Block is already on-screen. Creating a Block
    // sets this Variable to 1. Destroying one sets it to 0. This variable is checked only by one function. DO NOT MESS WITH IT!!!!
    // CmbR- The combo the Block resets to when SomariaCheck is set to 1 when you use this item.
    // CmbRC- CSet the of the reset combo.
    // CmbRS- Secret Flag of the reset combo.
    
    import "std.zh"
    item script CaneSomariaOoA
    {
    	int SomariaBlockX = 0;
    	int SomariaBlockY = 0;
    	int SomariaCheck = 0;
    	int SomariaBlockPosition = 0;
    	int CurScreen = 0;
    	int LastScreen = 0;
    	int CurMap = 0;
    	int LastMap = 0;
    	int Cmb = 2123;
    	int CmbC = 10;
    	int CmbS = 79;
    	int CmbR = 0;
    	int CmbRC = 2;
    	int CmbRS = 0;
    
    	void run()
    	{
    		CurScreen = Game->GetCurScreen();
    		CurMap = Game->GetCurMap();
    		if (CurScreen != LastScreen)
    		{
    			SomariaCheck = 0;
    		}
    		else if (CurMap != LastMap)
    		{
    			SomariaCheck = 0;
    		}
    		if (SomariaCheck == 1)
    		{
    			SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    			if (Screen->ComboS [SomariaBlockPosition] == 15)
    			{
    				Screen->ComboD [SomariaBlockPosition] = CmbR;
    				Screen->ComboC [SomariaBlockPosition] = CmbRC;
    				Screen->ComboF [SomariaBlockPosition] = CmbRS;
    				SomariaCheck = 0;
    			}
    		}
    		if (Link->Dir == 0)
    		{
    			int BlockCheckY = Link->Y - 16;
    			int BlockCheckX = Link->X;
    			float BlockRmndrX = BlockCheckX % 16;
    			if (BlockRmndrX <= 8)
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if (BlockRmndrY <= 8)
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockY = Link->Y - 16;
    				SomariaBlockX = Link->X;
    				float remainder = SomariaBlockX % 16;
    				if (remainder <= 8)
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if (remainderY <= 8)
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = Cmb;
    				Screen->ComboC [SomariaBlockPosition] = CmbC;
    				Screen->ComboF [SomariaBlockPosition] = CmbS;
    			}
    		}
    		else if (Link->Dir == 1)
    		{
    			int BlockCheckY = Link->Y + 16;
    			int BlockCheckX = Link->X;
    			float BlockRmndrX = BlockCheckX % 16;
    			if (BlockRmndrX <= 8)
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if (BlockRmndrY <= 8)
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockY = Link->Y + 16;
    				SomariaBlockX = Link->X;
    				float remainder = SomariaBlockX % 16;
    				if (remainder <= 8)
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if (remainderY <= 8)
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = Cmb;
    				Screen->ComboC [SomariaBlockPosition] = CmbC;
    				Screen->ComboF [SomariaBlockPosition] = CmbS;
    			}
    
    		}
    		else if (Link->Dir == 2)
    		{
    			int BlockCheckY = Link->Y;
    			int BlockCheckX = Link->X - 16;
    			float BlockRmndrX = BlockCheckX % 16;
    			if (BlockRmndrX <= 8)
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if (BlockRmndrY <= 8)
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockX = Link->X - 16;
    				SomariaBlockY = Link->Y;
    				float remainder = SomariaBlockX % 16;
    				if (remainder <= 8)
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if (remainderY <= 8)
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				int SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = Cmb;
    				Screen->ComboC [SomariaBlockPosition] = CmbC;
    				Screen->ComboF [SomariaBlockPosition] = CmbS;
    			}
    		}
    		else if (Link->Dir == 3)
    		{
    			int BlockCheckY = Link->Y;
    			int BlockCheckX = Link->X + 16;
    			float BlockRmndrX = BlockCheckX % 16;
    			if (BlockRmndrX <= 8)
    			{
    				BlockCheckX = BlockCheckX - BlockRmndrX;
    			}
    			else
    			{
    				BlockCheckX = BlockCheckX + 16 - BlockRmndrX;
    			}
    			float BlockRmndrY = BlockCheckY % 16;
    			if ( BlockRmndrY <= 8 )
    			{
    				BlockCheckY = BlockCheckY - BlockRmndrY;
    			}
    			else
    			{ 
    				BlockCheckY = BlockCheckY + 16 - BlockRmndrY;
    			}
    			int BlockPosition = (BlockCheckY & 240)+(BlockCheckX>>4);
    			if (Screen->ComboS [BlockPosition] == 0)
    			{
    				SomariaBlockX = Link->X + 16;
    				SomariaBlockY = Link->Y;
    				float remainder = SomariaBlockX % 16;
    				if (remainder <= 8)
    				{
    					SomariaBlockX = SomariaBlockX - remainder;
    				}
    				else
    				{ 
    					SomariaBlockX = SomariaBlockX + 16 - remainder;
    				}
    				float remainderY = SomariaBlockY % 16;
    				if (remainderY <= 8)
    				{
    					SomariaBlockY = SomariaBlockY - remainderY;
    				}
    				else
    				{
    					SomariaBlockY = SomariaBlockY + 16 - remainderY;
    				}
    				SomariaBlockPosition = (SomariaBlockY & 240)+(SomariaBlockX>>4);
    				Screen->ComboD [SomariaBlockPosition] = Cmb;
    				Screen->ComboC [SomariaBlockPosition] = CmbC;
    				Screen->ComboF [SomariaBlockPosition] = CmbS;
    			}
    		}
    		LastScreen = CurScreen;
    		LastMap = CurMap;
    		SomariaCheck = 1;
    	}
    }
    Same stuff as before, but all instances of the number "32" have been replaced with "16". Have fun, and a special demo will come soon featuring the Cane of Somaria and many things you can do with it!

    Oh yeah, and as for the LttP/FSA-style Cane, I'm planning on doing that next. You're not the only one who assumed I was making the original Cane of Somaria, _L_. :p

  5. #5
    Gibdo Dlbrooks33's Avatar
    Join Date
    Aug 2005
    Age
    31
    Posts
    524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,372
    Level
    16
    vBActivity - Bars
    Lv. Percent
    1.31%

    Re: Cane Of Somaria Is Here At Last

    He got the idea of doing this from my game :). Its pretty good too.

  6. #6
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,276
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.91%

    Re: Cane Of Somaria Is Here At Last

    Quote Originally Posted by Dlbrooks33 View Post
    He got the idea of doing this from my game :). Its pretty good too.
    I already told you, I DIDN'T GET THE IDEA OF DOING THIS FROM YOUR GAME. You're just trying to steal my credit. :mad:

    Oh, speaking of credit... Heh, I forgot to give it.

    C-Dawg: Helping me understand ZScript and a few commands I had trouble comprehending. Also gave me the code I used for positioning the block. :)
    Fire Wizzrobe: Helping me a tiny bit with my script by giving me a few pieces of code to use for lining the block up JUST RIGHT.
    Saffith: Helping me greatly clean up my code by alerting me to some of my errors. Also taught me how to declare global variables. XD
    Nintendo: Making the Cane of Somaria. DUH!

    Did I forget anyone? And no Revfan, you don't get credit for the little mentions of ZASM you did. How would that have helped? :p

  7. #7
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.88%

    Re: Cane Of Somaria Is Here At Last

    Good job.

    But, holy shit, "I'd like to thank all the people who made this possible!"? You didn't win an academy award, bro. Chill out.

  8. #8
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,276
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.91%

    Re: Cane Of Somaria Is Here At Last

    Quote Originally Posted by C-Dawg View Post
    Good job.

    But, holy shit, "I'd like to thank all the people who made this possible!"? You didn't win an academy award, bro. Chill out.
    Sorry. I just wanted to show my appreciation. Is that so wrong? But in all honesty, I was about to give up on the script. It took me a little while to remember that at first, no matter what the values of CurScreen, LastScreen, CurMap, and LastMap were set to, the end result would be the same- SomariaCheck would be 0. I don't know why it took me as long as itdid to figure that out. I mean, it was so obvious.

  9. #9
    Keese
    Join Date
    Dec 2006
    Age
    34
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    747
    Level
    9
    vBActivity - Bars
    Lv. Percent
    60.76%

    Re: Cane Of Somaria Is Here At Last

    how do you get the item after you load the script?

  10. #10
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,276
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.91%

    Re: Cane Of Somaria Is Here At Last

    Give the script to an item that can already be placed in the subscreen AND be used, like the Wand!

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