Jump to content

Recommended Posts

Posted

The documentation states that it is possible to have a color picker but I haven't been able to get it working.

 

Tried the following.

Script.a = "" --color
Script.b = Vec4(0,0,0,0) --color
Script.c = Vec3(0,0,0) --color

 

The particle emitter has a color picker in it so it must be possible.

post-45-0-17711000-1373196934.jpg

  • 6 months later...
Posted

Yes that works and your initial color will be 0,0,0,0 in the editor.... but...

 

 

If you do :

--Color
Script.Cool = Vec4(1,1,1,1)--Color
--Vec3
Script.Vec3Test = Vec3(1,0,0)--Vec3

 

Throws:

...: Attempt to call a non-callable object

 

Or if you try getting the value from your first example

 

SetColor(Vec4(Cool)) -- will result in same error

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Posted

This worked for me, but I could never get the actual default value to function.

 

--The Lua Script
Script.MyColor = Vec3()--Color "My Color"

 

// Retrieving the value in C++
Vec4 myColor = (Vec4)entity.getObjectA("MyColor");

Posted

Got it... this works :

   Script.MyColor = Vec3(1,1,1)--Color "My Color"
..
   r,g,b=self.MyColor.x,self.MyColor.y,self.MyColor.z
   entity:SetColor(r/255,g/255,b/255)

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...