Jump to content

Caracter Animation 3 questions


Gengivas
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

 

  • Upvote 1

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

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

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