- Code: Select all
scene.updateStop("someString1");
function onUpdateStop(updateStopId){
if updateStopId == "someString1" then {
...
}
}
( sorry for the mix of Lua and JavaScript; i'm still working out some things mentally for the two languages xD )
scene.updateStop("someString1");
function onUpdateStop(updateStopId){
if updateStopId == "someString1" then {
...
}
}
sky.setGameState(enum.GS_GameOver());
you make a call to change state to the game_over state with sky.setGameState(enum.GS_GameOver()),
*1* Also do we have a way to specify the "Set Initial Game State at Doc Start" ? i would love that[/quote
You just call setState in your main script onInit()*2* Also could we have a function to change the game state to a string specified game state like sky.changeGameState("gameStateMainMenu") ? using a string means i can quickly and easily do a lot of nifty things using strings like in my other engine i'd send the name of a function i'd like to call as the objectId or timerId along with other string-based codes to specify what if condition ro switch case i want to run ( comes in mega handy all the time! )
I am not sure this will be possible as the engine needs to know all the states the at exist at compile time. The states are called by numeric ids so not sure if what ask could be possible! The big use for the states initially was to take care of pause, game start screens, option,game over etc the animation system has a built in state for controlling anim flow. In time we may be able to so more with the main engine run states, we can add as many as need though. Currently there is 5 but we could have 50!*3* hmmmmmmm i just thought of something; is it possible to have multiple game states called in an ordered string array list? or would that be too messy from both programmers side and scripters side?? hmmm xD
ucm wrote:umm are you saying that you need to manually create the various game states during engine build time in the C++ ide ?
hmmmmmm.... well if we could create our own gamestates then that would be a major advantage....
could you program a document-wide setting for 'user-defined states' then at runtime, the player first checks out the states listed in the settings and then links all the appropriate event handler functions to the user-defined states?
lol i 'think' i know what i'm talking about buuuut i probably don't xD
Yes in time there will be a way, we could have a number of user states such as onUpdate_User1
we should be able to expose them to lua for you
Users browsing this forum: No registered users and 3 guests