ShiVa3D: Command Console
A simple but practical utility that works like a command console inside the ShiVa3D game engine’s editor.
You can type StoneScript commands or code snippets in the Script Editor module and have them executed right away while running your application. There is no need to stop and restart your game, no waiting for your scene to load, get over the menus, etc.
Essentially, this is a button whose function is dynamically redefined using the Script Editor. That is why it is written in such a way that in an exported game/application nothing of it will appear. This is a developer’s toy, strictly for the Script Editor, outside it would be just a blunt button with a fixed function.
There is also an option to specify a variable which will be shown on the screen and it’s value updated every frame – but only if you need it.
1. download and import the ste into your current project
2. drag and drop the “CommandConsole” AIModel into the Game/Main/User Main AIs section
3. drag and drop “HUD_CommandConsole” HUD into Game/Resources
4. open “CommandConsole/onInit” to customize the script
5. open the “TrackVariable” state to set up variable tracking
6. open and keep open the “ConsoleCommand” function to write short commands
7. press F7 to check and compile your command
8. press the “Do it!” button in your running game to execute your command.
9. write a new command in the “ConsoleCommand” function
10. go to step 7.
All in all, examine the CommandConsole AIModel, there are some easy to follow instructions inside each script. The “Command_Console_Demo” sample application has everything set up to work, please review it if you run into trouble.
This code is open source, so anyone may take it to the next level. It is commented all through, some may find it useful for learning basic programming, too.
If you detach the Script Editor module, you can have it hover over the Scene Viewer, just like a true command console window.
This is beta version, so healthy caution advised: make backups of your projects if you choose to try this with them.
You can download the ShiVa3D archive (ste) and use it freely for either commercial or non-commercial purpose.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Do you find this script useful? If yes, please share how it helped improve your workflow.