Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Engine
- EngineContext :luaFile
- targetfps : field
- resolution : field
- Objects : C++ Class
- LuaScriptObject : C++ Class(loading the lua script)
- contains all fields in lua : can be seen as the constructor
- name, pos, materialfile(other lua script), objectPath(.obj)
- included behaviour scripts
- Update() : ordinary update loop(gets called by C++)
- OnDestroy() : Gets Called by c++
- contains included scrips
- LuaBehaviours
- LuaScripts
- Contain OnCreate()
- Contain Update()
- Contain OnDestroy()
- Contain InteractionTypes
- Contain Interact(source, type)
- source: who interacted
- type: what does it want?(pickup/change stats)
- LuaGameBoard
- Amount of tiles x,y
- bool SetWalkable(x,y)
- to manipulate the map(only possible in luagameboard)
- WalkableMat
- UnwalkableMat
- LuaParser
- Create GameObject with LuaScriptObject parameters. Creates a new instance of each luabehaviour
- LoadDialouges(Folder)
- load all dialouges into c++ structs from the folder and puts them into a hashmap/list for fast referencing
- LoadMaterials(Folder)
- Loads the material properties to c++ code. and stores the structs to a list/map
- CreateMaterial(name/id)
- creates a material in heap
- passing all the params from the material table to the shader
- LoadGameBoard(file)
- loads the "map" && loads materials for walkable and unwalkable
- has to be loaded after all the materials get parsed.
- LoadSounds(folder)
- Loads every sound onto an array.
- Using reference id's to find stuff
- LuaMaterial
- name
- FragShaderPath
- VertShaderPath
- GetParams() returns table of string, value, type
- when a material is created the lua parser will create a new material with the parameters specified.
- it should use the string as shader attrib/field location, the value as value and the type as custom string
- the custom string gets split up to decide the expected type of the shader(["","i","d"]vec{2,3}/bool/float/double)
- fields named the same as in glsl shader
- when filling the shader loop through the table of fields
- LuaDialouge
- Text msg
- Dialog Text
- Options[] options
- Available Options
- SelectOption(int)
- C++ Calls this method when the player made a diag decision
- Options
- text button text
- dialougebox text when clicked.
- OnDialougeFinish(optionid)
- Gets Called by LuaDialouge Script
- followingdialouge dialouge that is following after this one
- can be null/nil
- API
- Interact(objectName, source)
- Calls the LuaObjects Interact(source, interactionType) function
- Each lua script does its thing
- GetPosition(objectname)
- GetRotation(objectname)
- SetPosition(objectname, x,y,z)
- SetRotation(objectname, angles, x,y,z)
- SetParent(parentname, childname)
- Destroy(objectName)
- CreateInstance(luascriptobj)
- RemoveBehaviour(objectbehaviour)
- AddBehaviour(objectname, luabehaviour)
- creates new lua script and attaches it to the given object
- AddBehaviour(objectname, sourceObjectname, sourceLuaScript)
- creates a new behaviour from an existing one. (keep the variables?)
- Restart()
- Stops Game and Reloads the complete engine(aka new game)
- Imma do hacking to just restart the whole process.
- Stop()
- Stops Game(AKA. Close Game)
- GetGridCellWalkable(x,y)
- returns bool
- SetGridCellWalkable(x,y,bool)
- sets the cell walkable state & updating the material for this tile
- PlaySound(string)
- simple sound playng by path?
- PlaySound(referenceID)
- simple sound playing by reference id(should be a lot faster)
- GetSoundRefId(string)
- returns the reference id of the loaded song of not loaded it will be loaded by trying to find the supplied string in the sound folder
- ShowDialouge(diagName)
- Shows the diaglouge by name
- IsDialouge()
- is any dialouge shown in this moment?
- IsDialouge(diagname)
- is the diagname currently shown?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement