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
Last revisionBoth sides next revision
release:zzt_enhancer:oop_enhancements [2021/05/28 21:25] asierelease:zzt_enhancer:oop_enhancements [2021/05/29 10:24] 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 =====
  
 TODO (potential names: ''lastmx'', ''lastmy'', ''songpos'', ''songrow'', ''songvol'', ''enhancer'', ''playerx'', ''playery'', ''playerdist'') TODO (potential names: ''lastmx'', ''lastmy'', ''songpos'', ''songrow'', ''songvol'', ''enhancer'', ''playerx'', ''playery'', ''playerdist'')
 +
 +===== String IDs =====
 +
 +^ ID ^ String ^
 +| 7 | ''Torches:'' |
 +| 8 | ''   Gems:'' |
 +| 11 | '' T '' |
 +| 25 | '' Torch'' |
 +
 +TODO: Complete list.
  
 ===== Commands ===== ===== Commands =====
Line 33: Line 44:
 ==== 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 ====
Line 45: Line 60:
 ==== 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 77: Line 100:
 ==== 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 97: Line 124:
 ==== 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 164: Line 205:
 ==== 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 240: Line 283:
 ==== moveplayer ==== ==== moveplayer ====
  
-Takes two arguments.+Syntax: ''moveplayer x y'' 
 + 
 +Moves the player to location ''x'', ''y''.
  
 ==== moveplayerhere ==== ==== moveplayerhere ====
Line 248: Line 293:
 ==== multiply ==== ==== multiply ====
  
-Takes two arguments.+TODO: Is mul also valid? 
 + 
 +Syntax: ''multiply "variable" x'' 
 + 
 +Multiplies ''"variable"'' by ''x''.
  
 ==== playerchar ==== ==== playerchar ====
Line 264: Line 313:
 ==== 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 329:
 ==== 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 300: Line 355:
 ==== 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 370:
  
 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 ====
Line 320: Line 379:
 ==== 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 ====
Line 336: Line 397:
 ==== 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 437:
 ==== 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 463:
 ==== 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.txt · Last modified: 2021/05/29 10:47 by asie