Relations between objects and configuration

edited August 2015 in Help request
Hi everyone,

I have few questions about relation between objects(orxGRAPHIC, orxANIMATION, orxOBJECT, etc...) and the configuration sections.

1-How do I get the section that was used to create an object instance?

2-Let's assume I have section1 and [email protected] and I use orxXXXX_CreateFromConfig(section2)...how do I know what's the parent of section2?

3-from example in question 2, if I programmatically update section1 is there a way to reflect modification to runtime objects created from section2?

For now, thank you in advance.

Comments

  • edited August 2015
    ainvar wrote:
    Hi everyone,

    Hi!
    I have few questions about relation between objects(orxGRAPHIC, orxANIMATION, orxOBJECT, etc...) and the configuration sections.

    To avoid any confusion, we usually call them structures and use the term object only for orxOBJECTs.
    1-How do I get the section that was used to create an object instance?

    Look for the *_GetName() functions (orxObject_GetName(), orxCamera_GetName()).
    2-Let's assume I have section1 and [email protected] and I use orxXXXX_CreateFromConfig(section2)...how do I know what's the parent of section2?

    Try orxConfig_GetParent().
    3-from example in question 2, if I programmatically update section1 is there a way to reflect modification to runtime objects created from section2?

    If the config has been modified (no matter how, programmatically or with file loads), current instances won't get affected, only new ones will reflect the changes.

    There's one exception to that rule, an it's only in development mode when the resource watchlist is activated. In this case, when hot reload happens, some structures such as spawners, sounds, textures, will update immediately after the reload has happened. Here's the original thread about hot reload.
  • edited August 2015
    Thank you for the fast response!
Sign In or Register to comment.