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
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
Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
ZeldaGuard - Corruption in my save files? It's more likely than you think!
I do script requests!
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.
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. :)
Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
ZeldaGuard - Corruption in my save files? It's more likely than you think!
I do script requests!
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 }
Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
ZeldaGuard - Corruption in my save files? It's more likely than you think!
I do script requests!
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)
Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
ZeldaGuard - Corruption in my save files? It's more likely than you think!
I do script requests!
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)