Jump to content

Josh

Staff
  • Posts

    24,586
  • Joined

  • Last visited

Everything posted by Josh

  1. Josh

    Roads in code

    If you just loaded a model and set the target it would actually work automagically.
  2. I think by "procedural" they probably mean they have a series of connected nodes the artist places, and the engine builds a mesh at runtime, sort of like how ours work.
  3. Josh

    Road bug fixed

    Let me know if you find any other problems. I am going through the scripts looking for any errors. This is a good practical lesson in the importance of consistency. B)
  4. Josh

    2.3 Sync

    This should work to set globals in the Lua virtual machine: Function SetScriptObject(name:String,o:Object) Local size:Int=GetStackSize() lua_pushbmaxobject(luastate.L,o) lua_setglobal(luastate.L,name) SetStackSize(size) EndFunction Function GetStackSize:Int() Return lua_gettop(luastate.L) EndFunction Function SetStackSize(size:Int) Local currentsize:Int=GetStackSize() If size<currentsize lua_pop(luastate.L,currentsize-size) EndIf EndFunction
  5. It may be invisible, but it will still be stored in memory and in the lua object table. The class will never get freed either.
  6. I usually like to have a lot of extra checks: function class:CreateObject(model) local object=self.super:CreateObject(model) object.cube=CreateCube() function object:Free() if self.cube~=nil then self.cube:Free() self.cube=nil end self.super:Free() end end Don't forget self.super:Free()!
  7. Josh

    Road bug fixed

    Yes, just apply a different material. I fixed the math function name thing. It's in the sync folder.
  8. Nope. The terrain shader doesn't use a matrix multiplication, for better speed.
  9. Turn on trilinear filtering and set anistropic filtering to 4.0.
  10. You can do quite a bit to the 2.3 editor with scripts.
  11. I added a vcproject to the Transparency and Refraction lesson. I'm going to include a project with each lesson showing the final result. Unfortunately, the Windows 64-bit Program Files convention interferes with this, because the project doesn't know if the header files are in C:\Program Files\Leadwerks Engine SDK or C:\Program Files (x86)\Leadwerks Engine SDK. I am going to make these projects with the header in C:\Leadwerks Engine SDK, and the default installation directory will be moved there as well.
  12. The floor/ceiling sliders can be used to control the opacity.
  13. There are still a few things I can do to improve performance with points lights especially. Multithreading won't actually make that much of a difference, because most of the bottlenecks occur on the GPU.
  14. TerrainHeight will return the height at a specific grid point. Terrain elevation will return an interpolated height at a 3D position in global coordinates.
  15. http://leadwerks.com/werkspace/index.php?/tracker/issue-25-road-position/
  16. The issue is resolved. Sync.
  17. Your first code you posted worked perfectly.
  18. Josh

    12-18-2009

    Well, I think in my case docs and tutorials are the "seeds" and sales are what you reap.
  19. If you add require("scripts/loop") at the top, you will import the loop script, which has a few functions declared the engine picks up: require("Scripts/hooks") function UpdateWorldHook() RunHooks("UpdateWorld") end function UpdatePhysicsHook() RunHooks("UpdatePhysics") end function FlipHook() RunHooks("Flip") end I just added the FlipHook() function, so I guess it doesn't make sense to call this file "loop" anymore. Maybe "enginehooks" would be a better file name? Then the user can use AddHook("UpdateWorld",myfunction) to add their own Lua hooks, and your main loop doesn't have to have any code hardly.
  20. Josh

    2.3 Sync

    You could but the results would be unpredictable because SetMatrix() updates the entity position, rotation, scale, etc. Here is a list of members: http://leadwerks.com...ntities#Members The following are the documented members of the Entity class. Generally, members should be treated as read-only. For example, setting the entity position by changing the position vector values will fail to perform necessary updates the SetPosition() command would call, and the results may be unpredictable.
  21. It sounds like perhaps some files got moved around and you are loading an older version of the script? Double click on the class node of the pointlight and see what the script is.
×
×
  • Create New...