View Full Version : Permanent pseudo-solidity?
Nimono
01-14-2007, 11:38 PM
I tried. I failed. How on earth do I make an FFC pseudo-solid? In my Cane of Somaria script, I give FFC 32 the pointer "SomariaBlock". Throughout the rest of the script, I modify that FFC (seeing as that's what the REAL Cane of Somaria does, anyways). The problem is, C-Dawg told me to grab some piece of code from his multiblock trigger script and put it in my script to fake solidity. I kept trying to get it right, but he kept saying it wouldn't work. He then suggested I make the combo under the block solid instead. First things first: How would I do that last suggestion he made? Second, how exactly would I fake solidity on the FFC itself and still be able to push it?
You know, now that I've given it more thought, the "Make the combo itself solid instead of the FFC" is better, seeing as I can change the combo type, change the walkability, and give it a flag. Only problem would be: How would I make the FFC move with the combo if it was the combo I was pushing instead of the FFC?
Revfan9
01-15-2007, 12:23 AM
...In Zasm, I know that you can set COMBOSD to 4 for the combo directly underneath of the FFC to fake solidity, but I don't know how to do that in Zscript. Although I imagine it would be possible to draw a combo in place of the "FFC", then destroying the combo when it is done, although combo drawing functions are broken in the latest betas.
Nimono
01-15-2007, 12:32 AM
I believe the ZScript equivalent is "int ComboS", but... I have no idea how I'm supposed to call a COMBO to edit on the screen. This is exactly what it says for int ComboS in the documentation:
int ComboS[]
* The walkability mask of the ith combo on the screen, where i is the
* index used to access this array. Combos are counted left to right, top
* to bottom. The least signficant bit is true if the top-left of the tile
* is walkable, the second-least signficant bit is true if the top-right
* of the tile is is walkable, and so on for the following two bits.
The four bits are obviously in binary (which would be 1111, or 15 in decimal, or F in hexadecimal), but how do I know exactly which combo I call from the screen? And how would I even call a specific combo? All I can see that I could put would be something like "Screen->ComboS(15)", but where's the part that tells exactly which combo to call?
Fire Wizzrobe
01-15-2007, 05:03 PM
My guess;
Screen->ComboS [] (combonumber or numbers) = 15;
Nimono
01-15-2007, 05:31 PM
My guess;
Screen->ComboS [] (combonumber or numbers) = 15;
O_o I wish I could get a scriptmaster to help with this... Ah well. See, the problem is, this won't work unless I can make the FFC move with the combo AND have the combo turn back to its previous state when the FFC is no longer on it. THAT is the problem, and it's why I want the FFC solid instead of the combo under it.
Fire Wizzrobe
01-15-2007, 07:20 PM
Ahh.. I think I got it now. The indexes... are well, the combos on screen. :ooh: How could I miss that!? Discard the second set of parentheses.
Nimono
01-15-2007, 07:23 PM
Ahh.. I think I got it now. The indexes... are well, the combos on screen. :ooh: How could I miss that!? Discard the second set of parentheses.
Okay, since you *seem* to understand this, how about helping me get this solidity code working? I want to get this script done ASAP, but I can't if I can't push it or anything.
Fire Wizzrobe
01-15-2007, 07:49 PM
I'm trying to figure out the formula to pinpoint a combo based on the block's X and Y positions right now...
Edit:
Never mind! I got it from std.zh! Script in a second!
int ComboAt(int x, int y) {
return (y & 240)+(x>>4);
}
Edit 2:
#include std.zh //Place at top
(The Block)->ComboAt = ffcpos
Screen->ComboS [ffcpos] = 15;
Nimono
01-15-2007, 08:12 PM
I'm trying to figure out the formula to pinpoint a combo based on the block's X and Y positions right now...
Edit:
Never mind! I got it from std.zh! Script in a second!
int ComboAt(int x, int y) {
return (y & 240)+(x>>4);
}
Edit 2:
#include std.zh //Place at top
(The Block)->ComboAt = ffcpos
Screen->ComboS [ffcpos] = 15;
Did you test the code? Also, which do I use? Plus, do I put "#include std.zh" at the point where I'd normally use the code import "std.zh"? Or should I just use import "std.zh"?
Edit: It doesn't work. When I input it like that, it says that ffcpos is undeclared. When I change it so it IS declared... It says ComboAt isn't a valid pointer. I bet it would instead work like this:
int ffcpos = Screen->ComboAt (FFC_Pointer->X, FFC_Pointer>Y)
...Well, I guess not.
...Great. It's defunct now. It keeps saying that the comma shouldn't be there. But if I took it out, it'd be invalid.
Fire Wizzrobe
01-15-2007, 09:08 PM
I'm sorry. I've only been doing C++ for 2 1/2 months and I suck.
//Declare ffcy, ffcx and position as int variables first (duh)
//Header file is not needed
SomariaBlock->Y = ffcy;
SomariaBlock->X = ffcx;
position = (ffcy & 240)+(ffcx>>4)
Screen->ComboS [position] = 15;
Nimono
01-15-2007, 09:11 PM
I'm sorry. I've only been doing C++ for 2 1/2 months and I suck.
//Declare ffcy, ffcx and position as int variables first (duh)
//Header file is not needed
SomariaBlock->Y = ffcy;
SomariaBlock->X = ffcx;
position = (ffcy & 240)+(ffcx>>4)
Screen->ComboS [position] = 15;
Oh please. I've only been doing it for THREE DAYS. I'll try that snippet of code. ;)
Fire Wizzrobe
01-15-2007, 09:24 PM
I didn't mean to offend you, if I did.
Nimono
01-15-2007, 09:29 PM
I didn't mean to offend you, if I did.
No, I was making the point that you've been doing it longer than I have. :P
Um, by the way, if this doesn't work, and you work on the code some more, will you please test it before you let me have it? I have the Block itself set up as another script so the solidity code doesn't conflict with that of the Cane itself.
Edit: DARN IT!!! I was SOOOOO close to getting the solidity working! But if I put the solidity script in the item script part, it prevents you from moving AT ALL when you use the cane! Oh, by the way, would you mind explaining to me why this is in there:
position = (ffcy & 240)+(ffcx>>4)
What good is that going to do? And PLEASE don't respond with "It was in std.zh, so I put it in there". That's just wrong, seeing as that thing was just an example and probably didn't have the same end result I/we want.
Fire Wizzrobe
01-15-2007, 09:56 PM
Pinpointing the combo. That was the formula I was talking about, and it is not just an example. May I see the script?
Nimono
01-15-2007, 10:00 PM
Okay. I'll only give you version 1 (the one that's just an item script and no FFC script) since version 2 (with both an item and FFC script) doesn't work...
// 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.
import "std.zh"
item script CaneSomaria
{
void run()
{
ffc SomariaBlock = Screen->LoadFFC(1);
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;
}
SomariaBlock->Data = 2123;
SomariaBlock->CSet = 10;
int ffcy = SomariaBlock->Y;
int ffcx = SomariaBlock->X;
int position = (ffcy & 240)+(ffcx>>4);
Screen->ComboS [position] = 15;
}
}
Notes:
-I had to change float to int at the last lines because the compiler expected a semicolon after float.
-I also had to rearrange everything so I could declare variables.
-I WANT TO KNOW WHAT THE HECK THAT LINE I MENTIONED BEFORE DOES.
Edit: By the way, if I don't post very often, it's because I'm watching Supernanny. Yes, I like that show. It proves exactly how chaotic this world really is, and it all begins with the children and irresponsible parents.... Sigh...
Fire Wizzrobe
01-15-2007, 10:38 PM
Please show me the one that doesn't works.
The line preforms bitwise opperation AND with the Y coordinate and >> shifts the bits in the X coordinate by 4 places, otherwise dividing it by 16.
So, if X was 16, it would equal one. AND returns the same values that goes in for multiples of 16. If Y is 0, it will be 0, and if it is 16, it will be 16 and so forth.
The combo 1 tile right of the left hand corner would be labeled as 1. (16,0) The combo below it would be labeled as 17.(16,16) When the values of X and Y are added, it tells ComboS[] looks for these combos in this grid-like pattern.
Nimono
01-15-2007, 10:48 PM
Okay.
// 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.
import "std.zh"
item script CaneSomaria
{
void run()
{
ffc SomariaBlock = Screen->LoadFFC(1);
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;
}
SomariaBlock->Data = 2123;
SomariaBlock->CSet = 10;
}
}
// SomariaBlock- Script for the solidity of the block "created" by the Cane of Somaria.
ffc script SomariaBlock
{
void run()
{
ffc SomariaBlock = Screen->LoadFFC(1);
float ffcy = SomariaBlock->Y;
float ffcx = SomariaBlock->X;
float position = (ffcy & 240)+(ffcx>>4);
Screen->ComboS [position] = 15;
void waitframe;
}
}
The code is attached to the FFC script here, but... Either the code isn't working, on the script gets turned off because I'm modifying it through the item script. Is there a command to modify the script number a FFC uses?
Fire Wizzrobe
01-15-2007, 11:00 PM
Screen->LoadFFC(2);
It's the number between the brackets. :P
Nimono
01-15-2007, 11:02 PM
Screen->LoadFFC(2);
It's the number between the brackets. :P
??? What do you mean? Did you even test to see if it works? Are you saying I replace Screen->LoadFFC(1) with Screen->LoadFFC(2)?
Fire Wizzrobe
01-15-2007, 11:23 PM
Just combine the two scripts. The number in between the bracket refers to the number of the FFC that the command loads.
It doesn't directly change the script number. I read your question too fast.
Nimono
01-15-2007, 11:25 PM
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:
Fire Wizzrobe
01-16-2007, 06:59 PM
3rd attempt. It's untested.
// 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;
}
}
Nimono
01-16-2007, 07:01 PM
3rd attempt. It's untested.
// 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....
Fire Wizzrobe
01-16-2007, 07:07 PM
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.
Nimono
01-16-2007, 07:12 PM
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?
Fire Wizzrobe
01-16-2007, 07:25 PM
Oh, I meant directly asigned it to the third FFC in a seperate script.
What are the errors?
Nimono
01-16-2007, 07:31 PM
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
Fire Wizzrobe
01-16-2007, 09:13 PM
Oops, what a careless mistake.
// 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;
}
}
Nimono
01-16-2007, 09:19 PM
Oops, what a careless mistake.
// 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? :)
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.