Jump to content
randomkeyhits

Script --Vec Arguments not parsing properly

Recommended Posts

When I use --Vec2/3/4 for script arguments (I want nice neat input tables) the default value of the first element is always over-ridden and set to 0.0

 

Script.TestThis = { 1.0, 2.0, 3.0, 4.0 } -- Vec4 "testing"

 

Will offer up 0.0 2.0 3.0 and 4.0 as the default values.

 

Same behaviour with Vec2 and Vec3

Share this post


Link to post

Yes, that works.

 

I need more scripting practise....

 

edit : more than I realised.

 

I've this at the start of the code

 

-- create the zoom array

Script.Steps = {}

Script.Steps[1] = Vec4(1.0, 45.0, -30.0, 10.0 ) --Vec4 "Zoom 01"

Script.Steps[2] = Vec4(2.0, 45.0, -30.0, 10.0 ) --Vec4 "Zoom 02"

Script.Steps[3] = Vec4(3.0, 45.0, -30.0, 10.0 ) --Vec4 "Zoom 03"

Script.Steps[4] = Vec4(4.0, 45.0, -30.0, 10.0 ) --Vec4 "Zoom 04"

.....

 

When I read the results later in the script

 local distance = self.Steps[offset].x

 

no matter what I set the args to in the panel it always gives me the preset values.

Share this post


Link to post

It does probably not work with tables.

 

But you should be able to assign the values later to a table.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...