Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Everything posted by shadmar

  1. In Lua : lightsource:SetColor( R,G,B )
  2. Works for me, both models and brushes as far as I can tell.
  3. App:Start() is missing return true at the end btw if you create a new project a default script is provided which should be correct. And then you can add the skybox part.
  4. shadmar

    Snippets

    Added entity indexer (get any entity in any lua script) : http://leadwerks.wikidot.com/wiki:entityindexer
  5. math.floor works for me.
  6. shadmar

    Snippets

    Added skybox snippet for Steam Edition : http://leadwerks.wikidot.com/wiki:skybox
  7. I will add some stuff to the wiki soon, but it will be related to 3.1+
  8. shadmar

    Fog

    Here is a way http://www.leadwerks.com/werkspace/topic/7624-still-no-fog/#entry60931
  9. You have to wait for postprocessing support in Leadwerks 3.
  10. Depth buffer for soft falloff on particles, nice one.
  11. It's just a plane scaled in xy. Not an actual box.
  12. No you don't. Parenting means that leadwerks handles this behind the scenes. so you can move camera all you want and plane will follow.
  13. you probably forgot sky->SetParent(camera); wich makes the skybox always follow camera pos and orientation. everything is suppose to go in app:start() since you parent the plane to the camera
  14. The model has quite some bones which are used for placing, particles and lights. Is there a limit I've reached? Added model below
  15. It is supposed to be fixed for us in the upcoming build. (bug closed 18th september)
  16. Very nice indeed. Beautiful Would love to some birds in that sky.
  17. ShaderMap and Pixplant does specmaps from diffuse.
  18. Yes I agree, it was just a really quick class mockup
  19. Found, and uploaded to asset store : http://www.leadwerks.com/werkspace/files/file/459-subsurface-shader/
  20. I wonder why this is sold out : http://www.jinx.com/p/arrogant_linux_elitist_t_shirt.html?exp=go
  21. Ok, I'm mostly interested in doing lua stuff for the sake of simplicity, but I also want some degree of structure. So here is my little exercise in lua I want a team of solders fighting, so I create two "classes" Person.lua Team.lua Since lua uses tables for everything they aren't really classes in the tradional way, but simple OO is still possible without any thirdparty tools or libs using plain vanilla lua : Person.lua - Here I add some stats and actions. --Register class module("Person", package.seeall) --Functions and methods function New(name,age) local object = {} object.name = name object.age = age object.ammo = 20 object.health = 100 function object:sayName() return object.name end function object:fireGun() if object.ammo > 0 then object.ammo=object.ammo - 1 end end function object:hitTaken() if object.health > 0 then object.health=object.health - 1 end end return object end Then I create the Team.lua where I include Person, and adding new team mebers + a team report --Register class module("Team", package.seeall) include('Person') --Functions and methods function New() local object = {} object.members = {} function object:AddMember(name,age) local nextmember = #object.members + 1 object.members[nextmember] = Person.New(name,age) end function object:FindTeamMember(name) for i=1,#object.members,1 do if name == object.members.name then return object.members end end end function object:Report() for i=1,#object.members,1 do print( "Name:"..object.members:sayName().. " Ammo:"..object.members.ammo.. " Health:"..object.members.health) end end return object end Now I move on to App.lua which is my "Main" At the very top I just added a little helper so I can use include for the other lua files + includes the Team "class" ------------------------------------------ -- Helpers ------------------------------------------ --home made include function include(name) require("Scripts/"..name..".lua") end ------------------------------------------ include('Team') In App:Start() I create my team and start shooting : .. --create team myTeam = Team:New() --recruit members myTeam:AddMember("Joe",20) myTeam:AddMember("Bill",30) myTeam:AddMember("Josh",33) --report myTeam:Report() --Lets have some action : local player1 = myTeam:FindTeamMember("Bill") local player2 = myTeam:FindTeamMember("Josh") player1:fireGun() player1:fireGun() player1:fireGun() player2:hitTaken() player2:hitTaken() --report myTeam:Report() ... The output will now be : Probably better ways and better tools for this stuff, but it works, and you can split stuff into smaller bits using multiple files.
  22. You are suppose to use VS2010, VS2012,13 is not yet supported. However I think it may work if you don't upgrade the sln on VS2012.
  23. I guess not, I had a quick search for it, not sure where it did go, I'll take another look tomorrow.
  24. Yes that makes sense, it might be a bug then.
  25. How does the material file of the trees look, like depthtest and zsort.
×
×
  • Create New...