New to JME!

Is it possible for somebody to create a barebones example with 2 game states, one display some text, one displaying a box and they switch when i press the enter key?



This way I would be able to see how this is supposed to work and begin development!



It would also be really helpfull to lots of other new people as well!



Thanks in advance guys! I just want to get this correct first time, or at least start off on the correct path.



If somebody is kind enough to make an example - could they zip it up or paste in in the thread!



Cheers



Andy

i’ll throw an easy example together with 3 gamestates. (Text, Input and 3D)

It will be like this but without fenggui and a bit easier to follow.

you sir - are my hero!



Thanks so much, im eagerly awaiting it!  :smiley:

hmm thats what i could come up with :slight_smile:

i hope the comments explain most things



GamestateExample.zip

This is a terrific example.



SO :



the inputsystem gamestate is always active - it needs to be as all input goes here…where does input go if the 3d gamestate is active, will it go to the update function inside the active gamestate?



As far as i can see the ortho gamestate is always active also? is this the case? what does it do!



Thanks for the example, its just waht I needed!

I didn't make a possibility to disable to InputGamestate, so you cant lock yourself out. If it could be disabled, you wouldn't be able to exit with the ESC key  :slight_smile:



You can disable the Ortho state by keeping F1 pressed, if you release F1 it will become active again. (thats simply how its implemented in the ActionChangeController right now)



If you have a player object in the MainGameState it could have its own inputHandler, it dosen't matter really. Thats completely up to you how you structure the game.

There are many possibilities.

Core you have been a really fantastic help to me, and so has everybody else who has answered my questions over the past day!



I am going to have a play with this - and see if i can get some terrain working by following the terrain tutorial on the wiki and merge it with my new gamestate method of thinking!



Thanks guys.



Andy

I worked with this fine example and tried to enhance it further.



I added another Gamestate with loads a 3DS model and displays it.



But the object displayed is completely white. So I suppose I have problems with light. I do not have any problems when I put everything in one gamestate.



Do I have to add light in every Gamestate? If so how and why?



And why do I have to set Renderer to



rootNode.setRenderQueueMode(Renderer.QUEUE_OPAQUE);



in order to see the model at all?



Thanks for answers sorry for basic questions again :slight_smile:

Every GameStates node is rendered separately by GameStateManager, so i think they all need their own lightstate.

i can't think of a reason why setRenderQueueMode(Renderer.QUEUE_OPAQUE would be needed explicitely, maybe your loaded model has no BoundingBox set, so that is actually gets culled?

I dont think you need a lightstate in all gamestates if you use StandardGame or something to start it off, as it sets the lightstate.



Anyway, if i use the unifiedModelLoader, it converts my model to a jbin, next time i run the game, does it recreate this jbin model, or does it reload the one it created before?



Because it would make sense for the loader to scan through, see if it had already made it, if it had, read it , instead of making a new one?

fixed it



I forgot in every Gamestate after changing Z Buffer info



 rootNode.updateRenderState();



now it works perfectly