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. :)
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. :)
I wrote a variation of the script with a different function;
The compiler gives me "Unexpected Identifier" at this part, and I have no idea why.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
Code:Screen->ComboD [Blockposition] = blockcombo;
Because you forgot the semicolon on the line before.
So, what exactly does THAT do, Fire Wizzrobe? What's its "different function"?
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?
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. :)
You seem to have left out a few closing braces. I haven't checked which ones, exactly.Originally Posted by Fire Wizzrobe
Yeah, seems to be. Should be easy to fix, though.Originally Posted by pikaguy900
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(); } }
There are currently 1 users browsing this thread. (0 members and 1 guests)