Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / How to Make a Console for a Game

Author
Message
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 5th Mar 2011 15:59
Hey guys.

I was thinking about making a "console" for my games.

What this is:

Well if i press Ctrl + P or something a console opens and then in it there are some pre-commands that change somethings in the game.

Is it possible to make with dark GDK?
If yes please say me how to start =D

Learning C++
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 6th Mar 2011 08:59 Edited at: 6th Mar 2011 09:09

S3GE Console: Creating a Sphere on the fly.

There are many ways you could go about it. I'll tell you how I do it. S3GE uses LUA for all scripting
and a home-grown GUI System which uses a Markup Language (S3GXL) to create Gizmos such as a Textboxes, Buttons, etc:
.

LUA features a fast interpreter for on the fly execution ideal for a console. You'll have to write glue code to bind LUA to your C++ code, then use a GUI to load and execute LUA text.


I've had to bind 1000s of functions. The current console is very rudimentary, but, at least uses a GUI. There is a little work involved and I'm certain the snippets of code may not make much sense alone. S3GE source is freely available via SVN.

vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 6th Mar 2011 11:03
hum nice idea and that what i want. but cant i make like a console app that can change things inside game?


If no, how can i make exactly that console.

Learning C++
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 6th Mar 2011 12:44 Edited at: 6th Mar 2011 12:54
Quote: "console app that can change things inside game?"
Its a console app built into the game engine. If you desire to use a separate application then you would practically use the same technique with the addition of working out communications from the console app to the engine. I could make an attempt to provide additional help if you provide a reference to what type of Console your trying to develop.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 6th Mar 2011 23:22
Have you not tried adding a dialog to your app? Using resedit you can make a dialog something like the ones Visual Studio does. Although VS Express won't let you edit resource files, using resedit to create a dialog is simple enough. Just adding a few extra bits to display what you need and you have your console there, with added buttons and stuff.

I've done some coding with dialogs, and I could see how adding a console like widget using a text box would be so easy.

It's something else to think about because dialogs are useful.

However...

http://justcheckingonall.wordpress.com/2008/08/29/console-window-win32-app/
and
http://comsci.liu.edu/~murali/win32gui/Win32Apps.htm

Show how to activate the console window and setup the standard io for use with printf, etc...

Warning! May contain Nuts!
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 8th Mar 2011 22:28
thanks for the answers =D

@techlord
just a simple thing xD, but the codes were not formal..
i was thinking making things like: spawn [ID] then it spawns the sprite with that ID into the game...

simple things like that do you see? xD

Learning C++
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 9th Mar 2011 13:31 Edited at: 9th Mar 2011 13:46
Quote: "just a simple thing xD, but the codes were not formal..
i was thinking making things like: spawn [ID] then it spawns the sprite with that ID into the game..."
Thats exactly what my console does and with the power and simplicity of LUA's Syntax. I'm lazy, so I decided to use the Scripting System's Interpreter (LUA). You would too after trying to write one yourself.

However, if you dont desire to use a 3rd party Interpreter, you're going to have to write your own. Obviously, Interpreters can be simple or complex. More features, more complex. You could write a simple interpreter with the STL string class. It has all the String operations you need to parse text. Before you start writting a single line of code, you still need to figure out the Syntax for the commands you want use first
or
. This will determine how complex the Interpreter will need to be.

vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 9th Mar 2011 15:05
well, thjanks for all the answers

i think i will make a if pressed a key > spawn a enemie..

how can i check all the dbCommands for keys?

Learning C++
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 10th Mar 2011 07:14 Edited at: 10th Mar 2011 16:06
Quote: "i think i will make a if pressed a key > spawn a enemie..

how can i check all the dbCommands for keys?

"

Pressing a key > spawn a enemie should be relatively easy for you to code using the input commands.


I offered suggestions on How to Make a Console for a Game. No matter what direction you go in, you're going to have to write code specific for your game. Good Luck to you.

vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 10th Mar 2011 18:55
thanks man


just wnna know for what its that commands?



Learning C++
VB6 Advanced: 4/5
VB.NET Advanced: 4/5

Login to post a reply

Server time is: 2024-10-02 15:28:11
Your offset time is: 2024-10-02 15:28:11