FAQ  •  Register  •  Login

NoTranslateScaler

<<

tazinator

Posts: 351

Joined: Fri Jul 05, 2013 7:35 pm

Post Tue Mar 11, 2014 9:31 pm

NoTranslateScaler

WARNING: TOOL MAY CRASH!!!


This plugin makes things bigger along the X and Y axes WITHOUT moving them (translate is the geometry term). It has a simple table where you plugin your # for the x axis, and the y axis. You can use it to stretch objects if you like.


A version which does translate objects will be in the works eventually, as that has it's own usefulness.
In my thoughts is a version which considers scaling with a skew factor (like angles). but that is beyond me at this time. Enjoy!

  Code:
-- Scale Tool for X plane
-- Authored by Thomas of Hilo
-- Based on works by Kaen, raptor, Watusimoto
 
function getArgsMenu()
 
menu =  {
        TextEntryMenuItem.new("Scale X: ", "1", "10.0", "I don't know what's going on here"),
        TextEntryMenuItem.new("Scale Y: ", "1", "10.0", "Woo hoo")
        }
        return "NoTranslateScaler", "Scale selections on the X Y axis without them moving around", "Ctrl+=", menu
end
 
function main()
        local sx = table.remove(arg, 1)
        local sy = table.remove(arg, 1)
 
        local objects = plugin:getSelectedObjects()
       
       
        if #objects == 0 then
                plugin:showMessage("Operation failed.  No objects are selected", false)
                return
        else
                for _, obj in pairs(objects) do
                        local geom = obj:getGeom()
                        local result = Geom.scale(geom, sx, sy)
                        obj:setGeom(result)
                end
        end
 
end
 
Last edited by tazinator on Wed Mar 12, 2014 3:31 pm, edited 3 times in total.
Play my new level! Two different teams fight over a nexus: One mainly defends while the other attacks! is fun
viewtopic.php?f=33&p=21002#p21002
<<

Fordcars

User avatar

Posts: 1016

Joined: Fri Apr 20, 2012 3:51 pm

Location: Some city, somewhere

Post Tue Mar 11, 2014 9:39 pm

Re: NoTranslateScaler

Whoa sweet!
skybax: Why is this health pack following me?
bobdaduck: uh, it likes you.
<<

tazinator

Posts: 351

Joined: Fri Jul 05, 2013 7:35 pm

Post Wed Mar 12, 2014 3:20 pm

Re: NoTranslateScaler

I've discovered that using my scaler tool on multiple teleporters or speedzones can CRASH. I am requesting help figuring this out
I am assuming at the moment that it will happen with all objects with two points.

Now here is some extra relevant information: I used copy, paste, undo, redo, and the in-game Scale tool before I used my tool and found the game to crash. I cannot reproduce the bug now..
Play my new level! Two different teams fight over a nexus: One mainly defends while the other attacks! is fun
viewtopic.php?f=33&p=21002#p21002
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Thu Mar 13, 2014 2:46 am

Re: NoTranslateScaler

Does it happen when sx or sy are 0?
<<

tazinator

Posts: 351

Joined: Fri Jul 05, 2013 7:35 pm

Post Thu Mar 13, 2014 3:07 am

Re: NoTranslateScaler

Got it!
  Code:
LevelFormat 2
GameType 10 8
LevelName ""
LevelDescription ""
LevelCredits tazinator
Team Blue 0 0 1
Specials
MinPlayers
MaxPlayers
Teleporter -153 -127.5 102 -127.5
Teleporter -127.5 153 127.5 153
 

Step 1. Open level tles (it just has 2 teles i randomly placed using 't' you can make ur own)
Step 2. Use this tool. values are x=1 y=1
step 3. ctrl z
step 4. repeat step 2
CRASH! (i got three times in a row with these steps)

the bug seems intertwined with the use of ctrl z. I dont understand how or why
Play my new level! Two different teams fight over a nexus: One mainly defends while the other attacks! is fun
viewtopic.php?f=33&p=21002#p21002
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Thu Mar 13, 2014 9:35 am

Re: NoTranslateScaler

In the future, can you please tell us what type of 'CRASH'?

With Lua scripts there are 2 types:
1. The script crashes but you can still play the game
2. The game itself crashes and shutdown (known sometimes as a 'hard crash'). This includes the spinning beachball of death on OSX.

#1 is almost always the fault of the person writing the Lua script. #2 would be a critical bug that we need to fix.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Thu Mar 13, 2014 10:50 am

Re: NoTranslateScaler

Our goal is to make it impossible to hard-crash the game with a scripting error. Fixing these sorts of crashes is usually our highest priority.
<<

tazinator

Posts: 351

Joined: Fri Jul 05, 2013 7:35 pm

Post Thu Mar 13, 2014 11:42 am

Re: NoTranslateScaler

#2 crash
Play my new level! Two different teams fight over a nexus: One mainly defends while the other attacks! is fun
viewtopic.php?f=33&p=21002#p21002

Return to Editor Plugin Gallery

Who is online

Users browsing this forum: No registered users and 1 guest

cron