User Tools

Site Tools


release:zzt_enhancer:oop_enhancements

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
release:zzt_enhancer:oop_enhancements [2021/05/28 21:25] asierelease:zzt_enhancer:oop_enhancements [2021/05/29 10:47] (current) asie
Line 8: Line 8:
  
   * ZZT Enhancer commands are prefixed with ''']''. This makes regular ZZT see them as comments, due to the preceding apostrophe. Prefixing the ZZT Enhancer command with ' makes its parser also treat it as a comment.   * ZZT Enhancer commands are prefixed with ''']''. This makes regular ZZT see them as comments, due to the preceding apostrophe. Prefixing the ZZT Enhancer command with ' makes its parser also treat it as a comment.
 +  * Variables must always be specified in quotes, like ''']add "stones" 1''.
  
 ===== Variables ===== ===== Variables =====
Line 13: Line 14:
 TODO (potential names: ''lastmx'', ''lastmy'', ''songpos'', ''songrow'', ''songvol'', ''enhancer'', ''playerx'', ''playery'', ''playerdist'') TODO (potential names: ''lastmx'', ''lastmy'', ''songpos'', ''songrow'', ''songvol'', ''enhancer'', ''playerx'', ''playery'', ''playerdist'')
  
-===== Commands =====+===== String IDs =====
  
-==== ne, sw, se, nw ====+^ ID ^ String ^ 
 +| 7 | ''Torches:''
 +| 8 | ''   Gems:''
 +| 11 | '' T ''
 +| 25 | '' Torch'' |
  
-TODO+TODO: Complete list.
  
-==== tntstetw ====+===== Commands ===== 
 + 
 +==== n, s, e, w, neswsenw ==== 
 + 
 +Move while preserving background color.
  
 TODO TODO
  
-==== tne, tsw, tse, tnw ====+==== tn, ts, te, tw, tne, tsw, tse, tnw ====
  
 TODO TODO
Line 33: Line 42:
 ==== add ==== ==== add ====
  
-Takes two arguments.+Syntax: ''add "variable" x'' 
 + 
 +Adds ''x'' to ''"variable"''.
  
 ==== addcstat ==== ==== addcstat ====
  
-Takes five arguments.+Syntax: ''addcstat ypos color char name "variable"'' 
 + 
 +Adds a stat to the sidebar, at Y position ''ypos'', with an icon ''color'', ''char'', name ''name'', tracking variable ''"variable"''.
  
 ==== allocscreen ==== ==== allocscreen ====
  
-Takes one argument.+Syntax: ''allocscreen number_of_screens'' 
 + 
 +Allocate ''number_of_screens'' screens, addressable from ''0'' to ''number_of_screens - 1''.
  
 ==== becomeb ==== ==== becomeb ====
  
-Takes two arguments.+Syntax: ''becomeb element color''
 + 
 +Becomes a statless ''element'' of color ''color''.
  
 ==== becomeo ==== ==== becomeo ====
  
-Takes five arguments.+Syntax: ''becomeo element_id color ??? ??? ???'' 
 + 
 +Becomes a statted element with the specified parameters.
  
 ==== bgfade ==== ==== bgfade ====
Line 65: Line 84:
 ==== changeb ==== ==== changeb ====
  
-Takes four arguments.+Syntax: ''changeb from_element from_color to_element to_color''. 
 + 
 +Changes all instances of a given element ID and color to the other element ID and color. ? may be used as a wildcard in from_color. Faster than ZZT ''#change''
 + 
 +TODO: Can ? be used elsewhere?
  
 ==== charedit ==== ==== charedit ====
Line 73: Line 96:
 ==== charid ==== ==== charid ====
  
-Takes two arguments.+Syntax: ''charid element_id char_id'' 
 + 
 +Changes the rendering character for ''element_id'' to ''char_id''. 
 + 
 +TODO: Does this work on elements with custom rendering logic? (Text, objects, etc.)
  
 ==== chstr ==== ==== chstr ====
  
-Takes one argument.+Syntax: ''chstr string_id contents'' 
 + 
 +Replaces the string with ID ''string_id'' with ''contents''.
  
 ==== color, colour ==== ==== color, colour ====
  
-Takes one argument.+Syntax: ''color x'' 
 + 
 +Sets the color value of the tile to ''x''.
  
 ==== colorxy, colourxy ==== ==== colorxy, colourxy ====
Line 89: Line 120:
 ==== cropscreen ==== ==== cropscreen ====
  
-Takes seven arguments.+Syntax: ''cropscreen screen_index x1 y1 width height x2 y2'' 
 + 
 +TODO
  
 ==== defaultpal ==== ==== defaultpal ====
Line 97: Line 130:
 ==== delete ==== ==== delete ====
  
-Takes one argument.+Syntax: ''delete "variable"'' 
 + 
 +Deletes the variable ''"variable"''
 + 
 +==== deletecstat ==== 
 + 
 +Seemingly **not implemented** as of Enhancer 0.3b. TODO: Verify 
 + 
 +Syntax: ''deletecstat ypos'' 
 + 
 +Removes the custom stat at ''ypos''.
  
 ==== dieitem ==== ==== dieitem ====
  
-Takes no arguments.+Syntax: ''dieitem'' 
 + 
 +Destroys the object and moves stat 0 - the player - to its location.
  
 ==== divide ==== ==== divide ====
  
-Takes two arguments.+Syntax: ''divide "variable" x'' 
 + 
 +Divides ''"variable"'' by ''x''.
  
 ==== dualfont ==== ==== dualfont ====
Line 116: Line 163:
  
 ==== enhance ==== ==== enhance ====
 +
 +Syntax: ''enhance [16-byte lower-case hex value]''
  
 TODO TODO
Line 137: Line 186:
 ==== freescreen ==== ==== freescreen ====
  
-Takes no arguments.+Syntax: ''freescreen''
 + 
 +Deallocate all allocated screens. The opposite of ''allocscreen''.
  
 ==== freewav ==== ==== freewav ====
Line 164: Line 215:
 ==== ifat ==== ==== ifat ====
  
-Takes four arguments.+Syntax: ''ifat x y element color command''
 + 
 +If, at location ''x'', ''y'', there is an element ''element'' of color ''color'', execute ''command''.
  
 ==== ifbup ==== ==== ifbup ====
Line 212: Line 265:
 ==== loadscreenres ==== ==== loadscreenres ====
  
-Takes two arguments.+Syntax: ''loadscreenres screen_index resource_index'' 
 + 
 +Loads screen from resource ''resource_index'' to slot ''screen_index''.
  
 ==== loadwav ==== ==== loadwav ====
Line 240: Line 295:
 ==== moveplayer ==== ==== moveplayer ====
  
-Takes two arguments.+Syntax: ''moveplayer x y'' 
 + 
 +Moves the player to location ''x'', ''y''.
  
 ==== moveplayerhere ==== ==== moveplayerhere ====
Line 248: Line 305:
 ==== multiply ==== ==== multiply ====
  
-Takes two arguments.+TODO: Is mul also valid? 
 + 
 +Syntax: ''multiply "variable" x'' 
 + 
 +Multiplies ''"variable"'' by ''x''.
  
 ==== playerchar ==== ==== playerchar ====
  
-Takes one argument.+Syntax: ''playerchar char_id''
 + 
 +Sets the player character to ''char_id''.
  
 ==== playercharn, playerchars, playerchare, playercharw ==== ==== playercharn, playerchars, playerchare, playercharw ====
Line 260: Line 323:
 ==== playercol ==== ==== playercol ====
  
-Takes one argument.+Syntax: ''playercol color''
 + 
 +Sets the player color to ''color'' (0 - 255).
  
 ==== playsong ==== ==== playsong ====
  
-Takes no arguments.+Syntax: ''playsong filename''
 + 
 +Plays the song ''filename''.
  
 ==== playsongres ==== ==== playsongres ====
  
-Takes one argument.+Syntax: ''playsongres resource_index''
 + 
 +Playes the song at asset index ''resource_index''.
  
 ==== playwav ==== ==== playwav ====
Line 276: Line 345:
 ==== putblock ==== ==== putblock ====
  
-Takes four arguments.+Syntax: ''putblock x y element color''
 + 
 +Place a statless ''element'' of color ''color'' at position ''x'', ''y''.
  
 ==== putcolor, putcolour ==== ==== putcolor, putcolour ====
Line 288: Line 359:
 ==== putobj ==== ==== putobj ====
  
-Takes seven arguments.+Syntax: ''putobj x y element_id color ??? ??? ???'' 
 + 
 +Place a statted element with the specified parameters at location ''x'', ''y''.
  
 ==== putobjup ==== ==== putobjup ====
  
-Takes five arguments.+Syntax: ''putobjup element_id color ??? ??? ???'' 
 + 
 +TODO
  
 ==== putsave ==== ==== putsave ====
Line 300: Line 375:
 ==== puttext ==== ==== puttext ====
  
-Takes three arguments.+Syntax: ''puttext x y color text'' 
 + 
 +Puts the "''text''" string in color ''color'' location ''x'', ''y''.
  
 ==== putval ==== ==== putval ====
Line 313: Line 390:
  
 Takes the following types of arguments: ''player'', ''self'', or ''<x> <y>''. Takes the following types of arguments: ''player'', ''self'', or ''<x> <y>''.
 +
 +Makes future "x, y" location arguments be calculated relative to the provided target.
  
 ==== restorescreen ==== ==== restorescreen ====
  
-Takes three arguments.+Syntax: ''restorescreen screen_index x y''
 + 
 +Restores the screen slot ''screen_index'' to (''x'', ''y'').
  
 ==== rgb ==== ==== rgb ====
  
-Takes four arguments.+Syntax: ''rgb id r g b'' 
 + 
 +Set the color ''id'' to color values ''r'', ''g'', ''b'' (range 0-63).
  
 ==== savescreen ==== ==== savescreen ====
  
-Takes five arguments.+Syntax: ''savescreen screen_index x1 y1 x2 y2''
 + 
 +Saves the screen area from (''x1'', ''y1'') to (''x2'', ''y2'') to the screen slot ''screen_index''.
  
 ==== scrollchar ==== ==== scrollchar ====
Line 336: Line 421:
 ==== set ==== ==== set ====
  
-Takes two arguments.+Syntax: ''set "variable" x'' 
 + 
 +Sets the variable ''"variable"'' to the value ''x''.
  
 ==== setcoli ==== ==== setcoli ====
  
-Takes two arguments.+Syntax: ''setcoli c x'' 
 + 
 +Sets the intensity of color ''c'' to ''x'' (0 - 100).
  
 ==== setmusicvol ==== ==== setmusicvol ====
  
-Takes one argument.+Syntax: ''setmusicvol x'' 
 + 
 +Sets the music volume to ''x'' (0 - 100).
  
 ==== setpali ==== ==== setpali ====
  
-Takes one argument.+Syntax: ''setpali x'' 
 + 
 +Sets the global palette intensity to ''x'' (0 - 100).
  
 ==== setsongpos ==== ==== setsongpos ====
Line 368: Line 461:
 ==== stopsong ==== ==== stopsong ====
  
-Takes no arguments.+Stops the currently playing song.
  
 ==== subtract ==== ==== subtract ====
  
-Takes two arguments.+Syntax: ''subtract "variable" x'' 
 + 
 +Subtracts ''x'' from ''"variable"''.
  
 ==== teleport ==== ==== teleport ====
Line 392: Line 487:
 ==== walk ==== ==== walk ====
  
-Takes two arguments.+Syntax: ''walk x y'' 
 + 
 +Sets the walking direction to ''x'', ''y''. For instance, ''walk -1 -1'' will cause the object to walk north-west.
  
 ==== walkxy ==== ==== walkxy ====
  
 Takes four arguments. Takes four arguments.
release/zzt_enhancer/oop_enhancements.1622237108.txt.gz · Last modified: 2021/05/28 21:25 by asie