61
Technical forum / Re: Interactive Code Problem
« on: June 28, 2015, 12:10:03 PM »
Hi Darryl, welcome to the forum.
Dan Peach has provided one solution below. Indeed, "Remember node states" will make sure that the engine remembers changes you made to nodes in scenes.
Alternatively you can use the scene_init.script to achieve this.
Then, inside the script of the region:
This way, you have the node state inside a global variable. Every time you re-enter the scene, the code in scene_init will run and set Interactive to false. Hope this helps.
Dan Peach has provided one solution below. Indeed, "Remember node states" will make sure that the engine remembers changes you made to nodes in scenes.
Alternatively you can use the scene_init.script to achieve this.
Code: WME Script
- ////////////////////////////////////////////////////////////////////////////////
- // scene state
- global StateScene;
- // default values
- if(StateScene == null)
- {
- StateScene.RegionInteractive = true;
- }
- if(StateScene.LetterHotspotVisible){
- node.Interactive = StateScene.RegionInteractive;
- }
Then, inside the script of the region:
Code: WME Script
- on "LeftClick"
- {
- node.Interactive = false;
- StateScene.RegionInteractive = false;
- }
This way, you have the node state inside a global variable. Every time you re-enter the scene, the code in scene_init will run and set Interactive to false. Hope this helps.