I've been working with WME for a few days, trying to put together a simple RPG to teach myself how to work the scripting. So far I've been able to solve all of the problems I've run into with WME's awesome debugging help. In this case, though, the engine tells me to check the log for runtime error details but I can't locate the details in any of the logs.
I suspect I may have caused a problem by copying the project I was working on and pasting it under a new name in the projects folder. I thought I had fixed all of the paths so that they pointed to the new location, but I likely missed something.
the relevant code is as follows:
I have a window called GenderButtons.window that contains two buttons, Male and Female. It's supposed to be a character generation sort of screen, where pressing the buttons changes the avatar portrait above.
GenderButtons.script reads:
#include "scripts\base.inc"
#include "scripts\keys.inc"
////////////////////////////////////////////////////////////////////////////////
on "Male"
{
//I set up messages to let me know if it was registering the clicks, in the event that SetImage didn't work for some reason
}
////////////////////////////////////////////////////////////////////////////////
on "Female"
{
Portrait.
SetImage("sprites\female.png");
}
////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
//In the event that keys are pressed, focus on the window containing the editor
}
QuestionDisplay is the window containing Portrait, and both are defined in game.script as follows:
#include "scripts\base.inc"
#include "scripts\keys.inc"
// store some of the game's attributes in global variables for convenience
QuestionDisplay =
Game.
LoadWindow("interface\questiondisplay.window");
Portrait = QuestionDisplay.
GetControl("Portrait");
Both windows and the portrait are declared in base.inc:
#include "scripts\const.inc"
global actor;
global QuestionDisplay;
global GenderButtons;
global Portrait;
When I left click the buttons Male and Female, the Game.Msg plays correctly and I get a script runtime error from the system, but then I can't find any logs with entries from that time.
It's also worth noting that I had originally tried to just fudge the "buttons" as region entities in Room.Scene, but I could never get that to work, either. It makes me think that possibly my copy/paste job created a LeftClick problem. Just in case, I'm including that portion of the game.script.
on "LeftClick"
{
// what did we click?
if(ActObj!=null)
{// just a simple click
}
// else propagate the LeftClick event to a scene
else
{
}
}
I have also run the compiler and no errors come up. Any help would be greatly appreciated.