Results 1 to 5 of 5

Thread: Buttons attached to zones

  1. #1

    Buttons attached to zones

    Since the update all my buttons are messed up that are attached to zones.. I cant seem to work out the new system


    This is the code for one of the buttons:

    local savezone = getObjectFromGUID("902650")
                click_function='retreiveChest', label='Retreive Chest', function_owner=self,
                position={-0.4, -0.46, 0}, rotation={0,180,0}, width=150, height=100, font_size=30

    The buttons are more circular, the text is blurry.. It will be a pain to add all the buttons to an object, so anyone got a suggestion. How do the paramaters for width / height and postion work now?

  2. #2
    I have the same issue:

    My solution:
    a) wait if there will be a hotfix
    b) spawn a dummy object underneath the table and attach buttons to that instead

  3. #3
    Join Date
    May 2016
    Also having the same problem. A possible solution I had was posted as a suggestion in the scripting suggestions just last night.

    I get that the way it worked before was technically wrong, but the way it works now is functionally useless lol

  4. #4
    Join Date
    Sep 2016
    TIL you can create buttons on scripting zones. What else haven't you people told me?

  5. #5
    Join Date
    Sep 2016
    For those who are just trying to create a button in an arbitrary position, this wrapper might be helpful

    --creates a button at the given position, dimensions, scale, and rotation
    function createArbitraryButton(params)
        local objectParams = {}
        objectParams.type = "ScriptingTrigger"
        objectParams.position = params.position
        objectParams.scale = params.scale
        local zoneObj = spawnObject(objectParams)
        buttonParams = {}
        buttonParams.position = {0, 0, 0}
        buttonParams.rotation = params.rotation
        buttonParams.width = params.width
        buttonParams.height = params.height
        buttonParams.index = 1
        buttonParams.label = params.label
        buttonParams.font_size = params.font_size
        buttonParams.click_function = params.click_function
    It's the same parameters as createButton, except instead of supplying an object, just add position to the params. Can also add scale as well. Only thing you need to do is keep track of the zoneObj and delete it when you want to get rid of the button.

Similar Threads

  1. Events for objects with multiple states attached
    By Korroz in forum Scripting Suggestions
    Replies: 2
    Last Post: 01-16-2017, 02:13 PM
  2. [ADDED] Get current state from an object with multiple states attached
    By Korroz in forum Scripting Suggestions
    Replies: 1
    Last Post: 01-15-2017, 03:24 PM
  3. Replies: 3
    Last Post: 07-23-2016, 08:17 AM
  4. Can you have 3D UI buttons with images?
    By SuperAwesome in forum Scripting
    Replies: 4
    Last Post: 05-10-2016, 03:02 PM
  5. Buttons in Hidden Zones not hidden
    By Arcuate in forum Scripting
    Replies: 1
    Last Post: 03-08-2016, 02:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts