Gengivas Posted October 10, 2016 Share Posted October 10, 2016 first question: i created an fbx with an animation, how do i put the object runing the animation by itself? imagine i create a dancing character, i need him to be dancing in the same place (square) but running the dancing animation?i placed it on spot but it doesn't move, what am i doing wrong? second question: how do i make sequential lights with flowgraph and flicker script? for making a landing platform with the lights always sequential? third question : how do i make a loop animation in leadwerks? Quote Link to comment Share on other sites More sharing options...
Undac Posted October 10, 2016 Share Posted October 10, 2016 You should do the tutorials: http://www.leadwerks.com/werkspace/page/tutorials/ I don't use lua or the editor much, so I can't help you with that, but for animations you have an example here (and I am pretty sure that sample games have educational scripts on that as well): http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entityloadanimation-r15 Quote Link to comment Share on other sites More sharing options...
Phodex Games Posted October 10, 2016 Share Posted October 10, 2016 If I would have more time I would explain you exactly how to handle your animations problem. Because I dont maybe check out this video it helped me a lot. I know its not for Lua but if you are aware of coding a little bit you will understand what is going up and can do the same for lua (I also am not coding in C#). Video: About the flickering light, isnt there a light flickering script in one of the leadwerks prefab projects? Quote Link to comment Share on other sites More sharing options...
Gengivas Posted October 11, 2016 Author Share Posted October 11, 2016 yes but how do i make them sequential?with different times? Quote Link to comment Share on other sites More sharing options...
macklebee Posted October 11, 2016 Share Posted October 11, 2016 The flicker light script is meant to be a random effect (hence math.random being used). But you can try using my simple sequential light script to be changed as needed for your needs. It was written with the cagelight prefab in mind which is why it searches for the child entities of the lens flare and point light. The first light to be lit should be checked as the 'Start Light' in the object properties panel. Then just drag the next light to be lit into the 'Next Light' property. Do that in order for each subsequent light. On the last light, set the first light as it's 'Next Light' to continue the effect. sequential light lua script for the cagedlight prefab: Script.delay=2000 --int "On Time" Script.enabled=true --bool "Start Light" Script.nextlight="" --entity "Next Light" function Script:Start() self.flare = self.entity:FindChild("Lens Flare 2") self.light = self.entity:FindChild("Point Light 2") self.currenttime = Time:GetCurrent() + self.delay end function Script:UpdateWorld() if self.enabled then self.flare:Show() self.light:Show() if Time:GetCurrent()>self.currenttime then self.flare:Hide() self.light:Hide() self.enabled = false if self.nextlight~=nil then self.nextlight.script.enabled = true self.nextlight.script.currenttime = Time:GetCurrent() + self.nextlight.script.delay end end else self.flare:Hide() self.light:Hide() end end 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
tipforeveryone Posted October 11, 2016 Share Posted October 11, 2016 Another script for flicker light Script.flicker = true --bool "Flicker enabled" Script.flickerRate = 0.5 --float "Flicker Rate" -- Value range should be from 0 to 1 -- near 0 ~> light is off most of time -- near 1 ~> light is on most of time function Script:FlickerControl() if self.flicker then local rand = Math:Random(0,1) if rand < self.flickerRate then self:entity:Show() else self.entity:Hide() end end end Quote Link to comment Share on other sites More sharing options...
Gengivas Posted October 13, 2016 Author Share Posted October 13, 2016 Humm many thanks Quote 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.