• Hi all,

      I'm struggling with a bit of a problem:  I'm trying to control a User Actor with a Data Array Actor.  It's no problem, except when it comes to the User Actor On/Off.  
    For all other paramenters, I've used a User Actor Input tied directly to a User Actor Output within the User Actor, and then attached those to the inputs and outputs of the Data Array.  When I do this with the On/Off, the User Actor Output is turned off before it can change state.  This of course means that I can't write the proper state to the Data Array.  I've tried building a delay between the User Actor Input and the On/Off, but I don't know how to do that while still being able to turn the User Actor on from the Data Array.  The actors between the User Actor Input and the On/Off are in the off state, and can't pass the message along to turn on.    
    Any thoughts?  I know it's a bit tough to explain, I can post some pics or a simplified example if need be.  Thanks!
  • Tech Staff

    Using the 'User Actor on/off' as a switch can be tricky.

    One thing to know, is that turning it 'on' will cause an EnterScene, so a 'enterscene trigger' actor is a good way to catch that.
    As for turning it off... you want to route the off process thru all other requirements before allowing the 'User Actor on/off' to be set to Off.
    A comparator, is probably the best start to this.. If the value is 1, then trigger a 1 to the 'User Actor on/off'
    If the value is 0, then trigger all your Off state processes (data array etc..), and finally trigger a 0 to the 'User Actor on/off' after all other actions have completed.

  • Thanks for the reply. Comparator is where I started troubleshooting. It works great for all the Off state processes, with a slight trigger delay before sending 0 to the On/Off. However, when I want to turn the User Actor on, all those actors prior to the On/Off are off, so they won't act to turn the User Actor back on. If I connect the User Actor Input directly to the On/Off, the on works great but I can't get the "off" report to the User Actor Output before the actor shuts down. Really, all I need is a way for the User Actor to report the On/Off state to a User Actor Output. I think I could build a workaround if I used 2 User Actor Inputs and 2 User Actor outputs, but I've got a fairly large data array already, and another parameter would be inelegant. Speaking of data arrays, is there a maximum number of items allowed? Also, is it more efficient to use one large data array, or a few smaller ones, or no difference? Just curious. Thanks! O

  • Tech Staff

    True.. I didn't think that thru very well.. sorry.

    I think that perhaps the answer lies in embedding another user actor inside the first, that contains much of the logic, and the on/off.
    This would allow the first level of the user actor to manage the logic of its state.
    But really.. my question is do you need to turn off the user actor?
    Generally you can save a little cpu if its turned off... but unless its processing video.. its not major.
    If there is a section that is cpu heavy.. put it in a sub user actor and turn it off according to the state managed in the top level of the user actor.

  • I'm not certain how large a save it would make on the cpu.  There are two listener actors in the User Actor, with video being broadcast from elsewhere, and this User Actor is iterated 32 times, so I'm really looking to streamline.  I'm trying to build more of a platform than a specific show piece.

    I've added a broadcast channel that broadcasts just a background colour, and defaulted any unused listeners to that channel, and it seemed to help.  Is there a better way to reduce load from an unused listener, from the listener side?
  • Tech Staff

    Stopping the broadcast would probably be most CPU effective.. but really I haven't done any tests on this.

    If you are running many multiples of actors.. it will become important to turn them Off... so I suggest the 2 layer approach to your user actors.. I have used it often in my large systems.

  • Ah ha! I think I've cracked it. All I have to do is have a toggle external to the User Actor. My control will trigger the toggle, which will activate/deactivate the user actor, and also report the on/off state to the data array. Then the data array can trigger the toggle to set the on/off when recalled. Not quite as elegant as I was hoping for, but perfectly functional. Thanks for your time.

  • Tech Staff

    I'm glad you got something worked out.