Problem w/ first build tutorial

Sep 10, 2009 at 2:59 AM
Edited Sep 10, 2009 at 3:09 AM

I am creating the various levels (FirstLevel and SecondLevel) and I am trying to do it withint GameScript.cs like the documentation says (with a 3.0 project not a 3.1 project as they dont exist).   Now since I am suck with terminology (it'll get there) I was wondering what exactly it means when it says

"Let’s create a domain named CurrentLevel in GameScript’s constructor "

Now I would assume the "Constructor" actually means the within the public class

"public class GameScript : ComponentScript<IOxComponent> "

Long story short, I add the lines (paying attention to case sensitivity)

// create a domain to manage the current level

engine

We will load the first level into the CurrentLevel domain with this code –

// load the first level

<font size="2" color="#7f007f"><font size="2" color="#7f007f">

engine

Since we created a new domain, we should destroy it when the game is over. Add this code inside the if braces of GameScript’s Dispose method –

// unload the current level

Engine

The only code snipet that actually saw the class and autofilled (while typing) was the last line Engine.DestoryDomain ("CurrentLevel");

.DestroyDomain("CurrentLevel");
.LoadDocument("FirstLevel.xml", SceneConsts.SceneDocumentType, "CurrentLevel");
.CreateDomain("CurrentLevel");

I get the following error "Error 1 Invalid token '(' in class, struct, or interface member declaration C:\Documents and Settings\sczupek.ZUPEK\My Documents\Visual Studio 2008\Projects\Levels\Levels\GameScript.cs 15 28 Levels"

Sep 10, 2009 at 3:18 AM

Obviously dont mind the FONT stuff, its not part of my code.  but anyways I figured I had it in the wrong area and have since placed it under the 

public GameScript(IOxEngine engine, string parameters, Transfer<IOxComponent> component): base(engine, parameters, component)

Instead of the public class  Gamescript, now I receive the following error below

Error 1 The name 'SceneConsts' does not exist in the current context C:\Documents and Settings\sczupek.ZUPEK\My Documents\Visual Studio 2008\Projects\Levels\Levels\GameScript.cs

The VS editor doesn't seem to understand or highlight the code at all.  What am I missing here?  If i take tht all out and just add the unloading call, the application does run just fine.  Frustrating!!

Sep 10, 2009 at 10:02 AM

Okay I got the program to load by changing the SceneConsts.SceneDocumentType to just say "Level" instead.  However, everything shows up like a blank slate (I dont think cube.png loads or anything).

I do get the following WARNINGS though.
-----
Warning 1 Asset was built 2 times with different settings:
using TextureImporter and TextureProcessor
using TextureImporter and TextureProcessor, referenced by Ox\Models\cube.X (ModelProcessor), Ox\Models\normalMappedCube.X (ModelProcessor) C:\Documents and Settings\sczupek.ZUPEK\My Documents\Visual Studio 2008\Projects\Levels\Levels\Ox\Models\cubeTexture.png Levels
-----

So the two questions remaining are

1) Why isn't there a routine called SceneConsts (and everything that follows after it)
&
2) Am I actually supposed to be seing something?

Sep 10, 2009 at 9:34 PM

Anyone?  I'd really like the IDE to work correctly and know what I am screwing up here.  Am I supposed to be seeing a cube when I compile because all I see is black like the original project compile.

Sep 14, 2009 at 8:59 PM

Okay so I would assume its safe to say that this game engine is not supported by anyone useful?

Sep 14, 2009 at 10:15 PM

Okay, if anyone else follows the documentation and runs into this same problem GuiConsts.GuiDocumentType was supposed to be GuiConfiguration.GuiDocumentType

I came to this conclusion by going to the Object Browser in VS.C# Express and searching for GuiDocumentType in which it was found under GuiConfiguration and not GuiConsts as it doesnt exist.

I was frustrated for some time trying to get an answer, so if you run into any tutorials or walkthroughs where this becomes a problem, go search the Objects and see where it really located.

Sep 24, 2009 at 3:04 AM
Edited Sep 24, 2009 at 3:05 AM

szupek - Sorry to hear you had that much trouble with that.  If you look at some of Bryanedds other posts, you can see that he mentiones making the change from GuiDocumentType to GuiConsts relatively recently.  It sounds like possibly you had an older version of the code, coupled with a newer version of the documentation. Hopefully this project will continue to gain support and the discussion board will get more helpful as this engine gains popularity.

Personally, I'm having some trouble in the opposite direction.  I'm trying to go through the Gui tutorial spelled out in my version of the documentation, and it is pretty clear that I've got mis-matched versions the other direction. :)  If I manage the basic tutorials on the build I have, I'll type up the changes.  Best of luck!

Tim

Sep 24, 2009 at 8:40 PM

Tim,

