We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

“When called from JS as [function-name].”

Home Forums General Questions “When called from JS as [function-name].”

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #37323
    Avatarsjors
    Newbie

    Hey guys,

    So I know there used to be a puzzleblock that was called “When called from JS as [function-name], do [something].

    I can no longer find it in the puzzlepieces, is there a different method of how to do the same thing?

    The goal of the method I want to use is to have own html buttons and as soon as I click a button (which will call a function), the material of a certain object will change to the next item in the list.

    Anyone here that know where to find the puzzleblock or an alternative method?

    I added an image to clearify what I’m trying to do. This is a screenshot from a tutorial from Youtube.

    Thanks in advance :)

    Attachments:
    You must be logged in to view attached files.
    #37325
    GlifTekGlifTek
    Licensee

    Hi,
    The easiest approach now to do this is use the exec script puzzle

    To use it more flexibly,
    You can also write your script in a multi line text puzzle

    And set a variable to that, then plug your variable into the exec script puzzle wherever you need it, so you can edit every use of it from one source.

    The call JS puzzles are being deprecated.
    I’m having trouble finding them in the user manual too lol.
    EDIT: they’re right under the exec script puzzle lol.

    Just remember to learn how to transfer your puzzle variables into your script using the VARS keyword.

    :good:

    • This reply was modified 4 days, 11 hours ago by GlifTekGlifTek.
    #37341
    Avatarsjors
    Newbie

    Thanks! The exec script puzzle indeed worked!

    In case anyone else has the same problem in the future, this is my solution:

    • This reply was modified 5 days, 2 hours ago by Avatarsjors.
    Attachments:
    You must be logged in to view attached files.
    #37369
    GlifTekGlifTek
    Licensee

    Nice! :good:

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.