Re: Permanent pseudo-solidity?
Edit: Whoops. It seems I posted too soon. :laughing:
Well, what do you think the problem is? Do you think that perhaps the script-attaching for the FFCs is broken in beta 16c (No, I won't use 2.5 beta 116 yet)?
Edit: Yep, script-attaching is broken. I can set the FFC's script to 3, save the quest, close the editor, and open it again, and the script is reset back to 0. This means that your script may actually work! Fire Wizzrobe, if you've worked on that code anymore, DON'T DELETE IT. Save it, in case the code doesn't work. However, since it worked for the item (Whose script doesn't seem to get reset), I'm POSITIVE it'll work on the FFC, but it might turn the whole screen solid. I'll have to wait for the bug to get fixed before I can find out, so SAVE ANY CHANGES YOU'VE DONE TO THE CODE FOR NOW.
Edit2: Well, it doesn't seem like the bug report is getting noticed. So, I thought of a new idea that actually is another way to accomplish my original plan for the Cane of Somaria (which was to spawn a certain combo 2 tiles away from Link when he used the item)! My new idea? CHANGE THE COMBO TWO TILES AWAY FROM LINK. I began with a piece of the code you recently gave me Fire Wizzrobe. I modified it all to go with combos, and, in the process, I used EVERY SINGLE COMBO MODIFIER, just for safety. That includes inherent flags, by the way. I then modified the very first pointer I made so instead of modifying an FFC, it modifies a pointer to hold Link's X position (Well, I had to declare a pointer, so I decided to just declare it as Link's X position- The value has no bearing after that). I also declared a pointer for Link's Y position. However, I didn't stop there- I decided to make a code to check for the solidity of a combo 2 tiles away from Link. However, because the X and Y positions of the block must be different depending on Link's direction, this code needed 4 versions, just like the modifiers for the combo. The variables are BlockCheckX and BlockCheckY. After that, I made a modification of C-Dawg's code for moving the Somaria Block to the nearest tile. The modification stores the location of the block 2 tiles away from Link. After that is a modification of your code for declaring a variable to store the location of the combo below an FFC. Because I'm using combos now, I needed to take away some of the code to compensate. Anyways, my modification does bascially what yours did, but to a new variable. Then comes my favorite part- THE SOLIDITY CHECK. It's an if statement. If the block at the position stored in variable "BlockPosition" (The variable I declared in the last modification of code) has a solidity of 0 (meaning no solidity AT ALL), the block is moved to that location. By the way, the first two pointers (SomariaBlockX and SomariaBlockY) have no true purpose until the last bits of code are executed, since they're not for anything but storing data.
If you wish, I'll post the code I now have. I won't test it yet because I'm so nervous. That, and I just proved something that I KNEW was true: I LEARN QUICKLY. Just look- I modified most of the code in the script to check for solidity of a seperate combo. All I need is a push in the right direction, kinda like with a wind-up toy. :laughing:
Re: Permanent pseudo-solidity?
3rd attempt. It's untested.
Code:
// Cane of Somaria- Changes certain attributes of an FFC 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
// the Freeform Combo. Have fun.
// Note: Due to limitations (and the SomariaBlock script (see below
// this script)), only FFC 1 can be used as the Somaria Block
// until the FFC script bug is destroyed.<-What is this bug you speak of?
import "std.zh"
item script CaneSomaria
{
void run()
{
ffc SomariaBlock = Screen->LoadFFC(1);//Set the coordinates to -16, -16
SomariaBlock->Data = 2123;
SomariaBlock->CSet = 10;
if(Link->Dir == 0)
{
SomariaBlock->X = Link->X;
SomariaBlock->Y = Link->Y - 32;
}
else if(Link->Dir == 1)
{
SomariaBlock->X = Link->X;
SomariaBlock->Y = Link->Y + 32;
}
else if(Link->Dir == 2)
{
SomariaBlock->X = Link->X - 32;
SomariaBlock->Y = Link->Y;
}
else if(Link->Dir == 3)
{
SomariaBlock->X = Link->X + 32;
SomariaBlock->Y = Link->Y;
}
float remainder = SomariaBlock->X % 16;
if ( remainder <= 8 )
{
SomariaBlock->X = SomariaBlock->X - remainder;
}
else
{
SomariaBlock->X = SomariaBlock->X + 16 - remainder;
}
float remainderY = SomariaBlock->Y % 16;
if ( remainderY <= 8 )
{
SomariaBlock->Y = SomariaBlock->Y - remainderY;
}
else
{
SomariaBlock->Y = SomariaBlock->Y + 16 - remainderY;
}
int ffcy = SomariaBlock->Y;
int ffcx = SomariaBlock->X;
int position = (ffcy & 240)+(ffcx>>4);
Screen->ComboS [position] = 15;
if (position != lastpos)
Screen->ComboS [laspos] = 0;
int laspos = postion;
}
}
Re: Permanent pseudo-solidity?
Quote:
Originally Posted by
Fire Wizzrobe
3rd attempt. It's untested.
Code:
// Cane of Somaria- Changes certain attributes of an FFC 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
// the Freeform Combo. Have fun.
// Note: Due to limitations (and the SomariaBlock script (see below
// this script)), only FFC 1 can be used as the Somaria Block
// until the FFC script bug is destroyed.<-What is this bug you speak of?
import "std.zh"
item script CaneSomaria
{
void run()
{
ffc SomariaBlock = Screen->LoadFFC(1);//Set the coordinates to -16, -16
SomariaBlock->Data = 2123;
SomariaBlock->CSet = 10;
if(Link->Dir == 0)
{
SomariaBlock->X = Link->X;
SomariaBlock->Y = Link->Y - 32;
}
else if(Link->Dir == 1)
{
SomariaBlock->X = Link->X;
SomariaBlock->Y = Link->Y + 32;
}
else if(Link->Dir == 2)
{
SomariaBlock->X = Link->X - 32;
SomariaBlock->Y = Link->Y;
}
else if(Link->Dir == 3)
{
SomariaBlock->X = Link->X + 32;
SomariaBlock->Y = Link->Y;
}
float remainder = SomariaBlock->X % 16;
if ( remainder <= 8 )
{
SomariaBlock->X = SomariaBlock->X - remainder;
}
else
{
SomariaBlock->X = SomariaBlock->X + 16 - remainder;
}
float remainderY = SomariaBlock->Y % 16;
if ( remainderY <= 8 )
{
SomariaBlock->Y = SomariaBlock->Y - remainderY;
}
else
{
SomariaBlock->Y = SomariaBlock->Y + 16 - remainderY;
}
int ffcy = SomariaBlock->Y;
int ffcx = SomariaBlock->X;
int position = (ffcy & 240)+(ffcx>>4);
Screen->ComboS [position] = 15;
if (position != lastpos)
Screen->ComboS [laspos] = 0;
int laspos = postion;
}
}
AHAHAHAHA!!! Read my previous edit- You might be shocked. :p
I'm still keeping the code for the FFC usage, in case people would rather have it like that. Thanks! *goes to test*
Edit: Ummm... It says variables position and laspos are undeclared. I also see that the last thing it does is declares laspos. :p I'm a bit confused, though, seeing as position IS declared....
Re: Permanent pseudo-solidity?
You don't need to do all that. Just attach the secondary script to the third FFC if you want the block properties seperate. As I said, it's not even nesserary to have the two scripts be separated.
Re: Permanent pseudo-solidity?
Quote:
Originally Posted by
Fire Wizzrobe
You don't need to do all that. Just attach the secondary script to the third FFC if you want the block properties seperate. As I said, it's not even nesserary to have the two scripts be separated.
Um, what? Earth to Fire Wizzrobe! I said the script-attaching thing for FFCs is broken in beta 16c! So what good will it do to make a script for an FFC IF THEY WON'T STAY ATTACHED?
And it gives compiler errors when I compile your version.
And by the way, MY newer version is only an Item Script- No secondary script to attach to an FFC here, BECAUSE IT DOESN'T HAVE ANYTHING TO DO WITH AN FFC ANYMORE. :p
Edit: Okay, I'm stumped. I tried to cmplie my new code. Found a few mistakes a corrected them. Now it says "Line 48: Syntax error, unexpected else, on token else". The problem? It looks EXACTLY AS IT SHOULD in the script. Line 48 is now the part where it checks to see if Link is facing down. Problem is, it NEEDS an else or it won't work correctly. It's supposed work like so (in normal words):
"If Link is facing north, do this, else if he's facing south, do this, else if he's facing left, do this, else if he's facing right, do this."
What's so wrong about that? If I take away all the "else"s, it'd end up being:
"If Link is facing north, do this, if he's facing south, do this, if he's facing west, do this, if he's facing east, do this."
That sounds more like it wants to do them all, not, "If I can't do this, then I must do that." It should sound like, "If I can't do this, then I have to see if I can do that. If I can't do that, I'll check if I can do this. If I can't do this, I'll try to do that."
Help?
Re: Permanent pseudo-solidity?
Oh, I meant directly asigned it to the third FFC in a seperate script.
What are the errors?
Re: Permanent pseudo-solidity?
Quote:
Originally Posted by
Fire Wizzrobe
Oh, I meant directly asigned it to the third FFC in a seperate script.
What are the errors?
Line 68: "Variable 'lastpos' is undeclared."
Line 69: "Variable 'lastpos' is undeclared."
Line 71: "Varaible 'position' is undeclared."
...Those are the errors. :p My code only gives the error that the else that MUST be in my script shouldn't be there. I'm leaving it in, whether it likes it or not. If I take it out, I may get an undesired result...
Edit: OMG... I DID IT. The Cane of Somaria v2 is almost ready. If you create the block while facing north... Everything is fine. The block is solid and is pushable. All other directions.... No. Now I'll just copy everything from the checker for facing north and modify it for every other direction! Next step: Find a way to change the a certain combo if it's that Somaria Block. I'd probably make it check for the Block's position and if the location is solid, change the combo. However, my script requires that you put the ground on Layer 1 or 2 if you're using different... Oh, what's the word I'm looking for? Err... Let's just say "looks". You know, like you need to do with the CGBZ tileset. Anyways, the one other flaw... Well, I already said that. So now, Fire Wizzrobe, I just need you to try and code something for checking for a certain combo, if you can. However, you don't HAVE to do it if you don't want to... The way I'm going, I may not need your help anymore! XD
Re: Permanent pseudo-solidity?
Oops, what a careless mistake.
Code:
// Cane of Somaria- Changes certain attributes of an FFC 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
// the Freeform Combo. Have fun.
// Note: Due to limitations (and the SomariaBlock script (see below
// this script)), only FFC 1 can be used as the Somaria Block
// until the FFC script bug is destroyed.<-What is this bug you speak of?
import "std.zh"
item script CaneSomaria
{
void run()
{
ffc SomariaBlock = Screen->LoadFFC(1);//Set the coordinates to -16, -16
SomariaBlock->Data = 2123;
SomariaBlock->CSet = 10;
int position
int laspos
int ffcx
int ffcy
if(Link->Dir == 0)
{
SomariaBlock->X = Link->X;
SomariaBlock->Y = Link->Y - 32;
}
else if(Link->Dir == 1)
{
SomariaBlock->X = Link->X;
SomariaBlock->Y = Link->Y + 32;
}
else if(Link->Dir == 2)
{
SomariaBlock->X = Link->X - 32;
SomariaBlock->Y = Link->Y;
}
else if(Link->Dir == 3)
{
SomariaBlock->X = Link->X + 32;
SomariaBlock->Y = Link->Y;
}
float remainder = SomariaBlock->X % 16;
if ( remainder <= 8 )
{
SomariaBlock->X = SomariaBlock->X - remainder;
}
else
{
SomariaBlock->X = SomariaBlock->X + 16 - remainder;
}
float remainderY = SomariaBlock->Y % 16;
if ( remainderY <= 8 )
{
SomariaBlock->Y = SomariaBlock->Y - remainderY;
}
else
{
SomariaBlock->Y = SomariaBlock->Y + 16 - remainderY;
}
ffcy = SomariaBlock->Y;
ffcx = SomariaBlock->X;
position = (ffcy & 240)+(ffcx>>4);
Screen->ComboS [position] = 15;
if (position != lastpos)
Screen->ComboS [laspos] = 0;
laspos = postion;
}
}
Re: Permanent pseudo-solidity?
Quote:
Originally Posted by
Fire Wizzrobe
Oops, what a careless mistake.
Code:
// Cane of Somaria- Changes certain attributes of an FFC 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
// the Freeform Combo. Have fun.
// Note: Due to limitations (and the SomariaBlock script (see below
// this script)), only FFC 1 can be used as the Somaria Block
// until the FFC script bug is destroyed.<-What is this bug you speak of?
import "std.zh"
item script CaneSomaria
{
void run()
{
ffc SomariaBlock = Screen->LoadFFC(1);//Set the coordinates to -16, -16
SomariaBlock->Data = 2123;
SomariaBlock->CSet = 10;
int position
int laspos
int ffcx
int ffcy
if(Link->Dir == 0)
{
SomariaBlock->X = Link->X;
SomariaBlock->Y = Link->Y - 32;
}
else if(Link->Dir == 1)
{
SomariaBlock->X = Link->X;
SomariaBlock->Y = Link->Y + 32;
}
else if(Link->Dir == 2)
{
SomariaBlock->X = Link->X - 32;
SomariaBlock->Y = Link->Y;
}
else if(Link->Dir == 3)
{
SomariaBlock->X = Link->X + 32;
SomariaBlock->Y = Link->Y;
}
float remainder = SomariaBlock->X % 16;
if ( remainder <= 8 )
{
SomariaBlock->X = SomariaBlock->X - remainder;
}
else
{
SomariaBlock->X = SomariaBlock->X + 16 - remainder;
}
float remainderY = SomariaBlock->Y % 16;
if ( remainderY <= 8 )
{
SomariaBlock->Y = SomariaBlock->Y - remainderY;
}
else
{
SomariaBlock->Y = SomariaBlock->Y + 16 - remainderY;
}
ffcy = SomariaBlock->Y;
ffcx = SomariaBlock->X;
position = (ffcy & 240)+(ffcx>>4);
Screen->ComboS [position] = 15;
if (position != lastpos)
Screen->ComboS [laspos] = 0;
laspos = postion;
}
}
DARN YOU, EDIT BUTTON!!!!!!!!!!!!! :mad:
Please read my last post. I don't need that anymore. I got it myself. :D Though, I'd appreciate it if you'd help me find a way to make one block vanish if one's on the screen, okay? :)