Jump to content

animation character and lua


VicToMeyeZR
 Share

Recommended Posts

math.modf

Return the integral and fractional parts of the given number.

 

> = math.modf(5)

5 0

> = math.modf(5.3)

5 0.3

> = math.modf(-5.3)

-5 -0.3

 

If you want the modulus (remainder), look for the modulo % operator instead.

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

@Rick..

 

Using your character thingoid if you assign the character to it, would the character lua code, then become the child of the character controller?

 

I am wondering, because the animation sequences would be in the update() part of the character script, but trying to find the way to assign when key pressed play this sequence..

AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD

76561197984667096.png

Link to comment
Share on other sites

frame = math.fmod(AppTime()/35,frameend-framestart)+framestart

it was math.fmod that I wanted.

 

 

Thanks for your help

 

ah ok... wasn't sure what you were trying to capture since i am not a c++...

 

take a look at this link for reference... i have found it to be quite useful

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

that one is much easier than the lua site. :angry: thanks

 

also..

 

 

I call

group:AddProperty("idle_start", PROPERTY_INTEGER, "", "Idle Start Frame")

 

but when I try to reference that value, it always pulls the default value only?

 

object.framestart = object:GetKey("idle_start", "450")

 

Is this not the right syntax?

AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD

76561197984667096.png

Link to comment
Share on other sites

well just guessing that the SetKey function is not actually setting the value, so when you do the getkey and doesn't find a key/value for idle_start, it will use the default value... easy way to confirm this is to not use a default value

object.framestart = object:GetKey("idle_start")

 

look at how environment_atmosphere.lua file sets the key/values initially then uses the getkey to grab the value based on the key

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

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