Permanent pseudo-solidity?
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?
Re: Permanent pseudo-solidity?
...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.
Re: Permanent pseudo-solidity?
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:
Code:
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?
Re: Permanent pseudo-solidity?
My guess;
Screen->ComboS [] (combonumber or numbers) = 15;
Re: Permanent pseudo-solidity?
Quote:
Originally Posted by
Fire Wizzrobe
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.
Re: Permanent pseudo-solidity?
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.
Re: Permanent pseudo-solidity?
Quote:
Originally Posted by
Fire Wizzrobe
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.
Re: Permanent pseudo-solidity?
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:
Code:
#include std.zh //Place at top
(The Block)->ComboAt = ffcpos
Screen->ComboS [ffcpos] = 15;
Re: Permanent pseudo-solidity?
Quote:
Originally Posted by
Fire Wizzrobe
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:
Code:
#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:
Code:
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.
Re: Permanent pseudo-solidity?
I'm sorry. I've only been doing C++ for 2 1/2 months and I suck.
Code:
//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;