I did check the versions of available documentation and it appears that there was no documentation to take into the changes in the updated code.  So I am/was running the latest version available as of Aug 2009.  If there was a new version of the documentation it has not been easy to find, which brings up a concern to future people wanting to use this engine.  The engine is only as good as its supporting documentation.  And even though I still have the latest version of the engine GuiConst is still nowhere to be found, so I'll stick with GuiConfiguration.  This engine has all potential in the world, if you can get people to use it, which means updating the code requires updating the supporting documentation :P

 

I had no problems with the GUI tutorial, if care to share a little bit more info on the problem you are having?

Sep 24, 2009 at 9:00 PM

Well, if you got the GUI tutorial okay, then you're one up on me. ;)  I completely agree about the need for good documentation and samples.  Clearly bryanedds has put a ton of great effort into building this engine, and I think that if we could get a couple more proficient users active on this board and possibly helping create some tuotrials and documents, this engine could really take off.  clearly it is gaining momentum, just looking at the number of pageviews and downloads on the "stats" tab...

 

I'm at work now, but when I get off I'll check on my version numbers, etc. and give a detailed example of the problem I'm having.  Maybe we can get this sorted out in a blind-leading-the-blind kind of way. :)

 

Tim

Sep 24, 2009 at 9:19 PM

I think I am starting to get some vision through 1 eye:)  I have gotten through all tutorials and am working on importing and creating my own .FBX files into the engine, so I think we can help.  Then if you or myself wanted to update the documentation, that could help quite a bit to the rest.  I am the type that always works better in groups.:)

 

Sep 24, 2009 at 11:08 PM
Edited Sep 24, 2009 at 11:08 PM

Oh, that's rich.  Okay, here's where I am right now, as well as what I've tried.

Originally, I  downloaded "OxGameEngine2.0.3.5.msi" I believe that was from the link here: https://sourceforge.net/projects/oxgameengine/

That version had the "Consts" nomenclature instead of the "Configuration" nomenclature.  However, it was giving me errors when I tried to compile my Gui tutorial project.  As I recall it was in essence telling me that the Component didn't know what a Button was.  It was certainly giving me fits about the line:

nextButton.Clicked += x => guiSystem.Screen = titleScreen;

because there was no "Clicked" event associated with Buttons.

So I figured I'd get a Subversion client, download the source directly, and recompile it myself to make certainI had the latest version.  Clearly, I know not what I do.  :)  After a bunch of screwing around with my own lack on comprehension, I finally got it built, and created a setup.exe.  I uninstalled my previous version, installed my new one, made sure the editor stll worked, and fired up VS2008.  I loaded my Screens project, and now it doesn't know what "GuiConsts" is.  It wants GuiComponents, just like yours did I think.  And now that I look at the August 9th release 63 notes:

http://oxgameengine.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=31349

I see that I had it backwards - I guess the "Consts" terminology is the outdated one.  Okay.  I'm now going to get release 63 there, install that, and see if it is any different...  I'll keep you posted if I learn anything helpful.

 

 

Sep 25, 2009 at 12:12 AM
Edited Sep 25, 2009 at 12:18 AM

 

Ah-ha!   Okay, so.  As silly as it sounds to have to say this out loud, as it were, here's what we both got wrong - we did both have mis-matched versions of the code and documentation, but completely different mis-matched stuff.  Here's the apparently correct, and if not correct at least internally consistent way to do it.  It's so simple I could smack myself.

Go here:

http://oxgameengine.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=31349

This is release 63, version 2.1.0.0 of the Game engine and editors.  Download it where it says Ox Game Engine Installer 2.1.0.0

Also download the documentation file listed as Ox Game Engine Documentation 2.1.0.0a

The deal is that the documentation packed up in the installer is out of date - that's why you were reading docs that refer to "Consts" while I was reading docs that refer to "Configuration".  To set the record straight for posterity, The "Configuration" syntax is correct.  Getting both items from that page will give you tutorials and code that match up.  this isn't to say it'll just work from there - personally, I found that my newly-created Ox project file GameScript.cs wasn't referencing the Ox.Gui or Ox.Gui.Component, and I had to add those to the "using" statements at the top of the file.  There also appears to be a mistake (or a pair of them, rather) in the sample code for how to assign the navigation events to the buttons' Clicked events. 

the code in the tutorial proper is:

 

       // script the story screen's back button to transition to the title screen

      var backButton = engine.GetComponent<IButton>("StoryScreen.Back");

      previousButton.Clicked += x => guiSystem.Screen = titleScreen;


the corrected version of this code is below (change in bold)

      // script the story screen's back button to transition to the title screen

      var backButton = engine.GetComponent<IButton>("StoryScreen.Back");

     BackButton.Clicked += x => guiSystem.Screen = titleScreen;


The stuff down in the recap is incorrect in the same section, but in a different fashion.  There, instead of assigning action to the BackButton, it references the NextButton again.

 

Hope this helps someone!

 

Tim