Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Custom Properties  (Read 3580 times)

0 Members and 1 Guest are viewing this topic.

Castler

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 15
    • View Profile
    • Limbo of the Lost
Custom Properties
« on: December 13, 2004, 07:01:47 PM »

Hey, guys. Can someone give me a good explanation of how custom properties work? For instance, if in the SceneEdit I add a custom property to the scene, "dark", set to "true", how can I then access that property in the script? Also, is there an easy way I could make all scenes in the project have this property?

Thanks

C
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Custom Properties
« Reply #1 on: December 13, 2004, 07:53:40 PM »

Hey, guys. Can someone give me a good explanation of how custom properties work? For instance, if in the SceneEdit I add a custom property to the scene, "dark", set to "true", how can I then access that property in the script?
It would be equivalent to script command Scene.dark.

Also, is there an easy way I could make all scenes in the project have this property?
You could create a custom scene template which would already contain the property. That way everytime you'd add a new scene in ProjectMan, it would have the property ready.
Templates are stored in WME directory in the "template" subdirectory. They need to be edited by hand, thoough. You can copy an existing template and add the property definition to the .scene file.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Castler

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 15
    • View Profile
    • Limbo of the Lost
Re: Custom Properties
« Reply #2 on: December 13, 2004, 08:09:47 PM »

That's great. What about scenes that already exist? I notice that for a window you can specify another window to use as the template, which I guess is like a parent class. Is there any similar ability for scenes?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Custom Properties
« Reply #3 on: December 13, 2004, 09:10:23 PM »

That's great. What about scenes that already exist? I notice that for a window you can specify another window to use as the template, which I guess is like a parent class. Is there any similar ability for scenes?
In theory it's possible, but it's not supported by SceneEdit. Templates were meant to make hand-editing easier, which is no longer necessary for scenes. You'd have to add the property to the existing scenes individually.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Castler

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 15
    • View Profile
    • Limbo of the Lost
Re: Custom Properties
« Reply #4 on: December 13, 2004, 09:28:35 PM »

Thanks Mnemonic. I think I'm going to stick with the following technique (note, this is not the real code, just an example): If I want a room to be dark, I will just attach a script to the scene that will perform the necessary calls, called dark.script or something. It seems to be the easiest way.

C
Logged
 

Page created in 0.029 seconds with 20 queries.