Jump to content

Recommended Posts

Posted

HI, in the "driver" example, when you run the game from within the editor, the script creates the car and places it ETC. This sort of defeats the object of the editor.

 

So my question is, how can i place an object in the editor that has a lua script, then from the "game" script find that object and do stuff with it?

 

I have read the lua guide, but it doesnt explain it in there, unless ive missed it.

 

thanks

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Posted

Done it:

 

for entity in iterate(fw.main.world.entities) do

if entity:GetKey("name")=="myModel_1" then

myModel = entity

end

end

 

Andy

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Posted

If your referring to the method i posted then it was a combination of the Lua guide and trial And error.

 

Otherwise I'm not sure bout paratoxic and although I'm sure it will work I haven't tried it.

 

Thanks

Andy

  • Upvote 1

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

 

Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d

Posted

I might be due for another pass through the scripts folder. All of that stuff is there. The class script is probably the most important. The code reads really well. I have wondered how much of a perf boost could be gained on the lua side by doing proper prototypical inheritance instead of creating extra functions everywhere.

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