I defined a variable and attempted to output 'Hello World' using the Ruby 'puts' command in here
e.g.
text = "Hello World!"
puts text
But, as expected, nothing happened.
It didn't error it just didn't appear to do anything.
Is it possible to write a simple 'Hello World' script in here that shows something on the screen?
And can you interact with variables and switches etc that you have already defined elsewhere in the Event Commands menu through this script?
If not what is this option intended for?
you can make script calculations for things that are more complex that could be handled by event command, or you can give script commands to scripts that have been intended to handle that (which means they have adapted into the command interpreter).
you can also output to console, just not to the main window. your commands were most probably printed on the console, but the console has to be displayed manually it does not show automatically.
Thanks for the reply.
I've played around with manipulating pictures based on game variable values using these script object.
Looks like you can easily add quite a bit extra to the display with a minimal amount of scripting.
I assume the console you mentioned is pretty much just used for debugging?
if that at all - there are scripts like the backtracer that use the console for advanced error messages, but they have to be installed first.
by default the console is not used at all, despite being available in the editor menu
Use p rather puts
Remember to remove such debug script calls before releasing your game.
When the script call event command is executed the code is evaluated in context of the running interpreter. Useful for all sort of things.
Personally I tended to define my custom methods in the Interpreter class and call those methods in script calls as needed.
*hugs*
- Zeriab
Thanks for the explanation of what the 'Script' event is for. I've used this for some efects that use Switches and variables now. I've also changed the startup, status, load/save, and game over screens by using the main scripts menu, (Window_MenuStatus, Window_SaveFile, Scene_Menu, Scene_Gameover classes). All pretty straightforward.
I did have to try to dig up a lot of old scripts on line and figure out how to do what I wanted from them though. Nothing new for me but there is a noticable lack of resources giving examples of how to do simple things. I couldn't figure out how to add text to the GameOver screen untill I stumbled acress a script that was adding text to a bitmap for example. All simple stuff but hard to find sometimes.
How much better are the newer versions of RPG makes with documentation?
By the way, I'm impresed with Ruby! It reminds me of BASIC and is really intuative to pick up.
E.g. i'd say the IF and CASE statments looks exactly how they should, something that can't be said for some other languages that appear to over complicate for the sake of it!
Well done Ruby!