Jump to content
  • entries
    941
  • comments
    5,894
  • views
    867,849

Connecting Actors


Josh

2,633 views

 Share

To make an entity in Leadwerrks3D behave, you can drag a script from the asset browser to the actors list in the entity properties editor. Each entity can have multiple scripts attached to it. Each script can have different variables exposed, with control for the GUI they are displayed in. For example, you can specify upper and lower limits of a spinner or a list of choices for a drop down box. Each script attached to an entity, along with its set of properties, is called an "actor" because...it acts.

 

To handle the interaction of different actors, a flowgraph is used. You can drag actors from the entity properties editor into the flowgraph editor. Each actor has inputs and outputs defined in its script. You can connect the output of one actor to the input of another. For example, you can connect the "tick" output of a timer script to the "Resume" output of a mover script, to make the mover translate and rotate an entity at regular intervals when the timer ticks:

 

I hope this makes it more clear how entity interactions can be handled in Leadwerrks3D, even without programming. With this system, we're all working on one big game together, and we can share functional objects without any difficulty.

 Share

7 Comments


Recommended Comments

Guest Red Ocktober

Posted

i'm starting to like this... as much as i hate to admit it... i can see this as being usefull...

 

gotta jog myself outta the coding only mindset...

hey, it's a new world... the new order is upon us :)

 

this really looks great josh...

 

question...

 

what happens if after setting up these flowgraphs, i decide to change the name of the entity... will the system be smart enough to maintain the linkages...

 

--Mike

Link to comment

Nice video.. I remember you mentioning in another blog post that you will be changing the flowgraph editor graphics to something better? I think you should keep it how it is! I prefer the simple look, instead of having fancy looking panels. :)

Link to comment

Mike, the entities are referenced by a unique ID, so the name does not matter. What scares me is what happens when the user resaves a script and the outputs and inputs change. :) It's very hard to write an editor that dynamically reloads everything.

 

The whole purpose is to have a standard way of making things interact, so that all our scripted objects can talk to one another.

Link to comment

Instead of having to import the flowgraphs for each map, can't you just have one or more logic maps loaded first, and then the real maps on top of them?

Link to comment

Instead of having to import the flowgraphs for each map, can't you just have one or more logic maps loaded first, and then the real maps on top of them?

Can you rephrase that?

 

I think we'll be able to save flowgraphs as part of a prefab, so you can set logic up once for a set of entities and then save it as one prefab of interconnected objects.

Link to comment

I can't see the video, I assume the white space is a youtube video, here at work, but does this works across entities also? If I have Actor B attached to entity1 and Actor C attached to entity2, I can link them in this editor or is it just actors on the same entity?

 

If it's cross entity linking, is there a way that I can get information of the actor which called the output method from within the output method?

 

--ActorA.lua
function MyOutputFunction() --output
  -- I want to access some property of the actor that called me! 
  -- Let's say a timer Actor called me from a link I made via the flowgraph, and here I keep track of how many times I've been called and if it's > x I want to disable that timer actor script.
end

 

I think it would be cool if the output functions would be defined to take a parameter which would be the actor that called it. If that's not the case already.

Link to comment

That's not a bad idea.

 

Yes, you can link from one actor on one entity to another actor on another entity.

Link to comment
Guest
Add a comment...

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