User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22

Thread: Magnetic Gloves

  1. #1
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,161
    Level
    18
    vBActivity - Bars
    Lv. Percent
    15.13%

    Magnetic Gloves

    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!

  2. #2
    Octorok
    Join Date
    Jan 2008
    Age
    32
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    958
    Level
    10
    vBActivity - Bars
    Lv. Percent
    73.27%

    Re: Magnetic Gloves

    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;
    What is mask useful for?

    btw, awesome script, it must have took a long time to think about it, and making it work.

  3. #3
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,161
    Level
    18
    vBActivity - Bars
    Lv. Percent
    15.13%

    Re: Magnetic Gloves

    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!

  4. #4
    Wizrobe The_Amaster's Avatar
    Join Date
    Dec 2005
    Location
    St. Mystere
    Age
    33
    Posts
    3,803
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,829
    Level
    28
    vBActivity - Bars
    Lv. Percent
    28.61%

    Re: Magnetic Gloves

    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
     }

  5. #5
    Gibdo Shoelace's Avatar
    Join Date
    Feb 2005
    Age
    39
    Posts
    777
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,652
    Level
    16
    vBActivity - Bars
    Lv. Percent
    80.97%

    Re: Magnetic Gloves

    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.

  6. #6
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,161
    Level
    18
    vBActivity - Bars
    Lv. Percent
    15.13%

    Re: Magnetic Gloves

    Quote Originally Posted by Amaster42 View Post
    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 correct.

    Quote Originally Posted by Shoelace View Post
    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.
    I'm nearly done that, and the rotating version of the pole you see in Oracle of Seasons. I'm just ironing out a few collision detection issues.
    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!

  7. #7
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,161
    Level
    18
    vBActivity - Bars
    Lv. Percent
    15.13%

    Re: Magnetic Gloves

    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!

  8. #8
    Gibdo Shoelace's Avatar
    Join Date
    Feb 2005
    Age
    39
    Posts
    777
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,652
    Level
    16
    vBActivity - Bars
    Lv. Percent
    80.97%

    Re: Magnetic Gloves

    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. :)

  9. #9
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,322
    Level
    26
    vBActivity - Bars
    Lv. Percent
    11.54%

    Re: Magnetic Gloves

    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.

  10. #10
    Gibdo Shoelace's Avatar
    Join Date
    Feb 2005
    Age
    39
    Posts
    777
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,652
    Level
    16
    vBActivity - Bars
    Lv. Percent
    80.97%

    Re: Magnetic Gloves

    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. :)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social