Centi-Second Wait Count

Discussion in 'RGSS Scripts (RMXP)' started by DerVVulfman, Sep 13, 2019.

  1. DerVVulfman

    DerVVulfman Resident Werewolf Veteran

    Messages:
    304
    Likes Received:
    149
    First Language:
    English
    Primarily Uses:
    RMXP
    Centi-Second Wait Count
    Version: 1.2



    Definition
    Centi-Second: Noun. (plural centiseconds)
    1) A unit of time equal to 0.01 seconds and with symbol cs.
    2) Time of 91 926 317.7 periods of the radiation corresponding to the transition between the 2 hyperfine levels of the ground state of the caesium 133 atom at 0 K .



    Introduction
    This script grants one the ability to use an alternate system to the default wait system. Unlike the default wait system, this one uses the actual system clock to measure time in centi-seconds, or down to a hundredth of a second. And since it does not rely on the graphics framecount system which can be slowed down, it is more accurate.

    The only drawback is that major rewrites had to be performed within three classes to add this feature; the actual timing system needing to be placed within loop-end blocks of code.



    Features
    • Field Map Script Call for new wait counter down to 1/100th of a second.
    • Script Call in Custo Move Routes allows for new wait counter down to 1/100th of a second.
    • Troop Database Script Call for new wait counter down to 1/100th of a second.
    • Special timer system based on duration from event start for field maps.



    Screenshots
    Are you kidding? This is a timer system.



    Demo
    CLICK ME
    * It's pretty simplistic
    * If studying, look for dashed lines within the code to show the direct edits to the update and move_type_custom methods.



    Instructions
    Generally, paste after Scene_Debug and before main in your script database. Due to heavy rewrites in three principle methods, it is recommended to be the first script within your list of custom scripts below Scene_Debug.

    It does not replace the [Wait] button in the list of event commands. You use a script call of: set_cs_wait(value) where value is the number of centi-seconds for a delay.



    Recommendation
    Would be excellent for use with cutscenes. Recommend using with the Prevent Window Deactivation (aka MessageIntercept) system by KK20.



    Compatibility
    * NOT based on the RPGMaker RMXP SDK system.
    Designed for RPGMaker XP, though the premise and edits shown should be valid for other Enterbrain engines using Ruby. It overwrites update methods in the Interpreter, Game_Character and Scene_Battle code, so it should be the first script in your list of custom scripts. That is, unless you perform direct edits yourself.



    Author's Notes
    Considered Intermediate to Skilled/Advanced due to method rewrites.



    Terms of Use
    Well, as all of my scripts, due credit as the sole creator is all I need. And it's free for use, even in commercial works.
     
    Last edited: Oct 7, 2019
    #1
    callmedan and The Stranger like this.
  2. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,804
    Likes Received:
    7,618
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    @DerVVulfman Can you please add credits and terms of use to your original post? Thanks.
     
    #2
  3. DerVVulfman

    DerVVulfman Resident Werewolf Veteran

    Messages:
    304
    Likes Received:
    149
    First Language:
    English
    Primarily Uses:
    RMXP
    Doh! Forgot. Well, added now.
     
    #3
  4. DerVVulfman

    DerVVulfman Resident Werewolf Veteran

    Messages:
    304
    Likes Received:
    149
    First Language:
    English
    Primarily Uses:
    RMXP
    [size=xx-7]BUMP
    to version 1.1[/size]​

    With the addition of two small methods and an instance variable, it can now work to track when event commands need to pause in a new manner.

    For those not familiar with how to use the script in map events....

    Code:
    @>Script: set_cs_wait(1000)
    @>Play SE: "014-Move02", 80, 100
    @>Script: set_cs_wait(250)
    @>Play SE: "014-Move02", 80, 100
    This is a normal one using the set_cs_wait command in place of the default wait command.


    And now... the NEW feature:
    Code:
    @>Script: set_cs_start
    @>Play BGM: "018-Field01", 80, 100
    @>Show Picture 1, "Splash-1", Upper Left (0,0), (100%,100%), 0, Normal
    @>Script: cs_wait_full(200)
    @>Move Picture 1, @20, Upper Left (0,0), (100%,100%),255, Normal
    @>Script: cs_wait_full(950)
    @>Move Picture 1, @20, Upper Left (0,0), (100%,100%),0, Normal
    @>Script: cs_wait_full(1300)
    @>Show Picture 1, "Splash-2", Upper Left (0,0), (100%,100%), 0, Normal
    @>Move Picture 1, @20, Upper Left (0,0), (100%,100%),255, Normal
    @>Script: cs_wait_full(2000)
    Okay, I was having fun making splash screens after starting the music. Note that this one uses the set_cs_start command before anything happens, and the cs_wait_full statements all have increasing values attached, each measuring when the events run based on 1/100th of a second. IE: cs_wait_full(1300) makes the event wait until 13 seconds have passed since the set_cs_start command had run.
     
    #4
  5. DerVVulfman

    DerVVulfman Resident Werewolf Veteran

    Messages:
    304
    Likes Received:
    149
    First Language:
    English
    Primarily Uses:
    RMXP
    BUMP
    to version 1.2

    Overlooked until now was an issue where one leaves the field map and enters either a menu or deals with a saved game. For the normal Wait system, it merely dealt with a recorded framecount. With the Centi-Second system, timing works differently as it relies on your PC's own clock.

    Now while this doesn't matter much if using the wait option as you would the normal wait count, but this can mess up the wait system in a 'custom move route' option. If such an event is currently waiting for a long time and exits to a menu and then returns back to the map, the delay may be over immediately. That is, until this new version which fixes this issue with the application of an adaptive timestamp option.
     
    #5

Share This Page