Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Global Hooks
- $GameInit:
- [
- if cf.fileExists("vn.tbl",".\data\vn\",true) then
- --load vn constants.
- --Initialize variables for state machine.
- VN_STATE_INIT = -1 --This is the state that's set when the vn stage just changed.
- VN_STATE_CREATE_BACKGROUND = 0
- VN_STATE_INIT_UI_COMP = 1
- VN_STATE_TEXT_DRAW = 2
- VN_STATE_CHARACTER_GEN = 3
- VN_STATE_STAGE_TRANSITION = 4
- VN_STATE_CHARACTER_TRANSITION = 5
- VN_STATE_WAITING = 6 --Everything's loaded. Waiting for player input in this state.
- VN_STATE_TRANSITION_CHOICE = 7
- VN_STATE_ACTIVATE_CHOICE = 8
- VN_STATE_CHOICE_SELECTED = 9
- VN_STATE_END = 10
- file_vntbl = cf.openFile("vn.tbl","r",".\data\vn\")
- if file_vntbl.isValid() then
- bool_vntblactive = true
- else
- ba.warn("vn.tbl loading failure. Something went wrong!")
- end
- end
- ]
- #Conditional Hooks
- $State: GS_STATE_CMD_BRIEF
- $On State Start:
- [
- if bool_vntblactive == true then
- boolean_IsVNActive = false
- local str_MissionName = getMissionFilename() .. "-vn.tbm"
- if cf.fileExists(str_MissionName,".\data\vn\",true) then
- file_vn = cf.openFile(str_MissionName,"r",".\data\vn\")
- if file_vn.isValid() then
- --file parsing here
- vnState = VN_STATE_INIT
- boolean_IsVNActive = true --ready to start!
- else
- ba.warn("file " .. str_MissionName .. " was not able to be openned properly! Reverting to normal command briefing."
- --failure block
- end
- end
- --If vn file doesn't exist, then we just resume as normal.
- end
- --If vn.tbl doesn't exist or wasn't loaded right, we continue using the normal CB code.
- ]
- $On Frame:
- [
- if boolean_IsVNActive == true then
- end
- ]
- #End
Advertisement
Add Comment
Please, Sign In to add comment