EDIT: There is nothing wrong in my code... The problem I actually encountered is explained in my second reply.
-----------------------------------------------------------------------------------------------------
Original question (when I thought that the problem was on my script code):
-----------------------------------------------------------------------------------------------------
Hi. I'm trying to learning how to script with a direct approach ('try, debug, fix').
I started pasting this script code in the script editor ("Materials" directory):
I created a "key press" event in my map, and I added those 3 script commands
When I try to talk to my event, it displays, as expected two messages:
1) nil
2) "test"
But, after that, the game freezes like the event was still running (you cannot control your character nor you can access to menu using ESC).
I also tryed to add a "text" command after the last debug() script call... well the message is displayed, but the game freezes the same (the message stay displayed and you cannot gain back controls).
Any idea why I am encountering this problem?
EDIT: I saw I posted in the wrong section... (it is a 'learning ruby on vx ace' question)... very sorry (a mod is welcomed to move this topic)... sorry again
-----------------------------------------------------------------------------------------------------
Original question (when I thought that the problem was on my script code):
-----------------------------------------------------------------------------------------------------
Hi. I'm trying to learning how to script with a direct approach ('try, debug, fix').
I started pasting this script code in the script editor ("Materials" directory):
module Unqou; module Translator
dictionary = nil
# todo
def self.initialize()
@dictionary="test"
end
def self.debug()
msgbox_p( @dictionary )
end
end; end # end of Unqou::Translator
dictionary = nil
# todo
def self.initialize()
@dictionary="test"
end
def self.debug()
msgbox_p( @dictionary )
end
end; end # end of Unqou::Translator
I created a "key press" event in my map, and I added those 3 script commands
@>Script: Unqou::Translator::debug()
@>Script: Unqou::Translator::initialize()
@>Script: Unqou::Translator::debug()
@>Script: Unqou::Translator::initialize()
@>Script: Unqou::Translator::debug()
When I try to talk to my event, it displays, as expected two messages:
1) nil
2) "test"
But, after that, the game freezes like the event was still running (you cannot control your character nor you can access to menu using ESC).
I also tryed to add a "text" command after the last debug() script call... well the message is displayed, but the game freezes the same (the message stay displayed and you cannot gain back controls).
Any idea why I am encountering this problem?
EDIT: I saw I posted in the wrong section... (it is a 'learning ruby on vx ace' question)... very sorry (a mod is welcomed to move this topic)... sorry again