User Tag List

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

Thread: Script Execution Order

  1. #1
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,781
    Level
    21
    vBActivity - Bars
    Lv. Percent
    73.04%

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

  2. #2
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,451
    Level
    24
    vBActivity - Bars
    Lv. Percent
    73.19%
    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.

  3. #3
    Banned
    Join Date
    May 2015
    Posts
    141
    Mentioned
    34 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    667
    Level
    9
    vBActivity - Bars
    Lv. Percent
    14.48%
    Also, NES Dungeon Type will always halt the global script, from experience.

  4. #4
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,047
    Level
    31
    vBActivity - Bars
    Lv. Percent
    10.69%
    Quote Originally Posted by Dimentio View Post
    Also, NES Dungeon Type will always halt the global script, from experience.
    Wait what?

  5. #5
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,781
    Level
    21
    vBActivity - Bars
    Lv. Percent
    73.04%
    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?

  6. #6
    Here lies mero. Died by his own dumbassitude.
    Join Date
    May 2011
    Posts
    929
    Mentioned
    102 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,527
    Level
    23
    vBActivity - Bars
    Lv. Percent
    13.96%
    @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
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,781
    Level
    21
    vBActivity - Bars
    Lv. Percent
    73.04%
    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?

  8. #8
    Banned
    Join Date
    May 2015
    Posts
    141
    Mentioned
    34 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    667
    Level
    9
    vBActivity - Bars
    Lv. Percent
    14.48%
    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
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,781
    Level
    21
    vBActivity - Bars
    Lv. Percent
    73.04%
    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.

  10. #10
    Banned
    Join Date
    May 2015
    Posts
    141
    Mentioned
    34 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    667
    Level
    9
    vBActivity - Bars
    Lv. Percent
    14.48%
    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