Average User Rating
Not rated

Description

The script in this product is no different from the free version. You can buy it if you want to remove the restriction on downloads of free items for this script.

GG Developer Console is an in-game console designed to simplify the
creation and debugging of levels in Game Guru.
The console has different types of messages highlighting, autocomplete
function and input history.

You can easily output messages to the console directly from your scripts 
using the quick output methods:

Console.Log (message)
Console.LogError (message)
Console.LogWarning (message)


Also, you can easily add a command to the console right in your script.
To do this, you need a function that will represent the logical actions of the
command.
Such functions are created according to the following rules:
  • It takes an array of arguments as input.
  • Returns an object of type ConsoleOutput (see below).

function myConsoleCommandFunction (args)
doMagic (args [1])
return Console.Output.ConsoleOutput ("Magic happened",
Console.Output.OutputTypes.Log)
end

To create a command with your function, you need to create 
an object of the Command type, for this you should use the method
Console.Commands.Command (logic, name, description)

Where:
  • logic - the command function you created.
  • name - the name of the command. What you need to enter in the console to invoke the command. All command names are not case sensitive.
  • description - the description of the command. Will be displayed in the output of help.

Then you need to add the command to the console using the method
Console.Commands.Add (command)


Where: 
  • command is the Command object you created.

This can be done anywhere in the script, for example, in init.

function myScript_init (e)
Console.Commands.Add (Console.Commands.Command(myConsoleCommandFunction,
"myconsolefunction", "My function"))
end

In general, after creating the command, your script should look like this:

function myConsoleCommandFunction (args)
doMagic (args [1])
return Console.Output.ConsoleOutput ("Magic happened",
Console.Output.OutputTypes.Log)
end

function myScript_init (e)
    Console.Commands.Add (Console.Commands.Command(myConsoleCommandFunction,
"myconsolefunction", "My function"))
end

function myScript_main (e)
 doSomething ()
end

You can create a command named "?" to determine actions in case of 
receipt of an unknown command.

You can also invoke an existing command programmatically if you need it 
(for example, if one command needs to execute another)
This can be done using the method
Console.Commands.Execute (command)

Where:
  • command - a string with the name and arguments of the command (as it should be entered in the console).

Console.Commands.Execute ("myconsolefunction arg1")


The ConsoleOutput object is a record of the console output.
To create a ConsoleOutput object, you must use the method
Console.Output.ConsoleOutput (str, outputType, systemType)

Where:
  • str is the string to be displayed on output.
  • outputTypes - the type of output. Object enum Console.Output.OutputTypes (see below)
  • systemType is an optional parameter that specifies whether to add the system creation time of the object to the string. The default is true.

The Console.Output.OutputTypes enumeration contains the console 
message types. Console.Output.OutputTypes includes:
  • Console.Output.OutputTypes.Log = 1
  • Console.Output.OutputTypes.Warning = 2
  • Console.Output.OutputTypes.Error = 3
  • Console.Output.OutputTypes.System = 4
  • Console.Output.OutputTypes.User = 5

        You can replace item names with matched digits in your scripts if you find it 
        more convenient.

        To add console to a level, place any entity on it. Change the properties of 
        this entity:
        • StaticMode on No
        • AlwaysActive on Yes
        • Main on stv233 \ console \ gameguru_console.lua

        Console Control Keys:
        • ~ - show / hide the console (Can be changed in the gamegur_console.lua settings).
        • Tab \ LShift - add the command to the suggested autocomplete (since in the GameGuru editor the Tab key is the control key, you can use LShift).
        • ↑ \ ↓ - switch by input history.
        • ← \ → - move the cursor along the input field.
        • Page up \ Page down - scroll the console output field.

        Keywords

        Product Details

        Artist: Stv233
        Category: GameGuru Scripts
        Sub Category: Misc
        Sales: 4

        Engine Support

        GameGuru Classic Yes

        File Formats

        LUA .lua

        Comments

        No comments yet

        You must Login or Register to leave comments.

        Related Products