Feature Overview
"KNUTIL" is a library for PICO-8 that contains functions that are frequently used in the games I have created.
I've kept the functions that I eventually needed in my production.
In this cart, I show you how the scene functions work with animations.
Z key: Execute the order command.
Up/Down: Select the order command.
SCENE MANAGER controls and replaces the order in which functions are called with a small number of tokens by using consecutive string instructions.
The generated SCENE can register a global function as an ORDER.
One of the registered ORDERS is retrieved by SCENE and the process is repeated for the specified length.
When the processing is finished, it repeats the processing of the next ORDER.
This is expected to facilitate the planning of the performance.
Using SCENE
ORDER COMMANDS
Create a function for ORDERS.
Run each SCENE.
ORDER function
Properties of ORDER
The following parameters can be referenced as global variables.
Functions other than scenes
SET 1: Basic Library
★ Libraries for frequent use and quick implementation
AMID: Expand the arguments to positive and negative and do mid().
BPACK: Pack the value of the bit specification with bit width.
BUNPACK: Slice the value with bit width.
CAT: Concatenate tables. Indexes are added last and identical keys are overwritten.
COMB: Combines two tables to create a hash table.
ECPALT: Set transparency from palette table.
HTD: Split a continuous string of hexadecimal numbers into a table.
HTBL: Converting a string to a table(Multidimensional Array / Hash Table / Jagged Arrays)
INRNG: Tests that the specified value is within a range.
JOIN: Joins strings with a delimiter.
MKPAL: create a color swap table for use in PAL()
.
MSPLIT: Multi-layer split.
OPRINT: Print with outline.
RCEACH: Iterate from rectangle values.
REPLACE: Perform string substitutions.
TBFILL: Creates a table filled with the specified values.
TMAP: More compact operable foreach iterator.
TOHEX: Digit-aligned hexadecimal conversion (not including 0x).
TTABLE: If the argument is a table, the table is returned.
SET 2: Libraries to create objects
★ Rectangles that incorporate judgment and drawing, scenes that manage screen and operation transitions
EXRECT: Creates a rectangle object with extended functionality.
MKSCENES: This post! Manage screen and operation switching.
SET 3: Debugging Library
★ Real-time or stop and inspect at any timing
DBG: Displays any timing debugging value.
DMP: Dumps information about a variable.
++ REMOVED ++
UPDATE HISTORY
Please do not use this library and its code for the purpose of promoting vaccines.
The documentation says CMDSCENES, but the code says SCENESBAT. Which is correct or am I misunderstanding something?
OH!!! In the currently uploaded version 'SCENESBAT' is correct! I was going to change it to CMDSCENES in a future version.
I often want to change the name after some time has passed since I created it.
My apologies... >_<
I have updated KNUTIL to version 0.6!
@tmskna
I changed the function name from SCENESBAT to CMDSCENES!
Scene iterating has been simplified.
The following code is an example.
SCENES = MKSCENES( { 'UPD', 'DRW', 'KEY' } ) FUNCTION _UPDATE() FOR I,V IN PAIRS(SCENES) DO V.TRA() END END |
Please check the UPDATE HISTORY for other changes.
Thank you.
KNUTIL has been updated to v0.7!
- sceneorder:"rate" func countermeasures against overflow of digits
- code update saved token:
- htbl: 7 tokens
- tonorm: 9 tokens
KNUTIL has been updated to v0.8!
- join: Use of tuples
- tbfill: Defaults to 1 or specifies the start of the table
- tohex: Supported for update of join()
KNUTIL has been updated to v0.9!
- tbfill: changed to specify indexes at the beginning and end of tables, support for variable length arguments.
- tohex: fixed for update of tbfill()
NUTIL has been updated to v0.10 and v0.11!
v0.10
- split: supports multi-dimensional arrays.
- cmdscenes: fixed for split update.
- sceneorder: update for use of tuples.
- dmp: apply p8scii font color.
v0.11
- htd: fixed table values to local variables.
- bpack: specification change from ttoh().
- bunpack: specification change from htot().
- slice: the function was removed because there is a
{unpack()}
with a similar function.
KNUTIL has been updated to v0.12!
v0.12
- library help added to pause menu.
- bmch: unlisted.
- exrect: fix variable and function names.
- scene:
- rate: adjustment of decimal point overflow countermeasures.
- cmdscenes: continuous call handling.
- added functions for iterators.
- dbg: simplification by join.
- replace: support for multiple replacements.
KNUTIL has been updated to v0.13!
v0.13
- scene:
- cmdscenes:supports indentation description by tabs.
There are two "vdmp" which should be "dmp".
- In the description of the HTBL() article on this BBS
- In the last (commented out) line of the "multidimensional table" example in the KNUTIL code
Thanks for the continuous improvements.
Yes, indeed.
Minor version updade to v0.13.1 to fix the past vdmp description.
I have updated knutil to v0.14.0!
- amid:change the order of arguments.
- ecpalt:be sure to perform initialization of the transparency settings.
- htbl:token cost cut, note second return value.
- htd:change from tmap to foreach.
- dbg:support for nil
- dmp:added _update_buttons().
- mkpal:arguments before and after the change. support for multiple palette sets.
- msplit:wrapper for split() is eliminated and renamed.
- oprint:inherit outline() and rename function.
- replace:support for multiple replacements.
- tmap:support for false replacements.
- ttable:use count() to determine.
- scene:
- cmdscenes:changed to scmd. for a while cmdscenes will remain for compatibility.
- sh:delete order shift as it is not used.
- order:
- swap 𝘦𝘯𝘷[] and order parameters to support references from global variables
- change parameter name(_rate _cnt _rm _fst _lst _nm _dur _prm)
- changed diagram staging; no intervening shift processing.
- parallel added to diagram production.
-
correction of library documentation.
- [deleted]:
- toc
- tonorm
- ecmkpal
function _draw() cls() if isparallel then foreach(scenes,function(s) tmap(s.ords,function(v,i) -- _scal.push,_scal.push,_scal.shift... s.tra(i) end) end) |
When an element of s.ords is removed by s.tra(i), the indexes of subsequent elements are shifted and the next ORDER is skipped. (In the sample program, when an ORDER ends during PARALLEL, the immediately following valid ORDER is seen blinking.) Perhaps processing in reverse order would solve the problem.
@tmskna
Thanks for noticing that!
It looks like I need to update my library soon.
The code part you pointed out will be changed as follows.
function _draw() cls() foreach(scenes,isparallel and transitionp or transition) end function transitionp(v) for o in all({unpack(v.ords)}) do v.tra(o) end end |
By regenerating the table from unpack(), the effect of table-del will be avoided. Processing will proceed in order.
[Please log in to post a comment]