Forum Discussion

AndrewBlemings-'s avatar
AndrewBlemings-
Community Member
10 days ago
Solved

Controlling Illustrated Characters via JS?

I haven't had much professional call to use the illustrated characters much, but I do appreciate them, especially after learning about the expressions, poses, and perspectives that can all be LEGO'd ...
  • Nathan_Hilliard's avatar
    10 days ago

    You can use the object().state property to set slide objects to either the "Normal" state or a custom state. When you add characters to the slide, they adopt the Normal state and whatever pose/expression you selected is assigned to that state. Under the States tab, you can edit and add additional states for a slide object. You can select the character state you desire from the list of possible states, and add that to the state list. The names will match the list, so something like "Surprised", or "Disappointed", etc.

    When adjusting states in JavaScript, use Normal to set the normal state, or use one of the custom state names you added (matching the case of the name). You have to explicitly add the state to the list for it to be available from JavaScript.

    Note: When testing from the developer panel, if an invalid state was assigned to the object, for example object("####").state = "Default", then all later state assignments also failed, even if correct. I don't know if this issue persists within Storyline project triggers, but it may be a bug and should be kept in mind. If you accidentally assign an invalid state via JavaScript, then they may stop working altogether.

    Also, you can assign a Disabled or _disabled state, but I'm not sure what that does since it does not actually become disabled. You can also assign a Hidden state, but if you do you can't unassign it via JavaScript. It just stays hidden.