About Store Forum Documentation Contact



Post Reply 
Execute code files
Author Message
treavor09 Offline
Member

Post: #1
Execute code files
So i am very new to EE and looking to really get into it i've been figuring out some of the engine on my own, then i ran accross the wiki and found a ton of info and much to my delight i found a "hello world tutorial" so i essentialy copied down the code from the wiki onto a code page in ee 2.0 but, when i try to build it it says "no application selected or it has invalid name"

Here is the code so you guys can point out my bonehead mistake/
//////////////////////////////////////////////////////////////////////////
#include "stdafx.h"

void InitPre()
{
App.name("Start"); // application name
Paks.add("../data/engine.pak"); // load engine data
D.sync(true); // enable screen sync
}
Bool Init()
{ // here engine will be ready to load game data
// return false when error occured
return true;
}

void Shut() // shut down at exit
{
// called when engine is about to exit
}

Bool Update()
{
// processes each frame update
if(kb.bp(KB_ESC))return false; // exit if esc key is hit
return true; // continue
}

void Draw() // main drawing
{
// tell's engine what to draw on screen
D.clear(TURQ); // clear screen to draw turqouise
D.text (0, 0.1f, "this is the first tutorial"); // draw text at (0, .1) pos
D.text (0, -0.1f, "replace the CPP with some other file to a diffrent tutorial ");
}
////////////////////////////////////////////////////////////////////////////////////

the name of the code file is hello world and it is contained in a folder named hello world. i realise it is probably something very minor im overlooking so if you could point out what im doing wrong. i thank you all in advance and look forward to eventually being able to help advance the community smile
04-26-2013 04:35 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #2
RE: Execute code files
I'm not a pro either, just working with this for a bit more than a month now, but I'm pretty sure that error has nothing to do with your code.
Most likely, you don't have the box near your application ticked. Check for that. Near your application element in the editor is a checkbox, the engine only works on the one that is ticked (in case you have more applications), and when none is checked you get this error.

Not sure what else might cause this. I'll think about it if it's not this damn simple solution.
(This post was last modified: 04-26-2013 04:57 PM by AndrewBGS.)
04-26-2013 04:55 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #3
RE: Execute code files
Like andreim said, you have to right-click, go to new > Application and make put your code file under the application. However, Esenthel 2.0 code editor will not run with that code; it's meant for 1.0 with Visual Studio.

Alternatively, Esenthel comes with a bunch of tutorials, including a Hello World tutorial.
04-26-2013 05:23 PM
Find all posts by this user Quote this message in a reply
treavor09 Offline
Member

Post: #4
RE: Execute code files
okay so i didnt have it in an application folder my bad, so i placed it in the folder and it started to build and i got

/*****************************************************************
1>-----Build started: Project:hello world, Configuration: Debug Win32------
1>stdafx.cpp
1>hello world.cpp
1>c:\games\esenthel\projects\_build_\hello world\source\hello world.cpp(27):error C2065:'kb': undeclared identifier
1>c:\games\esenthel\projects\_build_\hello world\source\hello world.cpp(27):error C2228: left of 'bp' must have class/struct/union
1> type is "unknown-type"
1> Auto.cpp
1> Generating Code...
=====Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========
///////////////////////////////////////////////////////////////////////////////////////////

so is this just a change in the engine from 1.0 to 2.0 that i need to update or did i do something else wrong? once again thanks for your help
04-26-2013 05:44 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #5
RE: Execute code files
c:\games\esenthel\projects\_build_\hello world\source\hello world.cpp(27):error C2065:'kb': undeclared identifier

C++ is case sensitive. the engine has declared 'Kb', you used 'kb' in code. change it to capital K and it should be ok.
The following error will be fixed once Kb is properly declared.

(damn it feels good to help once in a while instead of asking stupid questions)
04-26-2013 06:24 PM
Find all posts by this user Quote this message in a reply
treavor09 Offline
Member

Post: #6
RE: Execute code files
/facepalm i knew it was something just completely dumb it says succeeded now but it does not actually paint the output on the screen, is there a different procedure im forgetting to do
04-26-2013 07:38 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #7
RE: Execute code files
I think you're combining some EE 1.0 with some 2.0 stuff in the init function. Instead of Packs.add, try using EE_INIT();

That should work.
04-26-2013 08:05 PM
Find all posts by this user Quote this message in a reply
treavor09 Offline
Member

Post: #8
RE: Execute code files
THANK YOU!!! now quick question for you how do i find the conversions from 1.0 to 2.0 since most of the tutorials on the wiki are in 1.0 and i would like to use some to aquatint myself also once again thank you.
04-26-2013 08:22 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #9
RE: Execute code files
Personally I never used the tutorials on the wiki.
If you download the 2.0 demo engine, you'll have a project "Tutorials", and all application tutorials can be found inside.
04-26-2013 08:33 PM
Find all posts by this user Quote this message in a reply
treavor09 Offline
Member

Post: #10
RE: Execute code files
all right thanks for all of the help really appreciate it, looking forward to actually knowing something and being able to contribute back

actually sorry one last issue then i should be good when i hit build within the editor no display pops up but when i hit ctrl +f5 the same commands run with vs and work is this intended?
(This post was last modified: 04-26-2013 08:53 PM by treavor09.)
04-26-2013 08:46 PM
Find all posts by this user Quote this message in a reply
Post Reply