Jump to content

Video tutorial #10. Character controllers with Lua.


AggrorJorn
 Share

Recommended Posts

Since college started again I didn't have much time to spend on Leadwerks nor making new tutorials about Lua. But here is a little something for that in return: A video tutorial which has a time lenght of over 1 hour!!!

 

This video tutorial explains how to create character controllers in your Lua program. The tutorial will explain the following:

 


  •  
  • Creating a character controller.
  • First person view.
  • Jumping and crouching.
  • Camera smoothing.
  • Camera angles.
  • Third person view.

 

-- PDF will be added soon.

 

http://leadwerks.com/werkspace/index.php?/page/resources/_/programming/lua/9-creating-a-character-controller-with-lua-r49

Link to comment
Share on other sites

not bad... some suggestions to fix or clarify in the pdf version:

  • This line is not doing anything since camera is not a Vec3 value
    controller:SetPosition(camera)


  • This line is not needed because the relationship is already being set by the standard collisions.lua file that is ran at the start of the program since its in the scripts/start folder
    Collisions(COLLISION_CHARACTER,COLLISION_SCENE,1)


  • These lines are not doing anything... I assume they were supposed to be the initial settings for 'gx' & 'gy'
    dx=0.0
    dy=0.0


  • The 5th parameter for the controller update is maxacceleration, not smoothing. It determines how quickly the controller will accelerate in movement. When starting to move, it controls how quickly it will get to maximum speed. When you stop, it controls how fast you slow down. So a higher maxacceleration value will make you slow down quicker and remove the 'ice-skating' effect.

 

still all in all, a decent guide to help beginners use controllers in lua. good job.

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

Very good feedback macklebee.

 

  1. That is correct.
  2. Didn't know that. :)
  3. they were indeed intended for the camera movement. but they can be removed .
  4. Ah darn it. I must have confused this with the previous parameter. I did get the name of the parameter right though :lol:

 

I will adjust them in the pdf and add some comments on youtube.

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