Jump to content

Documentation


Gandi
 Share

Recommended Posts

It seems like there is a lack of documentation for lua :-/

 

Im trying to set the texture of a material in the editor.

atm i got:

local material = self.mesh.material
local tex = LoadTexture("abstract::"..value)

 

but i just cant find the command for setting the texture of the material..

 

another question:

I create my mesh with lua (like the road) and i want to be able to select the entity by clicking on the plane. how can i get to that?

Link to comment
Share on other sites

I know what you mean Gandi. The calss scripting is not that easy to understand for everyone. especially without good docs. What are you exactly trying to do with the texture? You say you want to set a texture on a model, but the code says that you load the texture from the model :) ?

 

instead of self.mesh use one of these:

self

self.model

self.object

object

object.model

 

Sometimes one works and sometimes another one. haven't figured it out yet.

Link to comment
Share on other sites

I Got a model and i painted a material to that model (the model is self.mesh)

now i want to set the texture0 of that material (SetMaterialTexture() in C)

 

and im sure its self.mesh im just not sure if i get the mesh's material with self.mesh.material

 

and i know there is 1 line of code missing.. thats the line where i set the texture :)

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...