Barebones function 111

From Unofficial QEdit Wiki Guide
Jump to: navigation, search

Barebones function 111

Function 111: 111:

  • Function 111 = Part of count up timer code.

Count up timer code.

Count up timer code.

(In Barebones function 80. where it says sync_register 115, xxxxxxxx is the time limit / amount of time to give the clock in seconds. Default is 10 hours. You may edit this to suit the needs of your quest.)

Barebones function 110 = Function 110 - Gets the current number of frames in the day and stores it in register 113.

Barebones function 111 = Function 111 - Threaded in function 10500. Stays in function 115 until register 110 equals 00000001, If not makes register 111 equal 0000000, then continue on to function 112, and function 113.

Barebones function 112 = Function 112 - Counts 30 frames in register 111. Then Gets the current number of frames in the day and stores it in register 114. Subtracts the value of register 113 from register R114. Continue to function 113.

Barebones function 113 = Function 113 - Register 114 will be used to a the time to display. wait 1 frame. Display the clock. If register 112 is equal to 00000001 jump to function 114. If register 114 is greater then register 115 jump to function 114. If register 110 equals 00000001 jump to function 111. Jump to function 113.

Barebones function 114 = Function 114 - Turn off the display clock. Make register 112 equal 00000001 for all players. Make register 110 equal 00000000. Jump to function 115.

Barebones function 115 = Function 115 - Waits 1 frame. If register 110 equals 00000001 jump to function 111. Jump to function 115.

Use

Function 111 - Threaded in function 10500. Stays in function 115 until register 110 equals 00000001, If not makes register 111 equal 0000000, then continue on to function 112, and function 113.

How the function appears in the script


111:     jmpi_= R110, 00000000, 115 //If register 110 equals 00000000 jump to function 115
         leti R111, 00000000 //Makes register 111 equal 00000000.
112:     sync  //waits 1 frame.
         addi R111, 00000001 //Adds 00000001 to register 111.
         jmpi_< R111, 0000001E, 112 //If register 111 is less then 0000001E (30) jump to function 112.
         gettime R114 //Gets the current number of frames in the day and stores it in register 114.
         sub R114, R113 //Subtracts the value of register 113 from register R114.
113:     winset_time R114 //Register 114 will be used as the time to display.
         sync  //Waits 1 frame.
         window_time  //Displays the clock.
         jmpi_= R112, 00000001, 114 //If register 112 is equal to 00000001 jump to function 114.
         jmp_> R114, R115, 114 //If register 115 is greater then register 114 jump to function 114.
         jmpi_= R110, 00000001, 111 //If register 110 is equal to 00000001 jump to function 111.
         jmp 113 //Jump to function 113.

Also see

jmpi_=, leti, sync, addi, jmpi_<, gettime,

sub, winset_time, window_time, jmp_>, jmp,

Barebones function 80, Barebones function 110, Barebones function 112,

Barebones function 113, Barebones function 114, Barebones function 115