Accessing member from another stage

(4 posts) (2 voices)
  • Started 9 months ago by mariustreu
  • Latest reply from NKL_DS

Tags:

  1. mariustreu

    enthusiast
    Joined: May '13
    Posts: 53

    Hi,

    my Problem is that I have two stages called: "GUI" and "Machine" with some actors attached to each ofc.

    What I'm trying to do is to manipulate one membervariable of an actors VSL-Script in "GUI" while I'm in an actors VSL-Script from "Machine".

    How can I access any other stages actor?

    I know the function GetStage() but this is retrieves the current stages. What I'm searching for is some kind of GetStageByResourceID() or GetStageByName() or GetPermanentStage() or GetRoot()

    Best regards,
    Marius

    Posted 9 months ago #
  2. NKL_DS

    3DVIA Studio Guru
    Joined: Jan '10
    Posts: 38

    Hello Mariustreu,
    If your stages and actors are not dynamically loaded, you can add a member (m_Actor, type vkActorPtr) in your behavior of the actor of the "Machine" stage. Then, set as value the other actor, of the "GUI" stage.
    So you will be able in your VSL code to modify all the members of the other actor:
    if(m_Actor != NULL)
    {
    BehavPtr myBeh = m_Actor; // "Behav" is the name of the behavior of the GUI actor.
    if(myBeh != NULL)
    {
    myBeh.m_Member = "TOTO"; // m_Member is a member of the behavior "Behav"
    etc...
    }
    }

    You can too, directly set the behavior as member (type BehavPtr)
    I hope i'm quiet clear and that my answer could help you.

    NKL.

    Posted 9 months ago #
  3. mariustreu

    enthusiast
    Joined: May '13
    Posts: 53

    This sounds useful but where do I see / can I set the value of an actor?
    Thanks for the quick response!

    Posted 9 months ago #
  4. NKL_DS

    3DVIA Studio Guru
    Joined: Jan '10
    Posts: 38

    You can set it in the "Assemble" sheet, in the property view of your actor.

    Attachments

    1. Sans_titre.jpg (115.8 KB, 10 downloads) 9 months old
    WARNING: Files uploaded in the forums are not monitored by 3DVIA and therefore might contain content that is malicious or offensive. Download at your own risk
    Posted 9 months ago #

Reply

You must log in to post.