User Tag List

Page 2 of 4 FirstFirst 1 2 3 4 LastLast
Results 11 to 20 of 31

Thread: I wrote a script!!! but it ain't dun wurk good...

  1. #11
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.9%

    Re: I wrote a script!!! but it ain't dun wurk good...

    It's always 10x easier to understand a script you wrote than one someone else wrote, commented or no. You just gotta plunge into it.

  2. #12
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: I wrote a script!!! but it ain't dun wurk good...

    Yep you can use for loops in ZScript. For loop, While loop, Do Loop (i think never tried it). It seems you guys are picking up scripting pretty quickly.. (now you probley get why everyone always says its not that hard to understand )
    What're you crazy. It's very hard for me. Mainly the documentation. I really could use a dumbed down version. Example:


    Code:
    item script Wand_of_Wonder
    
    {
    void run()
      {
         if(Game->Counter[CR_RUPEES] == 0   // Or LinkRup == 0 ?
           Game->PlaySound(2);
           waitframe();
           Game->PlaySound(2);
           waitframe();
           Game->PlaySound(2);
           waitframe();
           Game->PlaySound(2);
           waitframe();
           Game->PlaySound(2);
           Game->Counter[CR_RUPEES] = 5; 
           waitframes(6);
           CreateNPC(105) } 
         
              else if(Game->Counter[CR_PUPEES] >= 1 {  
              waitframe();
              playsound(15);
              Game->Counter[CR_LIFE] = 0;  // Or LinkCurHP = 0 ?
           }
       }
    }
    I'm just stabbing in the dark with some of these...I'm not really sure the difference between something like Game->Counter[CR_LIFE] = 0, Or LinkCurHP =0 ? CR_LIFE is Current life...right.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  3. #13
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: I wrote a script!!! but it ain't dun wurk good...

    Aaaaargg!! I can't figure out the rupee references or manipulating door functions!! Help!



    Code:
    item script Door_Buster
    
    {
      void run()
      {
        if (Link->HP <= 96){
            Game->PlaySound(9);
            Quit();
               } else if (Link->MP <= 96) {
                 Game->PlaySound(9);
                 Quit();
               } else if (itemclass->Counter[CR_RUPEES]<= 66 {
                 Game->PlaySound(9);
            Quit();
         } else {
        Link->HP -= 96;
        Link->MP -= 96;
        itemclass->Counter[CR_RUPEES]-= 66;
        Screen->Door[D_UNLOCKED];
        Game->PlaySound(34);
        }
      }
    }
    Maybe for the doors...?
    ----------------------------------------------
    Screen->Door[DIR_UP] = D_UNLOCKED;
    Screen->Door[DIR_DOWN] = D_UNLOCKED;
    Screen->Door[DIR_LEFT] = D_UNLOCKED;
    Screen->Door[DIR_RIGHT] = D_UNLOCKED;
    ---------------------------------------------
    I don't get it
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  4. #14
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.9%

    Re: I wrote a script!!! but it ain't dun wurk good...

    If you want to manipulate the number of ruppees a player has, you need to manipulate the global counters. Not whether Link has a ruppee in his inventory. (He wont because they arn't equipment items.) Check the documentation for the COUNTER keeping track of ruppees.

  5. #15
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: I wrote a script!!! but it ain't dun wurk good...

    Alright, Door Buster Buster Buster. ver.3

    item script Door_Buster

    Code:
    {
      void run()
      {
        if (Link->HP <= 80){
            Game->PlaySound(9);
            Quit();
         } else {
              if (Screen->Door[DIR_UP] == D_LOCKED){
              Screen->Door[DIR_UP] = D_SHUTTER;
            } else {
                if (Screen->Door[DIR_DOWN] == D_LOCKED){ 
                Screen->Door[DIR_DOWN] = D_SHUTTER;
              } else { 
                  if (Screen->Door[DIR_LEFT] == D_LOCKED){ 
                  Screen->Door[DIR_LEFT] = D_SHUTTER;
                } else { 
                    if (Screen->Door[DIR_RIGHT] == D_LOCKED){ 
                    Screen->Door[DIR_RIGHT] = D_SHUTTER; 
                    }
                    Link->HP -= 80;
                    Game->PlaySound(27);
          }
       }
    }
    }
    }
     }
    Alright more problems...at least this one works!..sorta. LOL!!
    The version before this went like this:
    Code:
    {
      void run()
      {
        if (Link->HP <= 80){
            Game->PlaySound(9);
            Quit();
         } else {
        Link->HP = 16;
        Screen->Door[DIR_UP] = D_UNLOCKED;
        Screen->Door[DIR_DOWN] = D_UNLOCKED;
        Screen->Door[DIR_LEFT] = D_UNLOCKED;
        Screen->Door[DIR_RIGHT] = D_UNLOCKED;
        Game->PlaySound(27);
        }
      }
    }
    It creates an unlocked door on all sides even if there was a wall there before!!! Oopsie.


    So anyway their getting more complicated.. , and i'm trying to get it to create shutters on all doors, but only if it's a locked door. plus play sfx and take away hearts as well. Now it just does these things when it wants to. ...I know I fucked that part up, but i'm not sure how to get the && in there, or take the if's and else if's out........hmm....


    EDIT: Ahhh fluckin a...........Door Buster Buster Buster BUSTER!
    Code:
    import "std.zh"
    
    item script Door_Buster
    
    {
      void run()
      {
        if (Link->HP <= 80){
            Game->PlaySound(9);
            Quit();
         } else if (Screen->Door[DIR_UP] == D_LOCKED &&
            Screen->Door[DIR_DOWN] == D_LOCKED &&
            Screen->Door[DIR_LEFT] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED) {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else if (Screen->Door[DIR_UP] == D_LOCKED &&
            Screen->Door[DIR_DOWN] == D_LOCKED &&
            Screen->Door[DIR_LEFT] == D_LOCKED) {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else {
        if (Screen->Door[DIR_UP] == D_LOCKED) &&
            Screen->Door[DIR_DOWN] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else {
        if (Screen->Door[DIR_UP] == D_LOCKED) &&
            Screen->Door[DIR_LEFT] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else {
        if (Screen->Door[DIR_DOWN] == D_LOCKED) &&
            Screen->Door[DIR_LEFT] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED {
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else {
        if (Screen->Door[DIR_UP] == D_LOCKED) &&
            Screen->Door[DIR_DOWN] == D_LOCKED {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else {
        if (Screen->Door[DIR_UP] == D_LOCKED) &&
            Screen->Door[DIR_RIGHT] == D_LOCKED {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else {
        if (Screen->Door[DIR_UP] == D_LOCKED) &&
            Screen->Door[DIR_LEFT] == D_LOCKED {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else {
        if (Screen->Door[DIR_DOWN] == D_LOCKED) &&
            Screen->Door[DIR_LEFT] == D_LOCKED {
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else {
        if (Screen->Door[DIR_DOWN] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED {
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else {
        if (Screen->Door[DIR_LEFT] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED {
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else {
        if (Screen->Door[DIR_UP] == D_LOCKED) {
            Screen->Door[DIR_UP] = D_SHUTTER;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         } else if {
            Screen->Door[DIR_DOWN] == D_LOCKED {
            Screen->Door[DIR_DOWN] = D_SHUTTER;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            } 
         } else if {
            Screen->Door[DIR_LEFT] == D_LOCKED {
            Screen->Door[DIR_LEFT] = D_SHUTTER;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            } 
         } else if {
            Screen->Door[DIR_RIGHT] == D_LOCKED {
            Screen->Door[DIR_RIGHT] = D_SHUTTER;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            } 
         } else {
            Game->PlaySound(9);
            Quit();
        }
      }
    }
    It won't compile,( unexpected else on line 23) and I can't figure out why???
    ...Plus I think there's too many Braces in there....but I haven't even got there in the compiler....And now I am completely lost.


    ----------------------------------------------------------------------
    And now the Door Buster Buster MAX!

    Code:
    item script Door_Buster
    
    {
      void run()
      {
        if (Link->HP <= 80){
            Game->PlaySound(9);
            Quit();
         } 
        if (Screen->Door[DIR_UP] == D_LOCKED &&
            Screen->Door[DIR_DOWN] == D_LOCKED &&
            Screen->Door[DIR_LEFT] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED) {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
           } 
        if (Screen->Door[DIR_UP] == D_LOCKED &&  //55
            Screen->Door[DIR_DOWN] == D_LOCKED &&
            Screen->Door[DIR_LEFT] == D_LOCKED) {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
         if (Screen->Door[DIR_UP] == D_LOCKED &&
            Screen->Door[DIR_DOWN] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED) {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
        if (Screen->Door[DIR_UP] == D_LOCKED &&
            Screen->Door[DIR_LEFT] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED) {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
        if (Screen->Door[DIR_DOWN] == D_LOCKED &&
            Screen->Door[DIR_LEFT] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED) {
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
        if (Screen->Door[DIR_UP] == D_LOCKED &&
            Screen->Door[DIR_DOWN] == D_LOCKED) {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
        if (Screen->Door[DIR_UP] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED) {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
        if (Screen->Door[DIR_UP] == D_LOCKED &&
            Screen->Door[DIR_LEFT] == D_LOCKED) {
              Screen->Door[DIR_UP] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
        if (Screen->Door[DIR_DOWN] == D_LOCKED &&
            Screen->Door[DIR_LEFT] == D_LOCKED) {
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
        if (Screen->Door[DIR_DOWN] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED) {
              Screen->Door[DIR_DOWN] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
        if (Screen->Door[DIR_LEFT] == D_LOCKED &&
            Screen->Door[DIR_RIGHT] == D_LOCKED) {
              Screen->Door[DIR_LEFT] = D_SHUTTER ;
              Screen->Door[DIR_RIGHT] = D_SHUTTER ;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
        if (Screen->Door[DIR_UP] == D_LOCKED) {
            Screen->Door[DIR_UP] = D_SHUTTER;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            }
        if (Screen->Door[DIR_DOWN] == D_LOCKED) {
            Screen->Door[DIR_DOWN] = D_SHUTTER;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            } 
        if (Screen->Door[DIR_LEFT] == D_LOCKED) {
            Screen->Door[DIR_LEFT] = D_SHUTTER;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            } 
        if (Screen->Door[DIR_RIGHT] == D_LOCKED) {
            Screen->Door[DIR_RIGHT] = D_SHUTTER;
              Game->PlaySound(27);
              Link->HP -= 80 ;
              Quit();
            } 
        else Game->PlaySound(9);
            Quit();
        }
    }
    Still, what I wan't to do is make it so non locked doors become locked also....and shutters become Walls!! ..sweet.
    -Can anyone show me an easier way to do that so it doesn't take 2 years to write up?
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  6. #16
    Octorok
    Join Date
    May 2007
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,506
    Level
    13
    vBActivity - Bars
    Lv. Percent
    11.25%

    Re: I wrote a script!!! but it ain't dun wurk good...

    How about this for 'Door buster Max'

    Code:
    item script Door_Buster
    
    {
      void run()
      {
    //Declare vars
    //setup bool vars one to check if each door has been effected yet
    //this creates a switch of sorts that only lets you effect each door directon once
    bool dr_up = false;
    bool dr_dn = false;
    bool dr_lt = false;
    bool dr_rt = false;
    bool any_door = false;
    // any_door checks if any door is changed, so you can latter decide if you want to play sound 27 and subtract 80 HP from Link
        if (Link->HP <= 80){
            Game->PlaySound(9);
            Quit();
         } 
    
    //Unlocked become locked
    //locked become shutter
    //shutter become wall
    if (Screen->Door[DIR_UP] == D_UNLOCKED && dr_up == false) {
    Screen->Door[DIR_UP] = D_LOCKED;
    dr_up = true;
    any_door = true;
    }
    if (Screen->Door[DIR_UP] == D_LOCKED && dr_up == false) {
    Screen->Door[DIR_UP] = D_SHUTTER;
    dr_up = true;
    any_door = true;
    }
    if (Screen->Door[DIR_UP] == D_SHUTTER && dr_up == false) {
    Screen->Door[DIR_UP] = D_WALL;
    dr_up = true;
    any_door = true;
    }
    
    if (Screen->Door[DIR_DOWN] == D_UNLOCKED && dr_up == false) {
    Screen->Door[DIR_DOWN] = D_LOCKED;
    dr_dn = true;
    any_door = true;
    }
    if (Screen->Door[DIR_DOWN] == D_LOCKED && dr_up == false) {
    Screen->Door[DIR_DOWN] = D_SHUTTER;
    dr_dn = true;
    any_door = true;
    }
    if (Screen->Door[DIR_DOWN] == D_SHUTTER && dr_up == false) {
    Screen->Door[DIR_DOWN] = D_WALL;
    dr_dn = true;
    any_door = true;
    }
    if (Screen->Door[DIR_LEFT] == D_UNLOCKED && dr_up == false) {
    Screen->Door[DIR_LEFT] = D_LOCKED;
    dr_lt = true;
    any_door = true;
    }
    if (Screen->Door[DIR_LEFT] == D_LOCKED && dr_up == false) {
    Screen->Door[DIR_LEFT] = D_SHUTTER;
    dr_lt = true;
    any_door = true;
    }
    if (Screen->Door[DIR_LEFT] == D_SHUTTER && dr_up == false) {
    Screen->Door[DIR_LEFT] = D_WALL;
    dr_lt = true;
    any_door = true;
    }
    
    if (Screen->Door[DIR_RIGHT] == D_UNLOCKED && dr_up == false) {
    Screen->Door[DIR_RIGHT] = D_LOCKED;
    dr_rt = true;
    any_door = true;
    }
    if (Screen->Door[DIR_RIGHT] == D_LOCKED && dr_up == false) {
    Screen->Door[DIR_RIGHT] = D_SHUTTER;
    dr_rt = true;
    any_door = true;
    }
    if (Screen->Door[DIR_RIGHT] == D_SHUTTER && dr_up == false) {
    Screen->Door[DIR_RIGHT] = D_WALL;
    dr_rt = true;
    any_door = true;
    }
    
    if (any_door == true) {
    Game->PlaySound(27);
    Link->HP -= 80 ;
    }
    else
    {
    Game->PlaySound(9);
    }
    Let me know if you don't understand anything

  7. #17
    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,142
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.56%

    Re: I wrote a script!!! but it ain't dun wurk good...

    <_< This is where we teach about loops:

    Code:
    item script Door_Buster_Omega {
    	void run() {
    		int i; //we'll use this to loop
    		bool any; //if we actually do anything, this will become true
    		
    		//for loops are used to loop over a range of numbers, like 1, 2, 3.
    		//DIR_UP and the like are just numbers, so we can loop over them too.
    		//DIR_UP, DIR_DOWN, DIR_LEFT, DIR_RIGHT
    		
    		//for loops have three sections:
    		// for( start ; condition ; loop) { ... }
    		// 'start' is what to do first. We start by setting i to DIR_UP
    		// as long as 'condition' is true, the loop will continue. DIR_RIGHT is the last value, so we want to loop as long as i <= DIR_RIGHT
    		// each time the block gets to the bottom, it will run 'loop'.
    		// in this case, we add one to i
    		for(i = DIR_UP; i <= DIR_RIGHT; i ++) {
    
    			//is this door locked? (note that we don't care what specific direction it is)
    			if(Screen->Door[i] == D_LOCKED) {
    				//unlock it
    				Screen->Door[i] = D_SHUTTER;
    				any = true;
    
    			//is the door already unlocked?
    			} else if(Screen->Door[i] == D_UNLOCKED) {
    				//lock it back up :D
    				Screen->Door[i] = D_LOCKED;
    				any = true;
    
    			//or, is it a shutter?
    			} else if(Screen->Door[i] == D_SHUTTER) {
    				//Wall 'em in.
    				Screen->Door[i] = D_WALL;
    				any = true;
    			}
    			
    			// 'loop' will be run here, to move to the next wall
    		}
    		
    		//now that we are finished the loop, we can check to see if we did anything.
    		if(any) {
    			//do stuff if we succeeded
    			Game->PlaySound(27); //there are also SFX_* constants
    			Link->HP -= 80; //5 hearts? ouch.
    		} else {
    			//do other stuff if we did nothing.
    			Game->PlaySound(9);
    		}
    	}
    }
    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. #18
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: I wrote a script!!! but it ain't dun wurk good...

    Wow! You guys are awesome. It's gonna take me awhile to go through those but in the meantime a couple of questions:

    -Howabout some script showcase/tutorials? What I mean is kind of like here, where you have a really simple script and variations on it, where each one can be broken down a bit and explained "why it works". While not really a tutorial exactally, it would certainly help out alot of the script-challenged masses that are smashing their faces against the keyboard. (myself included)
    ....... :confuse2: ........... :angry: .......... :mad2: ...........

    -Also I can't figure out how to check rupees. I got as far as amount and max, and the documentation say's it uses the drain counter....which is too much for me at my scripting level of......noob. So something reletively simple like (-1 rupee , or -3 rupee if rupee > 0) on item use is over my head. -DCounter[]??
    ..and Item lv. I'm not sure about this either
    bool Keep
    * If true, Link will keep the item, and it will show up as an item or
    * equipment in the subscreen. If false, it may modify the current value
    * or maximum value of its counter (see Counter below), then disappear.
    * The White Sword and Raft, for instance, have Keep true, and keys and
    * rupees have Keep false.

    int Counter
    * The game counter whose current and modified values might be modified
    * when the item is picked up (see Amount, Max, and MaxIncrement above.)
    * Use the CT_ constants in std.zh to set or compare this value.
    Can there be a temporary lv+ ? Like wand lv1: -1 rupee +1 lv of wand.

    +20,000 more questions but bool and loop will keep me busy for a while..hah!

    EDIT: well I can't figure out anything that I actually need for scripts that I would like for my quest so.....HERE'S SOMETHING COMPLETELY RANDOM!
    Code:
    item script Cursed_Sword
    
    {
      void run()
      {
        if (Screen-NumNPCs() == 0) {    // create a wizzrobe if there are no enemies
        screen->CreateNPC(56);          // Or screen->CreateNPC(NPC_WIZZROBE1)????? 
                                            //i should test it.
        } else {                 //otherwise...
        npc enemy = Screen->LoadNPC(1); // locate npc 1 (i'm getting it!)
        enemy->HP += 1;                // and make him stronger! (don't miss!)
      }
    }
    EDIT 2: i now give you the *MOST BESTEST SCRIPT EVER!!*
    Code:
    Global script No_Cheating!!!
    
    {
      void run() {
                 int cheat;
                 if (cheat > 0) {
                       //[INSERT SCRIPT THAT CRASHES ZC HERE!!!]
              // ..Lets see Someone make a cheat Program for ZC 2.5 now...Bastards!
                        Link->HP -=666;
                        Link->MaxHP -= 666;
                        }
                 }
    }
    Mwahahahhaahaha!!!!!!
    .....seriously though, anyone know a quick way to crash zc on purpose.?:sb::giggle::p
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  9. #19
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.9%

    Re: I wrote a script!!! but it ain't dun wurk good...

    Well, let's clean this up.

    Code:
    item script Cursed_Sword
    
    {
      void run()
      {
    
       
    
        if (Screen-NumNPCs() == 0) {    // Checks to see that there are no enemies.
                                                   // Remember, the script only runs once
                                                   // at the start of the room.  So this
                                                   // script will add wizzrobes only to empty
                                                   // rooms.  If you want to keep checking,
                                                   // you need to stick this if inside a while
                                                   // loop.
        Screen->CreateNPC(56);          // Screen must be capitalized.  Number is 
                                                   // proper.
        } else {                                //otherwise...
        npc enemy = Screen->LoadNPC(1); // locate npc 1 (i'm getting it!)
        enemy->HP += 1;                         // and make him stronger! 
                                                        // One more hp isn't much. Wooden
                                                        // Sword has power of 2.
      }
    }

  10. #20
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: I wrote a script!!! but it ain't dun wurk good...

    Thaks again C-. It won't compile one of those two lines and now I know why. (Grr...a stupid lowercase s) F**** H***K** Donkey.....
    But doesn't the item check for screen NPC == 0 every time it's used???


    ******************BUT CHECK THIS OUT!**************

    Code:
    Item script Consume_Rupees_Damnit
    
    {
      void run() {
                 if (Game->Counter[CR_RUPEES] >= 1 &&
                 Link->HP < Link->MaxHP)
                   {
                   Link->HP += 2;
                   Game->Counter[CR_RUPEES] -= 1;
                   }
            }
    }
    That's at least three completed scripts i've created thus far that work how I want them to!!!!!! MFn Superfantastic!

    -Also I WAS right for using *Game->Counter[CR_RUPEES]* to acess rupee counter. The problem was I kept fucking everything else up. Ha! ..well it's getting there. lol.

    What I really DO need help on is temporary increase in damage(or lv[or whatever]) for the second half of my Item scripts to work properly.

    } else if {
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

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