1
Technical forum / Re: Window static objects
« on: December 02, 2008, 03:58:39 PM »
But I appreciate you trying to help.
var ShowInfo = Game.LoadWindow("interface\system\InfoWin.window");
var InfoImage = ShowInfo.GetControl("ImageDisplay");
InfoImage.Image = "interface\Info_Stuff\Info_test.png";
var InfoText = ShowInfo.GetControl("TextDisplay");
InfoText.Text = "This is a test of the info window text.";
ShowInfo.Center();
ShowInfo.GoSystemExclusive();
Game.UnloadObject(ShowInfo);
Actually, it's a bit more complex than that as I'm not only switching the animation set for the main character, but also switching between characters as the one the player controls.Presumably, then, it's best to assign these variables, Tom and Bill, inside the event handlers?That would work. Or, since I assume 'Tom' is your main character, you could use a global variable for him and only refresh the variable after reloading the actor. Then all the other scripts using this global variable will get the right actor reference automatically.
Yup, that's it. The 'Tom' variable still references the original actor, which gets invalidated. You'd need to refresh the reference after reloading a different actor by re-assigning Tom (Tom = actor;)This is the point where I get completely confused and probably why I'll never be a programmer... I'm clearly understanding this wrongly because I thought that as it was a variable local to a script that isn't yet triggered it wouldn't be affected that way. What am I missing?
could you post relevant parts of the scripts?
You will need to create two actor files and simply unload the old actor and load a new one (the actors can share the same script - i.e. the "brain").Code: WME Script
// unload the original actor // and load a new one // this is necessary to transfer the scene scrolling to the new actor Game.MainObject = actor;