Development Blog!

The SceneSwitch() Riddle!

leave a comment »

Today I started development with 2 overall goals.

  • Make User Login Possible
  1. Add Login GUI form elements
  2. Add easy access controls for GUI form elements
  3. Upon login, switch from LOGIN -> GAME_MAP (they’re GUI scene titles).
  4. Add MySQL check on serverside.
  • Detach connection from client and reserve it for after the login is established.
After I had ALL of that accomplished, I had to test everything thouroughly, like always. I had GUI test elements in GAME_MAP scene. It was the chat box. You press the return/enter key to access it (gain focus to it). The problem was that, after login, pressing enter would crash the game. I assumed the issue had to be with the new elements I added. I tried to retest the way I had it before it messed up. I just removed the elements and left a button to switch scenes from LOGIN -> GAME_MAP.
It worked PERFECTLY like it originally did. So what was the problem? After hours of messing with line after line of codes I finally figured it out. Irrlicht.NET has a problem with IGUIElement focus! If you have an element in focus and just send it into oblivion without removing it’s focus, you can’t just use device.IGUIElement.SetFocus() again for some reason. I redid my SceneSwitcher() function to make sure all the elements that I have in the GUITable (hash table) is removed from focus if it is focused on.
This one single problem prevented me from ever getting to reserving the connection for logged in users only. That’ll only take 5 mins to implement though.

Written by FuRom

September 25, 2008 at 10:46 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: