Jump to content

flowgraph and connecting events


drarem
 Share

Recommended Posts

I'm at the point where I think I need to use a flowgraph. I have an invisible trigger box parented to an animated treasure chest. When I run into the trigger I want the animation of the chest to play (by opening)..

 

I added the CollisionTrigger.lua to the box, added to flowgraph and i see three functions in the flowgraph. So far it looks good.

 

For the animated box, i have a script to open/close the box, but when i move it to the flowgraph, it has no functions. How would I set it up to receive the input, to trigger the animation?

 

thanks.

Link to comment
Share on other sites

Look at the CollisionTrigger.lua. You'll see that inputs have a --in at the end of the function. That tells the flowgraph to include that. You can also see how to get outputs. It's something like CallOutputs("Outputname") or something like that. Just look in the CollisionTrigger to see these examples and then apply those ideas to your script.

Link to comment
Share on other sites

Does it work for prefabs? I have this code and it works for the model on the map, but I saved as a prefab and spawn it it also, it doesn't display any message or open.

 

 

function Script:Collide()--in
   if self.animationmanager==nil then self:Start()  end
System:Print(">>> And this collision is called in turn..")
   if self.opened == false then
       self.animationmanager:SetAnimationSequence("Open",0.04,150,self,self.EndOpen)
       self.opened = true
   end
end

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