Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: aleada21 on April 13, 2025, 05:59:48 PM
-
Hi everyone, I hope this place will help with the answer, maybe my question will seem silly. I'm trying to do a quest and I need to do this mechanics: When you click on one of the objects, should activate a point in the same scene, to move to another. I tried to do through if else, for some reason comes out an error, I attach the code below. I hope for your help! I apologize for possible mistakes, my main language is Russian, I write through a translator.
Additionally, is it possible to implement something like a gallery? I see it as a sprite where each frame is a separate photo, when you click on the buttons the frame changes. And also, is it possible to disable fade when switching to another scene? I saw this parameter in ChangeScene, but maybe it is possible to do it globally?
Translated with DeepL.com (free version)
#include "scripts\base.inc"
// here comes the stuff which initializes the scene
global meow;
////////////////////////////////////////////////////////////////////////////////
// scene state
global Statespal1;
{
if(meow == 1) {
Scene.GetNode("meow").Active = true;
}
else {
Scene.GetNode("meow").Active = false;
}
}
// default values
if(Statespal1==null)
{
Statespal1.Visited = false;
// add scene states here
}
////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables
////////////////////////////////////////////////////////////////////////////////
if(!Statespal1.Visited)
{
Statespal1.Visited = true;
// this is our first visit in this scene...
}
Click script:
#include "scripts\base.inc"
on "LeftClick"
{
meow = 1;
Scene.GetNode("meow").Active = true;
Game.Msg("CatActivate!");
}
-
did it
var miu = Scene.GetNode("meow");
miu.Active = false;
It seems to work, but maybe there are other options?
-
Hi aleada21 :)
It seems to work, but maybe there are other options?
What you did seems about right.
is it possible to disable fade when switching to another scene? I saw this parameter in ChangeScene, but maybe it is possible to do it globally?
You could create your own ChangeScene method (ie. a custom method), one that has the parameters FadeOut and FadeIn set to false. For example:
You can read more about the whole process in this section of the documentation:
Custom methods and objects (http://docs.dead-code.org/wme/scripting_about_methods.html).
is it possible to implement something like a gallery? I see it as a sprite where each frame is a separate photo, when you click on the buttons the frame changes
I'd say that the answer is yes. You can arrange images in a certain way and then trigger a change by clicking on a button. If you check out the wme demo project (also known as wme_demo.wpr), specifically the folder named interface, you will find examples of changes triggered by clicking on buttons.
-
Thank you!!!