User Tag List

Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 30 of 35

Thread: Checking for integers and floats....

  1. #21
    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.89%

    Re: Checking for integers and floats....

    Too late, Saffith- I finished the script. I defeated many bugs, and it's now perfected and in Script Showcase. Go check it out. This thread (and all the other ones with the questions I asked) can be closed now. :)

  2. #22
    Keese
    Join Date
    Aug 2005
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    831
    Level
    10
    vBActivity - Bars
    Lv. Percent
    8.42%

    Re: Checking for integers and floats....

    I wrote a variation of the script with a different function;

    Code:
    import "std.zh"
    item script Somaria{
    
    	int blockY = 0;
    	int blockX = 0;
    	int blockcombo = 0;
    	int blocksecrect = 0;
    	int blockCset = 0;
    	bool disapear = false;
    
    		void run()
    
    		int blockcheckY = 0;
    		int blockcheckX = 0;
    		float RmndrX = 0;
    		float RmndrY = 0;
    		float BlockrmndrX = 0;
    		float BlockrmndrY = 0;
    		int Blockposition = 0;
    
    			if (dispear == false){
    				
    				if (Link->Dir == 0){
    				blockcheckY = Link->Y - 32;
    				blockcheckX = Link->X;
    				RmndrX = blockcheckX % 16;
    	
    					if (RmndX <= 8){
                    			blockcheckX = blockcheckX - RmndrX;
                				}
                				else
                				{
                    			blockcheckX = blockcheckX + 16 - RmndrX;
                				}
                			
    					RmndrY = blockcheckY % 16;
                			
    					if (RmndrY <= 8){
                				{
                    			blockcheckY = blockcheckY - RmndrY;
                				}
                				else
                				{
                    			blockcheckY = blockcheckY + 16 - RmndrY;
               			 	}
    
    					if (ComboAt(blockcheckX, blockcheckY) == 0){
    					BlockrmndrX = blockX % 16;
    				
    					if (BlockrmndrX <= 8){
                    			blockX = blockX - BlockrmndrX;
                				}
                				else
                				{
                    			blockX = blockX + 16 - BlockrmndrX;
                				}
                				BlockrmndrY = blockY % 16;
    
                				if (BlockRmndrY <= 8){
                				{
                    			blockY = blockY - BlockrmndrY;
                				}
                				else
                				{
                    			blockY = blockY + 16 - BlockrmndrY;
               				}			
    					int Blockposition = (ComboAt(blockX, blockY))
    					Screen->ComboD [Blockposition] = blockcombo;
                    			Screen->ComboC [Blockposition] = blockCset;
                    			Screen->ComboF [Blockposition] = blocksecret;
                    			disapear = true;
    				}
    
    				if (Link->Dir == 1){
    				blockcheckY = Link->Y + 32;
    				blockcheckX = Link->X;
    				RmndrX = blockcheckX % 16;
    	
    					if (RmndX <= 8){
                    			blockcheckX = blockcheckX - RmndrX;
                				}
                				else
                				{
                    			blockcheckX = blockcheckX + 16 - RmndrX;
                				}
                			
    					RmndrY = blockcheckY % 16;
                			
    					if (RmndrY <= 8){
                				{
                    			blockcheckY = blockcheckY - RmndrY;
                				}
                				else
                				{
                    			blockcheckY = blockcheckY + 16 - RmndrY;
               			 	}
    
    					if (ComboAt(blockcheckX, blockcheckY) == 0){
    					BlockrmndrX = blockX % 16;
    				
    					if (BlockrmndrX <= 8){
                    			blockX = blockX - BlockrmndrX;
                				}
                				else
                				{
                    			blockX = blockX + 16 - BlockrmndrX;
                				}
                				BlockrmndrY = blockY % 16;
    
                				if (BlockRmndrY <= 8){
                				{
                    			blockY = blockY - BlockrmndrY;
                				}
                				else
                				{
                    			blockY = blockY + 16 - BlockrmndrY;
               				}			
    					int Blockposition = (ComboAt(blockX, blockY))
    					Screen->ComboD [Blockposition] = blockcombo;
                    			Screen->ComboC [Blockposition] = blockCset;
                    			Screen->ComboF [Blockposition] = blocksecret;
                    			disapear = true;
    				}
    
    
    				if (Link->Dir == 2){
    				blockcheckY = Link->Y;
    				blockcheckX = Link->X - 32;
    				RmndrX = blockcheckX % 16;
    	
    					if (RmndX <= 8){
                    			blockcheckX = blockcheckX - RmndrX;
                				}
                				else
                				{
                    			blockcheckX = blockcheckX + 16 - RmndrX;
                				}
                			
    					RmndrY = blockcheckY % 16;
                			
    					if (RmndrY <= 8){
                				{
                    			blockcheckY = blockcheckY - RmndrY;
                				}
                				else
                				{
                    			blockcheckY = blockcheckY + 16 - RmndrY;
               			 	}
    
    					if (ComboAt(blockcheckX, blockcheckY) == 0){
    					BlockrmndrX = blockX % 16;
    				
    					if (BlockrmndrX <= 8){
                    			blockX = blockX - BlockrmndrX;
                				}
                				else
                				{
                    			blockX = blockX + 16 - BlockrmndrX;
                				}
                				BlockrmndrY = blockY % 16;
    
                				if (BlockRmndrY <= 8){
                				{
                    			blockY = blockY - BlockrmndrY;
                				}
                				else
                				{
                    			blockY = blockY + 16 - BlockrmndrY;
               				}			
    					int Blockposition = (ComboAt(blockX, blockY))
    					Screen->ComboD [Blockposition] = blockcombo;
                    			Screen->ComboC [Blockposition] = blockCset;
                    			Screen->ComboF [Blockposition] = blocksecret;
                    			disapear = true;
    				}
    
    				if (Link->Dir == 3){
    				blockcheckY = Link->Y;
    				blockcheckX = Link->X + 32;
    				RmndrX = blockcheckX % 16;
    	
    					if (RmndX <= 8){
                    			blockcheckX = blockcheckX - RmndrX;
                				}
                				else
                				{
                    			blockcheckX = blockcheckX + 16 - RmndrX;
                				}
                			
    					RmndrY = blockcheckY % 16;
                			
    					if (RmndrY <= 8){
                				{
                    			blockcheckY = blockcheckY - RmndrY;
                				}
                				else
                				{
                    			blockcheckY = blockcheckY + 16 - RmndrY;
               			 	}
    
    					if (ComboAt(blockcheckX, blockcheckY) == 0){
    					BlockrmndrX = blockX % 16;
    				
    					if (BlockrmndrX <= 8){
                    			blockX = blockX - BlockrmndrX;
                				}
                				else
                				{
                    			blockX = blockX + 16 - BlockrmndrX;
                				}
                				BlockrmndrY = blockY % 16;
    
                				if (BlockRmndrY <= 8){
                				{
                    			blockY = blockY - BlockrmndrY;
                				}
                				else
                				{
                    			blockY = blockY + 16 - BlockrmndrY;
               				}			
    					Blockposition = (ComboAt(blockX, blockY))
    					Screen->ComboD [Blockposition] = blockcombo;
                    			Screen->ComboC [Blockposition] = blockCset;
                    			Screen->ComboF [Blockposition] = blocksecret;
                    			disapear = true;
    				}
    			}
    			else
    			{
    			Blockposition = (ComboAt(blockX, blockY))
    			Screen->ComboD [Blockposition] = 0;
                    	Screen->ComboF [Blockposition] = 0;
                    	disapear = false;
    			}
    		
    		} //End of void run
    
    } //End of Script
    The compiler gives me "Unexpected Identifier" at this part, and I have no idea why.

    Code:
    Screen->ComboD [Blockposition] = blockcombo;

  3. #23
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,433
    Level
    24
    vBActivity - Bars
    Lv. Percent
    70.03%

    Re: Checking for integers and floats....

    Because you forgot the semicolon on the line before.

  4. #24
    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.89%

    Re: Checking for integers and floats....

    So, what exactly does THAT do, Fire Wizzrobe? What's its "different function"?

  5. #25
    Keese
    Join Date
    Aug 2005
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    831
    Level
    10
    vBActivity - Bars
    Lv. Percent
    8.42%

    Re: Checking for integers and floats....

    Ooh. That's embarrassing.

    It also gives me "Unexpected End" at two lines after the end of the FFC script bracket.

    Pikaguy- It make appear and reappear by the swinging of the cane and does not go away when you leave the screen.

  6. #26
    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.89%

    Re: Checking for integers and floats....

    Quote Originally Posted by Fire Wizzrobe View Post
    Ooh. That's embarrassing.

    It also gives me "Unexpected End" at two lines after the end of the FFC script bracket.

    Pikaguy- It make appear and reappear by the swinging of the cane and does not go away when you leave the screen.
    WHAT?! That's not what the Cane of Somaria did in ANY Zelda game. Maybe that script should be called "the Second Cane of Somaria".

    Double-check your script some more. One time, I accidentally forgot to close an "if" statement, which created my "Cane only works when facing North" problem. XD You may have forgotten some braces here and there (Brackets are [], parentheses are (), and BRACES are {}.), so check back over it. It never hurts to double-check your work before you release it, as I have just recently RElearned. (My first learning of it was when I released Adventure in Mysteria. XD I'll never make THAT mistake with quests again.) Then again, it CAN take some people a while to fix sme obvious bugs... Sometimes, answers are directly in front of your face, but you'll often miss them. Anyways... Good luck on your script.

    Say, Saffith, I have a question. When testing my Cane of Somaria script, I noticed once that when I pushed a normal block with Flag 61 (Push (4-Way, Infinite, Silent)), the block triggered secrets, even though its flag wasn't supposed to do that when pushed. When I push my Somaria Block, it doesn't do that. Is Flag 61 bugged or something?

  7. #27
    Keese
    Join Date
    Aug 2005
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    831
    Level
    10
    vBActivity - Bars
    Lv. Percent
    8.42%

    Re: Checking for integers and floats....

    I can call it Cane of Somaria if I want. I don't see why that matters. It's just not being faithful to the Zelda games, but it probably will be called something else.

    For example, there's a room in my game where 4 four block triggers lie and they can only be accessed through 4 different passages. 3 of them have blocks next to the triggers, but one doesn't, so this is where my script comes in.

  8. #28
    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.89%

    Re: Checking for integers and floats....

    Quote Originally Posted by Fire Wizzrobe View Post
    I can call it Cane of Somaria if I want. I don't see why that matters. It's just not being faithful to the Zelda games, but it probably will be called something else.

    For example, there's a room in my game where 4 four block triggers lie and they can only be accessed through 4 different passages. 3 of them have blocks next to the triggers, but one doesn't, so this is where my script comes in.
    I must've misworded my post... I think people should call your script the Second Cane of Somaria, so they won't accidentally make newbies to the Cane think that it does that in ALL Zelda games. Then there might be people who think you're trying to recreate the LttP/FSA or OoA Canes, so they'd bug you about the fact that it doesn't work exactly like those. Or, we could call it "Superb Ultra Cane of the Great and Mighty Fire Wizzrobe". =)

    Why not make an example quest of how people could use your script, like I'm doing? I'm making an example quest showing all the various ways my script can be used. :)

  9. #29
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,433
    Level
    24
    vBActivity - Bars
    Lv. Percent
    70.03%

    Re: Checking for integers and floats....

    Quote Originally Posted by Fire Wizzrobe
    It also gives me "Unexpected End" at two lines after the end of the FFC script bracket.
    You seem to have left out a few closing braces. I haven't checked which ones, exactly.

    Quote Originally Posted by pikaguy900
    When testing my Cane of Somaria script, I noticed once that when I pushed a normal block with Flag 61 (Push (4-Way, Infinite, Silent)), the block triggered secrets, even though its flag wasn't supposed to do that when pushed. When I push my Somaria Block, it doesn't do that. Is Flag 61 bugged or something?
    Yeah, seems to be. Should be easy to fix, though.

  10. #30
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.48%

    Re: Checking for integers and floats....

    As to the earlier problem: global variables are initialized at the very beginning of the game, and can currently only be initialized to constants. In the next revision of the language I'll make sure Game, Screen, and Link are in scope for global variable initializations.
    For now, if you need to initialize global variables at game start, write a game script called ~Init:
    Code:
    ffc script foo {
       int global;
    }
    
    game script ~Init {
        void run() {
            foo->global = Game->whatever();
        }
    }

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