Results 1 to 7 of 7

Thread: More precise rotation without using the Rotator tool?

  1. #1

    More precise rotation without using the Rotator tool?

    There are a couple of spinners that I'd like to recreate, but the count on them needs to go up to at least 28, ideally 40 for proper accuracy. The problem is that I would need to rotate the dials at 12 or 9 degree segments respectively to do so. While I understand that other players can be promoted to use the rotate tool, everybody being promoted is not always a viable answer for some games. Would it be possible to get some more precise rotation levels under 15 degrees?

  2. #2
    This is more of a "let not promoted players use Gizmos" suggestion. If you want to do that for now, there are some scripted tools that let you set any rotation.

  3. #3
    An alternative to scripting. . . or perhaps best in combination with it, is to make an animated version of it using the Effects script in unity. it Would avoid the need to deal with jointing objects together on the table, which is always a bit of a pain. especially if you need to scaling them after the fact.

  4. #4
    It's very easy to do with scripting. You want to attach the following script to whatever part of the dial is not spinning:

    Code:
    objectID = "43322d"
    rotationAmount = 12
    
    function onLoad()
        self.createButton({
            click_function="rotateCW", function_owner=self, label = "->",
            position={-0.4,0.5,0}, rotation={0,0,0}, scale={1,1,1}, 
            width=100, height=100, color=(1,1,1,1),
            font_size=70, font_color={0,0,0,1}
        })
        self.createButton({
            click_function="rotateCCW", function_owner=self, label = "<-",
            position={0.4,0.5,0}, rotation={0,0,0}, scale={1,1,1}, 
            width=100, height=100, color=(1,1,1,1),
            font_size=70, font_color={0,0,0,1}
        })
    end
    
    function rotateCW()
        getObjectFromGUID(objectID).rotate({0,rotationAmount,0})
    end
    
    function rotateCCW()
        getObjectFromGUID(objectID).rotate({0,0-rotationAmount,0})
    end
    The objectID is the GUID you get by right clicking an object (under scripting). Change the number here with the one of the part you want to spin. And then tweak the numbers for the position, rotation, scale, color, etc of the button. Also the number of how much you want the object to rotate is at the top.

    And that's it

  5. #5
    Quote Originally Posted by Unreal_Ed View Post
    It's very easy to do with scripting. You want to attach the following script to whatever part of the dial is not spinning:

    Code:
    objectID = "43322d"
    rotationAmount = 12
    
    function onLoad()
        self.createButton({
            click_function="rotateCW", function_owner=self, label = "->",
            position={-0.4,0.5,0}, rotation={0,0,0}, scale={1,1,1}, 
            width=100, height=100, color=(1,1,1,1),
            font_size=70, font_color={0,0,0,1}
        })
        self.createButton({
            click_function="rotateCCW", function_owner=self, label = "<-",
            position={0.4,0.5,0}, rotation={0,0,0}, scale={1,1,1}, 
            width=100, height=100, color=(1,1,1,1),
            font_size=70, font_color={0,0,0,1}
        })
    end
    
    function rotateCW()
        getObjectFromGUID(objectID).rotate({0,rotationAmount,0})
    end
    
    function rotateCCW()
        getObjectFromGUID(objectID).rotate({0,0-rotationAmount,0})
    end
    The objectID is the GUID you get by right clicking an object (under scripting). Change the number here with the one of the part you want to spin. And then tweak the numbers for the position, rotation, scale, color, etc of the button. Also the number of how much you want the object to rotate is at the top.

    And that's it
    Okay, this is really neat. Will this only work with a single-dial thing though? How would I adapt this for two different dials on the same object? (Kinda like King of Tokyo's dial.) Would it be as simple as duplicating the objectID portion, using a different variable name, and then using the same button code for the other dial?

    EDIT: Reading a little closer, it looks like I would just duplicate the entire code, but just use a different variable for the other dial, and different function names to prevent conflict? (I can follow a little code, but I'm not great, so if I'm wrong just let me know. ^_^)
    Last edited by MarcusRaven; 06-22-2017 at 08:50 AM.

  6. #6
    Btw, even for something as simple as this i highly recommend the [URL="http://berserk-games.com/knowledgebase/atom-editor-plugin/"]Atom editor[/URL]. But if that confuses you, the in-game editor is fine

  7. #7
    As someone interested in mass battle miniatures games, I would also like to see the rotation settable to less than 15 degrees, 5 or even 1 degree.

    rotate.jpg

    Yes, you can script a took but everything snaps back to the nearest 15-degree implement of a player picks up an object or group of objects and moves it without using a scripted tool.

    Here is an example, a small formation of miniatures on bases rotated to an "odd" angle using a scripting move meant tool.

    RotateExampleBeforeScreenshot 2020-12-30 161724.jpg

    But then after a player picks them up and puts them down, all the bases snap back to the nearest increment of 15 degrees and are now all askew.

    RotateExampleAfter.jpg

Similar Threads

  1. All Pixel & Vector Paint Suggestions (Merged)
    By TheRaven81 in forum Suggestions
    Replies: 19
    Last Post: 08-08-2018, 12:57 AM
  2. Precise Sizing of Counters and Cards
    By CounterFactorian in forum Suggestions
    Replies: 1
    Last Post: 10-01-2016, 01:30 AM
  3. [SUGGESTION] Object rotation
    By Karl in forum The Captain Is Dead
    Replies: 3
    Last Post: 08-28-2016, 10:00 PM
  4. [SOLVED] Rotation degree tool randomly changing value?
    By MundS93 in forum Technical Support
    Replies: 1
    Last Post: 08-09-2016, 02:29 PM
  5. Object rotation
    By NewfieNewbie in forum Suggestions
    Replies: 0
    Last Post: 09-19-2015, 03:15 AM

Posting Permissions

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