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.

How to reference a Verge 3d varible in a Javascript Code Puzzle

Home Forums General Questions How to reference a Verge 3d varible in a Javascript Code Puzzle

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #77731
    blippypixel
    Customer

    Hi there

    How do you reference a Verge3d variable in Javascript code?
    Thanks!

    #77737

    Hi blippypixel,

    Good question! You cannot access puzzles’ variables directly, by you can use a procedure this way:

    v3d.puzzles.procedures['getVar']('myVar1'); // 'Hello'
    v3d.puzzles.procedures['getVar']('myVar2'); // 'Verge3D'
    
    Attachments:
    You must be logged in to view attached files.

    Chief 3D Verger | LinkedIn | Twitter

    #77741
    blippypixel
    Customer

    Thank you Yuri! :good:

    #77745
    blippypixel
    Customer

    Sorry Yuri. I had a go at this. I’m a bit confused.
    The procedure above – I can’t see how you can add one like your example.
    to getVar with: varname

    I can’t see with: varname in the procedure puzzle.
    Also where is the ‘variable value by name’ please? I know they are colour coded but I can’t find it either. Sorry!

    Maybe it would be useful if Verge had a search function so the user could search for a puzzle by name. Thanks!

    #77763
    blippypixel
    Customer

    Sorry I just saw you had attached the puzzle to this so I will try that. Apologies

    #77764
    blippypixel
    Customer

    Sorry I thought your webp attachment was the code or the project not a screenshot! I am still trying to work this out….

    #77772
    Brameister
    Participant

    Hi there

    How do you reference a Verge3d variable in Javascript code?
    Thanks!

    VARS[‘variableName’]

    Not sure if I understood you correctly, but does that help?

    #77793
    blippypixel
    Customer

    Thank you. It’s kind of you to try to help.
    Is that what you write in Javascript? VARS
    If anyone can point me to the page with the documentation or an example it would be great.
    Sorry I am really struggling with this simple thing!

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