Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Custom attributes  (Read 683 times)

0 Members and 1 Guest are viewing this topic.

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 182
    • View Profile
Custom attributes
« on: March 12, 2016, 08:17:20 PM »

I have added a number of custom attributes to Scene Nodes. The value of these nodes is changed programatically during play. This works. However if I change scene and return then the original values are reset.

The remember nodes checkbox is true, and I have added a line of code to set the PersistentState of the scene to true right before the changescene statement.

Any ideas ?
Logged

valter.home

  • Supporter
  • Occasional poster
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 55
    • View Profile
Re: Custom attributes
« Reply #1 on: March 13, 2016, 02:18:50 PM »

Hello eborr,
I too had the same problem and I thought that it was a non-modifiable behavior set programmatically.
In my case it was a region where the character was walking with a particular sound of footsteps.
Later it rains and the sound of footsteps changes.
Changing scene and coming back in it the sound of footsteps was reset.
I solved by creating a global variable as myScene.wet and I initialize it to true when I change the sound.
Then back in the scene I check in scene_init.script if the variable is true and in this case I change the sound again.
Having to check only one region this system to me is fine, I don't know if you have to manage many more nodes / regions.
Logged

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 182
    • View Profile
Re: Custom attributes
« Reply #2 on: March 14, 2016, 02:00:38 PM »

Yes creating globals is the obvious solution, but the issue with that is the process I want to achieve will involve something which will occur on most scenes and with a variable number of nodes. I dont want to handcraft the process for each scene, nor is it a desirable situatuion to creare and manage what will eventually turn out to be a large number of globals. I think I have worked through a logical solution to the problem, which in theory should work in WME. It will involve the creation of a single complex global object
Logged
 

Page created in 0.145 seconds with 17 queries.