User Tag List

Results 1 to 8 of 8

Thread: Some questions about Global ZScript scripts....

  1. #1
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,276
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.96%

    Some questions about Global ZScript scripts....

    Okay, here's my questions....

    1: When I make a Global Script, does it ALWAYS run the moment the game starts?
    2: Are there any commands and stuff that are global-script-exclusive?
    3: Is there a way to make a Global Script run and stop whenever you want it?

    Yeeeah... Stungun, at PureZC, mentioned a way to make a Metroid-style escape timer. Only problem is..... I need it to begin at a certain point and end at another certain point. If they Global Scripts only run when you start a quest.... That will really ruin the quest. Thanks for the help. :)

  2. #2
    Keese
    ZC Developer

    Join Date
    Jan 2007
    Age
    34
    Posts
    52
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    781
    Level
    9
    vBActivity - Bars
    Lv. Percent
    80.81%

    Re: Some questions about Global ZScript scripts....

    Take a look at my darkform script. It has the global script running constantly in the background, but it doesn't do anything until it is activated by a function call from the item script. So in this case, you'd probably want something like:
    Code:
    global script foo() {
    
      int time = 0;
      bool time_on = false;
    
      void run() {
        While(true) {
          if(time_on) {
            time += 1;
            if(time >= 500) {
              // Do Something
            }
          }
          Waitframe();
        }
      }
    
      void StartTimer() {
        time_on = true;
      }
    }
    You'd just have something say foo.StartTimer(); when you want the timer to begin.

  3. #3
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,276
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.96%

    Re: Some questions about Global ZScript scripts....

    .....That doesn't exactly help me much. Thanks anyways, though....

  4. #4
    Keese
    ZC Developer

    Join Date
    Jan 2007
    Age
    34
    Posts
    52
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    781
    Level
    9
    vBActivity - Bars
    Lv. Percent
    80.81%

    Re: Some questions about Global ZScript scripts....

    Quote Originally Posted by pikaguy900 View Post
    3: Is there a way to make a Global Script run and stop whenever you want it?

    Yeeeah... Stungun, at PureZC, mentioned a way to make a Metroid-style escape timer. Only problem is..... I need it to begin at a certain point and end at another certain point. If they Global Scripts only run when you start a quest.... That will really ruin the quest. Thanks for the help. :)
    Here, this is what I meant. Using the below code:

    Use the script foo as one of your global scripts.

    Make an ffc in the room which you want the timer to start in. Give it the ffc script start_timer, with the following argument values:
    D0: How long before the timer runs out.
    D1: Which DMap Link will warp to when the timer runs out.
    D2: Which Screen Link will warp to when the timer runs out.

    Make an ffc in the room which you want the timer to stop in. Give it the ffc script stop_timer.

    Code:
    global script foo { int time = 0; int max_time = 0; int warp_dmap = 0; int warp_screen = 0; bool time_on = false; void run() { While(true) { if(time_on) { time += 1; if(time >= max_time) { Link->Warp(warp_dmap, warp_screen); StopTimer(); } } Waitframe(); } } void StartTimer(int time, int dmap, int screen) { time_on = true; time = 0; max_time = time; warp_dmap = dmap; warp_screen = screen; } void StopTimer() { time_on = false; } } ffc script start_timer { void run(int time, int dmap, int screen) { foo.StartTimer(time, dmap, screen); } } ffc script stop_timer { void run() { foo.StopTimer(); } }


    This should work, but I haven't tested it. So basically, upon entering the room with the first ffc, you have x amount of time to reach the room with the second ffc, or Link will warp to the specified room.



    Hopefully, this is what you're looking for.

  5. #5
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,276
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.96%

    Re: Some questions about Global ZScript scripts....

    No, I just want to know how to make a script start when a certain script starts it (and at no other time), what commands are used to start it, and how to stop it. That's ALL. I can get the timer itself done myself. :)

  6. #6
    Keese
    ZC Developer

    Join Date
    Jan 2007
    Age
    34
    Posts
    52
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    781
    Level
    9
    vBActivity - Bars
    Lv. Percent
    80.81%

    Re: Some questions about Global ZScript scripts....

    Quote Originally Posted by pikaguy900 View Post
    That's ALL. I can get the timer itself done myself. :)

    Certainly. I just thought that the timer would make a good example on how to start and stop a script.

  7. #7
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,276
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.96%

    Re: Some questions about Global ZScript scripts....

    Quote Originally Posted by Grayswandir View Post
    Certainly. I just thought that the timer would make a good example on how to start and stop a script.
    Uhh.... That meant "Please tell me how to do that". XD

  8. #8
    Lynel Revfan9's Avatar
    Join Date
    Jun 2005
    Location
    In front of a screen. I never leave.
    Age
    31
    Posts
    1,160
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,390
    Level
    18
    vBActivity - Bars
    Lv. Percent
    71.1%

    Re: Some questions about Global ZScript scripts....

    Use the variable gd255. When it is 1, start the timer.

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