Magnetic Gloves -- Now with iron balls and rotating poles! (not as dirty as it sounds!)
Everything you need to know is on the above page. Enjoy ;)
Printable View
Magnetic Gloves -- Now with iron balls and rotating poles! (not as dirty as it sounds!)
Everything you need to know is on the above page. Enjoy ;)
What is mask useful for?Code:if(x<0 || x>255 || y<0 || y>175) return false;
int mask=1111b;
if(x % 16 < 8)
mask &= 0011b;
else
mask &= 1100b;
if(y % 16 < 8)
mask &= 0101b;
else
mask &= 1010b;
btw, awesome script, it must have took a long time to think about it, and making it work. :D
Well, it's used in the first half of a script that checks passability at a given point.
Screen->ComboS[] stores the passability of every combo on the screen as a bitset. That is, a fully impassable tile is 1111b, and a fully walkable one is 0000b. One that's half walkable is 1010b, 0101b or some other value that's half-on, half-off. Check zscript.txt for details.
If you work out the math, you'll see that each if block is checking "top-half, or bottom?" and "left or right?", and &ing the appropriate masks together, so that at the end, only one bit is left one, the one we want to check.
This particular function was not actually written by me, as I am not that clever. You have Saffith and beefster09 to thank for it.
The rest of it, of course, is all mine. :)
I'm having trouble figuring out what goes where in your global template. If I've got it right, is it as follows?
Code:import "std.zh"
//global variables go here
bool magna_gloves_active = false;
bool magna_gloves_positive = false;
const int magna_flag = 99;
const int magna_positive = 144;
global script onstart {
void run() {
//one time things go here
while(true) {
//function calls go here
if(magna_gloves_active) MagnaGlovesWork();
Waitframe();
}
}
//functions go here
Big long magna glove script here
}
That is awesome! I have been asking for a very long time as I want to put it in EotM. But the only thing is the puzzle ideas I had for it was to be able to move the 'Magnetic' things in the room. So hopefully that will be scripted too, as I would use that one for sure.
Ding! The script has been updated with roughly 12000 kilojoules of pure awesome!
Iron Balls - for killing monsters, with sexy results!
Rotating poles - more complex movement puzzles, with sexy results!
Soon, buttons which react to the balls, with sexy results!
(although, the buttons will be in a separate thread, since they're used for more than just magnetic glove puzzles)
Awesome, Thank you so much! I have one question though. I am sort of new at the scripting but, say I am was planning on using both the bombchu and the Magnetic Gloves in my game. Well I was reading about global scripts, and I saw that the bombchu uses #2 and #3 slots for it to work. And the Magnetic Gloves, I didn't see a number on it. Would I be able to put both of them in my game?
Either way, I can't wait to see how the buttons will react to the Iron Balls script thing. As that is basically what I want to use the Magnetic Gloves for. That is where all of my puzzle ideas come into play. :)
You have to compile both of the scripts into the same global script.
Someone'll do it for you if you ask nicely I'm sure.
Ah okay, thanks Joe123, I will probably ask someone then. But I won't right now as the script may change because he is still adding the button with the Iron Ball script. So I wait until after that. I am glad it will work though. :)