MisterGravity Posted January 14, 2014 Share Posted January 14, 2014 Please note, I'm still very new at the Lua scripting. I'm trying! Using nate066's Jump-Pad tutorial script located here, I tried to use some skills I learned from Rick in his Teleportation tutorial located here. Specifically, once Rick implemented the teleporter pads, he created a couple of Pivots in the scene to hold the Noise.lua scripts. I learned that a function Script:Whatever could be called in the Flowgraph Editor to call outputs, like this: self.component:CallOutputs("TriggerEnter") Which would let him use it in the Flowgraph Editor, like this: So what I did was, I tried to use that knowledge to edit the Jumppad script to also be able to call a similar Pivot when the collision occurred. The problem (and it's not really a problem, it just wasn't conducive to what I wanted to do,) was that the JumpPad's action was all happening in the function Script:Collision area of the code. My assumption was that I could remove what made it work and put it in it's own function instead, and then use a "CallOutput" to be able to use it in the Flowgraph Editor too. This was what I was hoping would work, but does not. And this is the code as it was when I altered it: Script.JumpForce = nil --vec3 Script.SelectiveCollision = false --bool "Selective Collision" Script.ColObj = nil --Entity "Collision Object" function Script:Start() self.source = Source:Create() end function Script:Collision(entity, position, normal, speed) if (self.SelectiveCollision == true and entity == self.ColObj) then self.source:Jump() elseif (self.SelectiveCollision == false) then entity:AddForce(self.JumpForce) end end function Script:Jump() self.component:CallOutputs("Jump") self.ColObj:AddForce(self.JumpForce) end Does anyone have any thoughts on this? And nate, this was not intended to sidestep you or go over your head. You and I had talked together on trying to encorporate sound directly into it, but I thought I'd take it public since I'm now trying to add in pieces of Rick's project as well. Thanks everyone! Quote I'm sure I'll have a million questions in my quest to master the Leadwerks Engine. Thank you for your patience. Link to comment Share on other sites More sharing options...
Recommended Posts
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.