User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Script Execution Order

  1. #1
    ZC Contirbutor ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,016
    Mentioned
    95 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    3,548
    Level
    19
    vBActivity - Bars
    Lv. Percent
    9.04%
    Daily Activity
    0%
    Weekly Activity
    39.52%
    Monthly Activity
    46.71%

    Script Execution Order

    @DarkDragon

    This is what I have on record. I believe it is is all correct, but I would not mind outside verification, and amendments if needed.


    //================================================== =====
    //--- Instruction Processing Order and General Timing ---
    ================================================== =======


    1. Instructions in Global script Init (if starting a new game)
    2. Instructions in Global Script OnContinue (is resuming a game)
    3. Instructions from FFCs that run on screen init, excluding draw instructions.
    Note: Instructions are handled on a per-ffc basis, in ID order; so a script on ffc ID 1 runs,
    then a script on ffc ID 2, up to ffc ID 32. If an ffc has no script, it is skipped.
    4. Instructions immediately inside the run() function of a global active script, if the game has just loaded.
    5. Instructions in the global active script's infinite loop prior to Waitdraw,
    6. Instructions from an ffc script positioned after (an illegal)
    Waitdraw() instruction in that script from the previous frame.
    Note: Requires being on at least the second frame of a game session.
    7. Screen bitmap drawing.
    8. Enqueued Script Drawing from the global active script, (and from ffcs on the previous frame).
    9.. Drawing Instructions in the global active script prior to Waitdraw().
    10. Instructions in an ffc script, excluding draw commands.
    Note: Instructions are handled on a per-ffc basis, in ID order; so a script on ffc ID 1 runs,
    then a script on ffc ID 2, up to ffc ID 32. If an ffc has no script, it is skipped.
    11. Screen Scrolling (2.50.2, or later)
    12. Waitdraw() in a global active script.
    13. Engine writing to Link->Dir and Link->Tile.
    14. FFCs enqueue draws for the next frame.
    Note: Instructions are handled on a per-ffc basis, in ID order; so a script on ffc ID 1 runs,
    then a script on ffc ID 2, up to ffc ID 32. If an ffc has no script, it is skipped.
    15. Instructions from item action scripts.
    16. Instructions from item collect scripts.
    17. Instructions in the global active script, called after Waitdraw()
    17(b). Screen Scrolling ( 2.50.0, and 2.50.1 )]
    18. Instructions in an OnExit script, if the game is exiting.
    19. Return to (3).
    Last edited by ZoriaRPG; 06-19-2017 at 10:21 PM.


    Featured Scripts & Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | Zelda 3 Thief's Town Treasure Chest Minigame (ffc) | Bobomb (enemy)
    ZScript & ZC-Related Pastebin | Quests and ZScript Repository | ZC Dev & Betas | Latest ZC 2.54 Beta | YouTube Channel
    All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0, or v3.0 where applicable..

  2. #2
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    34
    Posts
    3,352
    Mentioned
    164 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,022
    Level
    24
    vBActivity - Bars
    Lv. Percent
    1.49%
    Daily Activity
    0%
    Weekly Activity
    1.21%
    Monthly Activity
    16.21%
    FFCs run before the global script, even in the first frame. If the "Run Script at Screen Init" flag is checked on an FFC on the starting screen, it will actually update twice before the active global script starts.
    Also, on the off chance they both run in the same frame, item action scripts run before item pickup scripts.
    [téknolŕiz]

    ffcscript.zh 1.1.1 - Updated 2014-08-19
    ghost.zh 2.8.2 - Updated 2017-09-10
    tango.zh 1.3.0 - Updated 2017-09-10

  3. #3
    Keese
    Join Date
    May 2015
    Posts
    66
    Mentioned
    30 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    311
    Level
    6
    vBActivity - Bars
    Lv. Percent
    46.54%
    Daily Activity
    0%
    Weekly Activity
    1.21%
    Monthly Activity
    1.64%
    Also, NES Dungeon Type will always halt the global script, from experience.

  4. #4
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,231
    Mentioned
    68 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    10,777
    Level
    30
    vBActivity - Bars
    Lv. Percent
    78.2%
    Daily Activity
    0%
    Weekly Activity
    3.23%
    Monthly Activity
    17.12%
    Quote Originally Posted by Dimentio View Post
    Also, NES Dungeon Type will always halt the global script, from experience.
    Wait what?

  5. #5
    ZC Contirbutor ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,016
    Mentioned
    95 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    3,548
    Level
    19
    vBActivity - Bars
    Lv. Percent
    9.04%
    Daily Activity
    0%
    Weekly Activity
    39.52%
    Monthly Activity
    46.71%
    Quote Originally Posted by Saffith View Post
    FFCs run before the global script, even in the first frame. If the "Run Script at Screen Init" flag is checked on an FFC on the starting screen, it will actually update twice before the active global script starts.
    Also, on the off chance they both run in the same frame, item action scripts run before item pickup scripts.
    Oh, really? They run before global active, even without run at screen init enabled?

    Quote Originally Posted by Dimentio View Post
    Also, NES Dungeon Type will always halt the global script, from experience.
    Howzat precisely?! What are they NES Dungeon types stopping your global active scripts from doing?


    Featured Scripts & Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | Zelda 3 Thief's Town Treasure Chest Minigame (ffc) | Bobomb (enemy)
    ZScript & ZC-Related Pastebin | Quests and ZScript Repository | ZC Dev & Betas | Latest ZC 2.54 Beta | YouTube Channel
    All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0, or v3.0 where applicable..

  6. #6
    Nine-Tailed Goddess Tamamo's Avatar
    Join Date
    May 2011
    Location
    Kobe
    Age
    28
    Posts
    819
    Mentioned
    93 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,087
    Level
    22
    vBActivity - Bars
    Lv. Percent
    32.14%
    Daily Activity
    0%
    Weekly Activity
    1.21%
    Monthly Activity
    1.64%
    @ZoriaRPG Yes, Screeninit is a single occurance. It causes it to run when the before the screen starts scrolling rather then after scrolling.

    The first update is handled during that check
    the other is always after scrolling.
    Last edited by Tamamo; 06-19-2017 at 10:17 PM.

  7. #7
    ZC Contirbutor ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,016
    Mentioned
    95 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    3,548
    Level
    19
    vBActivity - Bars
    Lv. Percent
    9.04%
    Daily Activity
    0%
    Weekly Activity
    39.52%
    Monthly Activity
    46.71%
    Quote Originally Posted by Tamamo View Post
    @ZoriaRPG Yes, Screeninit is a single occurance. It causes it to run when the before the screen starts scrolling rather then after scrolling.
    I understand that. I just didn't realise that ffcs always ran before global active. I will update the execution ordering above.
    @Saffith , does that revised list appear to be correct?
    Last edited by ZoriaRPG; 06-19-2017 at 10:21 PM.


    Featured Scripts & Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | Zelda 3 Thief's Town Treasure Chest Minigame (ffc) | Bobomb (enemy)
    ZScript & ZC-Related Pastebin | Quests and ZScript Repository | ZC Dev & Betas | Latest ZC 2.54 Beta | YouTube Channel
    All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0, or v3.0 where applicable..

  8. #8
    Keese
    Join Date
    May 2015
    Posts
    66
    Mentioned
    30 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    311
    Level
    6
    vBActivity - Bars
    Lv. Percent
    46.54%
    Daily Activity
    0%
    Weekly Activity
    1.21%
    Monthly Activity
    1.64%
    Quote Originally Posted by ZoriaRPG View Post
    Howzat precisely?! What are they NES Dungeon types stopping your global active scripts from doing?
    During Screen Init, global scripts are halted.

  9. #9
    ZC Contirbutor ZoriaRPG's Avatar
    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,016
    Mentioned
    95 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    3,548
    Level
    19
    vBActivity - Bars
    Lv. Percent
    9.04%
    Daily Activity
    0%
    Weekly Activity
    39.52%
    Monthly Activity
    46.71%
    Quote Originally Posted by Dimentio View Post
    During Screen Init, global scripts are halted.

    Test that with scrolling type set to 'No Scrolling', on a frame-by frame basis please, and tell me if it holds true. I believe that script drawing is suspended during all transitions, but not the global script itself.

    You may attempt to verify this by running a global counter, and seeing if it halts during screen transitions.


    ... Yet more script settings that we need to define.


    Featured Scripts & Headers: RPG.zh ( v. a0.97.1 ) ( RPG.zh Thread ) | Zelda 3 Thief's Town Treasure Chest Minigame (ffc) | Bobomb (enemy)
    ZScript & ZC-Related Pastebin | Quests and ZScript Repository | ZC Dev & Betas | Latest ZC 2.54 Beta | YouTube Channel
    All of the code that I create and publish here is free for use, modification and distribution under the GPL v2.0, or v3.0 where applicable..

  10. #10
    Keese
    Join Date
    May 2015
    Posts
    66
    Mentioned
    30 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    311
    Level
    6
    vBActivity - Bars
    Lv. Percent
    46.54%
    Daily Activity
    0%
    Weekly Activity
    1.21%
    Monthly Activity
    1.64%
    Quote Originally Posted by ZoriaRPG View Post
    but not the global script itself.

    You may attempt to verify this by running a global counter, and seeing if it halts during screen transitions.
    Except that's what I was doing. I have a script that drawtiles a bunch of tiles to the screen, and a counter which moves the position where those tiles are drawn diagonally up and to the left each frame. However, the tile stopped being moved diagonally for the duration of the screen transition onto the NES dungeon screen.

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