fork(1) download
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. music = "sans" --Always OGG. Extension is added automatically. Remove the first two lines for custom music.
  4. encountertext = "Thanks for watching!" --Modify as necessary. It will only be read out in the action select screen.
  5. nextwaves = {"bullettest_chaserorb"}
  6. wavetimer = 4.0
  7. arenasize = {155, 130}
  8.  
  9. enemies = {
  10. "oliverex"
  11. }
  12.  
  13. enemypositions = {
  14. {0, 0}
  15. }
  16.  
  17. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  18. possible_attacks = {"bullettest_bouncy", "bullettest_chaserorb", "bullettest_touhou"}
  19.  
  20. function EncounterStarting()
  21. Player.name = "Viewer"
  22. Player.lv = 1
  23. Audio.Play(sans)
  24. State("ENEMYDIALOGUE")
  25. end
  26.  
  27. function EnemyDialogueStarting()
  28. local intro = GetGlobal("intro") --updates the variable "intro" everytime the EnemyDialogueStarting() function is triggered
  29. if intro == true then
  30.  
  31. 'currentdialogue' "Hey there! I am Oliver EX."
  32. 'currentdialogue' "...Unitale doesn't allow apostrophes."
  33. 'currentdialogue' "I started this channel up a month ago as Undertale music."
  34. 'currentdialogue' "But now I don't want to just do music playlists and stuff."
  35. SetGlobal("intro", false) -- sets the variable "intro" to false so that this line of dialogue only plays once
  36. end
  37. end
  38.  
  39. function EnemyDialogueEnding()
  40. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  41. -- This example line below takes a random attack from 'possible_attacks'.
  42. nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  43. end
  44.  
  45. function DefenseEnding() --This built-in function fires after the defense round ends.
  46. encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  47. end
  48.  
  49. function HandleSpare()
  50. State("ENEMYDIALOGUE")
  51. end
  52.  
  53. function HandleItem(ItemID)
  54. BattleDialog({"Selected item " .. ItemID .. "."})
  55. end-- your code goes here
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
luac: prog.lua:31: unexpected symbol near ''currentdialogue''
stdout
Standard output is empty