AndrewofDoom

vn thingy start.

May 19th, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. #Global Hooks
  2.  
  3. $GameInit:
  4. [
  5. if cf.fileExists("vn.tbl",".\data\vn\",true) then
  6. --load vn constants.
  7. --Initialize variables for state machine.
  8. VN_STATE_INIT = -1 --This is the state that's set when the vn stage just changed.
  9. VN_STATE_CREATE_BACKGROUND = 0
  10. VN_STATE_INIT_UI_COMP = 1
  11. VN_STATE_TEXT_DRAW = 2
  12. VN_STATE_CHARACTER_GEN = 3
  13. VN_STATE_STAGE_TRANSITION = 4
  14. VN_STATE_CHARACTER_TRANSITION = 5
  15. VN_STATE_WAITING = 6 --Everything's loaded. Waiting for player input in this state.
  16. VN_STATE_TRANSITION_CHOICE = 7
  17. VN_STATE_ACTIVATE_CHOICE = 8
  18. VN_STATE_CHOICE_SELECTED = 9
  19. VN_STATE_END = 10
  20. file_vntbl = cf.openFile("vn.tbl","r",".\data\vn\")
  21. if file_vntbl.isValid() then
  22.  
  23.  
  24. bool_vntblactive = true
  25. else
  26. ba.warn("vn.tbl loading failure. Something went wrong!")
  27. end
  28.  
  29. end
  30. ]
  31.  
  32. #Conditional Hooks
  33.  
  34. $State: GS_STATE_CMD_BRIEF
  35.  
  36. $On State Start:
  37. [
  38. if bool_vntblactive == true then
  39. boolean_IsVNActive = false
  40. local str_MissionName = getMissionFilename() .. "-vn.tbm"
  41. if cf.fileExists(str_MissionName,".\data\vn\",true) then
  42.  
  43. file_vn = cf.openFile(str_MissionName,"r",".\data\vn\")
  44. if file_vn.isValid() then
  45. --file parsing here
  46.  
  47. vnState = VN_STATE_INIT
  48. boolean_IsVNActive = true --ready to start!
  49. else
  50. ba.warn("file " .. str_MissionName .. " was not able to be openned properly! Reverting to normal command briefing."
  51. --failure block
  52. end
  53. end
  54. --If vn file doesn't exist, then we just resume as normal.
  55. end
  56. --If vn.tbl doesn't exist or wasn't loaded right, we continue using the normal CB code.
  57. ]
  58.  
  59. $On Frame:
  60.  
  61. [
  62. if boolean_IsVNActive == true then
  63.  
  64.  
  65. end
  66. ]
  67.  
  68. #End
Advertisement
Add Comment
Please, Sign In to add comment