Advertisement
NovaYoshi

Princess Engine scripting

Nov 7th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. there's a "result" variable that's just an 8-bit number
  2.  
  3. "if" doesn't directly branch to anything, but if the condition is false then the next command is skipped
  4. "if" statements can be stacked on each other, too:
  5.  
  6. @if> 5
  7. @if< 10
  8. @ifflag+ someflag
  9. @ifflag- anotherflag
  10. @goto wherever
  11. "if the result is greater than 5 but less than 10, and if someflag is set but anotherflag isn't, goto wherever"
  12.  
  13. SYNTAX:
  14. %whatever directly insert stuff inline into the compiled file, mostly for directives
  15. bla bla bla bare text just directly displays onto the screen
  16.  
  17. @runasm start of an ASM section. A = result
  18. clc
  19. adc #1
  20. @endasm end of an ASM section. result = A
  21.  
  22. CONDITIONS:
  23. @ifflag+ FLAG if flag is set...
  24. @ifflag- FLAG if flag is unset...
  25. @if< value if the result is less than a value
  26. @if> value if the result is greater than a value
  27. @if= value if the result is equal to a specific value
  28. @if<> value if the result is NOT a specific value
  29. @ifyes ask yes/no, then if the player answered yes...
  30. @ifno ask yes/no, then if the player answered no...
  31.  
  32. MAP ACTIONS:
  33. @npc+ 0, 1, 2, 3, 4, 5, 6, 7 specify a list of NPCs to hide
  34. @npc- 0. 1, 2, 3, 4, 5, 6, 7 specify a list of NPCs to unhide
  35.  
  36. RESULT ACTIONS:
  37. @info? info set result to a piece of information from a table (like coins collected, etc)
  38. @ram? address set result to an address
  39. @itemamount? item set result to the quantity of an item
  40. @result value set the result to a constant value
  41.  
  42. DIALOG ACTIONS:
  43. @speaker FACE, NAME+FLAGS switch speaker and set a face and name
  44. @delay time delay an amount of time (probably frames?)
  45. @endmsg wait for key press, clear, close balloon
  46. @endpage wait for key press, clear, keep balloon open
  47. @say switch to speech balloon
  48. @think switch to thought balloon
  49. @balloon switch to normal balloon
  50. @textonly switch to no balloon, just text
  51. @actors (syntax to be determined) sets up the scene and the characters in it
  52.  
  53. FLAG ACTIONS:
  54. @flag+ FLAG set flag
  55. @flag- FLAG unset flag
  56. @flag~ FLAG toggle flag
  57.  
  58. PROGRAM FLOW ACTIONS:
  59. @goto Label either an 8-bit or 16-bit goto depending on distance
  60. @rgoto Label forced 8-bit goto
  61. @jgoto Label forced 16-bit goto
  62. @call Label call a subroutine in the current bank (16-bit label)
  63. @libcall RoutineNumber call a subroutine in a bank holding common routines
  64. @return return from a call or libcall
  65. @choices "1", Label1, "2", Label2, ... present multiple choices and go to a different 16-bit label for each
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement