Jump to content

Scripting the Leadwerks Editor


SteveV
 Share

Recommended Posts

Hi All,

 

is it possible to script the editor itself? To give you a specific example, I'd like to lay out road nodes programmatically, rather than lay them out one by one and adjust them manually.

 

If the answer is yes you can, look at page x on the manual, then I'm happy with that. I'm trying to find my way around the many resources available.

 

Thanks in advance.

All the best,

Steve Vink

Link to comment
Share on other sites

Yes, it is to some extend. You can automate things which happen in the scene which you are editing in Editor. Niosop came up with the name thingoid ( http://leadwerks.com/werkspace/index.php?/topic/599-hybrid-fpscontroller-lua/page__view__findpost__p__5277 ) for lua scripts which run like nanobots in the scene. The term thingoid was then first liked by Rick, and soon the whole LE community adopted it as a standard.

 

Basically you can automate anything with thingoids in your scene. They can display texts (via the Flip hook), move objects, react to some events, etc...

 

You can also just simply run a seperate lua script in Editor, which does something programmatically, like changing the position of road nodes.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Thanks for the response. I think I am asking for something a little different. I'd like to be able to run a script once to create a strip of road, and then end. It's not a continuously running script, just a one-off action.

All the best,

Steve Vink

Link to comment
Share on other sites

You can also just simply run a seperate lua script in Editor, which does something programmatically, like changing the position of road nodes.

 

This is good, I'm not sure of the best way to do this, but I'm guessing I need to create some kind of dummy object (or thingoid?) with scripts attached. As long as there is some kind of hook that triggers (and I guess that's how it all works, I haven't got that far just yet) then I can adjust it's state (via a custom property window?) to perform various actions.

 

 

Now I'm wondering if I can create new road nodes with a script, or if this part has to be done manually?

 

Do thingoids exist yet, or is it still a concept?

All the best,

Steve Vink

Link to comment
Share on other sites

I had a similar question today, but slightly different. Can you script editor commands? Like add a right-click item in the pop up menu that could open a form defined in a different assembly? A possible use of this would be to add a custom properties window for a different class library, like if you wanted to be able to set properties for your AI system via the LE.

 

Basically...is there any plugin support?

Link to comment
Share on other sites

Note that the road system is in lua scripts right now. That's how Josh made them

 

That's good to know. I went looking for associated scripts but couldn't find them, I need to look a little harder :)

 

Maybe if I elaborate on my ideas, it might prompt some more discussion and ideas, I think it will be useful to many people. This is something I've done in DarkBASIC Professional, and would be fantastic if I can achieve it an editor thingoid.

 

I call this concept Rails. It's nothing new, I'm sure lots of engines use them. The main rail is your road, track, river, whatever you need. It's made as a C-spline so it's very flexible. Each node has 2 handles which you drag around to form the path.

 

Now you can start adding secondary rails, that run parallel to the primary one. The first could be used to contain walls, another for street lighting, and so on. As you fine tune your primary rail, each secondary rail repositions to suit the first.

 

Does this make any sense? I'm talking about making a road/track system that is intelligent enough to simplify the design process. If anyone has manually laid down a road they'll know how powerful such a system would be to any terrain editor. I can possibly post some screen shots of the DBP prototype.

All the best,

Steve Vink

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