HOW TO : Access the console in game ??

Post Reply
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

HOW TO : Access the console in game ??

Post by ezee »

Hi .
//****************
24 //Console Rendering System by Rogue
25 //2005-08-a-few-days
26 //
27 //****************
That console feature seems to be implemented , but there is no information about it .
see -> http://spacetechs.free.fr/VEGASTRIKEDEV ... ource.html

How can we invoke the console actually ?
With http://spacetechs.free.fr/VEGASTRIKEDEV ... _keys.html ?

Shall i code a keyboard key binding to the function ?

The console will greatly help the debug process , and i need it to test my AIML bot in game.
Please help !
:?:

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
TBeholder
Elite Venturer
Elite Venturer
Posts: 752
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: HOW TO : Access the console in game ??

Post by TBeholder »

The command is already coded.
commandMap["ConsoleKeys::BringConsole"] = ConsoleKeys::BringConsole;
And bound.

Code: Select all

    <bind key="function-1" modifier="ctrl" command="ConsoleKeys::BringConsole"/>
The console itself is not quite implemented and mostly commented out.

edit: fixed links
Last edited by TBeholder on Mon Feb 24, 2014 2:04 am, edited 1 time in total.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: HOW TO : Access the console in game ??

Post by ezee »

Hi .

The links you provided report an error 404 .
But thank you for this help , i will dig that .
:wink:

But hey , how do u use it ?
Can you give me an example from your code ?

Edit : I've found something strange , duno if it's directly in relation nor how it affect the engine but ...

Code: Select all

//Register commands
    //COmmand Interpretor Seems to break VC8, so I'm leaving disabled for now - Patrick, Dec 24
    if ( game_options.command_interpretor ) {
        CommandInterpretor = new commandI;
        InitShipCommands();
    }
It's in the main.cpp , line 339 :
http://spacetechs.free.fr/VEGASTRIKEDEV ... tml#l00241
I have tested the value with breakpoint , yeah it's false !
So that part of code is there but do nothing .
:?

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
TBeholder
Elite Venturer
Elite Venturer
Posts: 752
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: HOW TO : Access the console in game ??

Post by TBeholder »

It's a pre-parsed confvar, as obvious from the name.
In the older code r13333 src/main.cpp, line 339:

Code: Select all

//COmmand Interpretor Seems to break VC8, so I'm leaving disabled for now - Patrick, Dec 24
if ( XMLSupport::parse_bool( vs_config->getVariable( "general", "command_interpretor", "false" ) ) ) {
CommandInterpretor = new commandI;
InitShipCommands();
}
It was moved to src/options.cpp, line 24: "= XMLSupport::parse_bool( vs_config->getVariable( "general", "command_interpretor", "false" ) );"
In vegastrike.config it's omitted, thus falling back to "false". So, set it to "true" and see what happens. Not a lot, really, but at least it will intercept input and exit on "Escape".
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: HOW TO : Access the console in game ??

Post by ezee »

It was moved to src/options.cpp, line 24: "= XMLSupport::parse_bool( vs_config->getVariable( "general", "command_interpretor", "false" ) );"
In vegastrike.config it's omitted, thus falling back to "false". So, set it to "true" and see what happens. Not a lot, really, but at least it will intercept input and exit on "Escape".
ok , thank you .
i will try the "true" version , just to see what happens .

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
Post Reply