Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. https://www.leadwerks.com/learn?page=Tutorials_Editor_Materials and as for the strange artifacts:
  2. To create a cubemap texture to use as a skybox or to assign a cubemap texture as the skybox? To create: To assign: https://www.leadwerks.com/learn?page=Tutorials_Editor_Scene-Panel https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_Camera_SetSkybox
  3. Perform the hook as shown here:
  4. Keep in mind that all csg objects will be collapsed into one object unless it has a script or mass. If its collapsed you will not be able to access it in a manner that you are wishing to above.
  5. Leadwerks Engine Beta does not require a code.
  6. Are you using the beta? If so, have you updated your project recently? Just curious as there were issues with Fullscreen a couple of beta versions ago.. In any case, the latest beta version I am using right now has the fullscreen option working.
  7. Leadwerks Engine colors are on a scale of 0-1 not 0-255. Essentially you just set the color to (1,1,1,0.45). The only thing that uses the 0-255 scale is the color picker in the Editor but it is set by the 0-1 scale and it will return the 0-1 scale.
  8. Screenshots are nice but a map would be better.
  9. Yeppers. Basically any item that is an asset (model,material,texture,etc) will need to be created, loaded as un-managed, or copied to prevent it from affecting any other previous instance of that asset. Has to be done via code as currently no way to load unique copies in editor. Other discussions about this: Glad to help. I was just going to link to the LE2 switch converted to LE4 in the workshop or forum but was surprised when I couldn't find it. This switch was the convenient workaround for the same problem of instances in the Editor back in the LE2 days.
  10. The workaround in LE2 for a simple ON/OFF switch with an emissive material was to just change the color of the model which via shader would change the texture for the emissive output. Just for fun, I converted this setup to LE4, and gave it a modified simple pushbutton script that uses the switch sound ("switch.lua") and a shader that works in LE4 ("switch.shader"). Hope it helps. LE2switch.zip
  11. Actually, yes and yes. It is actually changing the position of the vertices if you just rotate the model. The problem is that GetVertexPosition() returns the local position of the vertex. You need to transform that to a global position. window = Window:Create("Global/Local/Screen Example",0,0,800,600,Window.Center) context = Context:Create(window) world = World:Create() camera = Camera:Create() camera:Move(0,2,6) light = DirectionalLight:Create() light:SetRotation(35,35,0) model = Model:Box() model:SetColor(0.0,0.0,1.0) model:SetPosition(0,2,9) model:SetRotation(45,45,0) surface = model:GetSurface(0) marker = Model:Box() marker:SetScale(.05,.05,.05) marker:SetColor(1,0,0,1) while window:KeyDown(Key.Escape)==false do if window:Closed() then break end model:Turn(0,-0.2,0.5) localpos = surface:GetVertexPosition(0) globalpos = Transform:Point(localpos,model,nil) screenpos = camera:Project(globalpos) marker:SetPosition(globalpos) Time:Update() world:Update() world:Render() context:SetBlendMode(Blend.Alpha) context:DrawText("Local Vertex Position: "..localpos:ToString(),2,2) context:DrawText("Global Vertex Position: "..globalpos:ToString(),2,22) context:DrawText("Vert0",screenpos.x,screenpos.y) context:SetBlendMode(Blend.Solid) context:Sync(true) end
  12. why does it have to be at the vertex level? Just rotating the model rotates the vertices so to the observer its the same thing.
  13. Terrain shadows have not been an option since LE2.5. At some point, I suspect the option will return. Until then, camouflage it with shadows on the vegetation.
  14. how are you getting the terrain? It should work if you are properly accessing the terrain. Granted, the GetHeight() does not appear to provide any information anymore, but GetElevation() appears to work just fine. window = Window:Create("terrain example",0,0,800,600) context = Context:Create(window) world = World:Create() camera = Camera:Create() camera:SetPosition(0,60,0) camera:SetRotation(0,45,0) camera:SetMultisampleMode(8) pickinfo = PickInfo() Map:Load("Maps/terrain.map") for i=0,world:CountEntities()-1 do if world:GetEntity(i):GetClass()==Object.TerrainClass then terrain=world:GetEntity(i) tolua.cast(terrain,"Terrain") break end end camrot = camera:GetRotation() gx=Math:Round(context:GetWidth()/2) gy=Math:Round(context:GetHeight()/2) move = 0 strafe = 0 while window:KeyDown(Key.Escape)==false do if window:Closed() then break end mouseposition = window:GetMousePosition() dx = mouseposition.x - gx dy = mouseposition.y - gy camrot.x = camrot.x + dy / 10.0 camrot.y = camrot.y + dx / 10.0 camera:SetRotation(camrot) window:SetMousePosition(gx,gy) move = Math:Curve(((window:KeyDown(Key.W)and 1 or 0) - (window:KeyDown(Key.S) and 1 or 0)),move,10) strafe = Math:Curve(((window:KeyDown(Key.D)and 1 or 0) - (window:KeyDown(Key.A) and 1 or 0)),strafe,10) camera:Move(strafe,0,move) p = window:GetMousePosition() if window:MouseDown(1) then pick = camera:Pick(p.x,p.y,pickinfo,9,true) end Time:Update() world:Update() world:Render() if pick then context:SetBlendMode(Blend.Alpha) context:DrawText("Height: "..terrain:GetHeight(pickinfo.position.x, pickinfo.position.y), 2, 2) context:DrawText("Elevation: "..terrain:GetElevation(pickinfo.position.x, pickinfo.position.z), 2, 22) context:SetBlendMode(Blend.Solid) end context:Sync() end
  15. Look at any and all vegetation materials. More than likely you are missing the appropriate shadow shaders.
  16. good question - i had a 9800 gt back when we had LE2.2...
  17. Hard to tell exactly if the same issue since no code was provided but it may be an antialiasing issue - if so, not quite sure why Josh has not reverted this back yet. Just set your font's style to Font.Smooth when loading. https://www.leadwerks.com/learn?page=API-Reference_Object_Asset_Font_Load
  18. Try the same action as shown in the above link. The hidden code area could be on the right, left, or bottom.
  19. require() works just fine as long as lua is not sandboxed. Uncheck this option in the editor's Tools>Options...>General tab.
  20. 1% of the first sale of your game then double it for each sale afterwards, eye of newt, pickled frog legs, 1 bowl of M&M's with all the green ones removed, six geese a laying, your first great grandchild's new puppy after a day of them bonding with it, and the steering wheel to a tata nano,
  21. Understand. I always refer to these sites when I want to double check anything lua: http://pgl.yoyo.org/luai/i/_ http://www.lua.org/pil/contents.html http://lua-users.org/wiki/LuaDirectory
  22. ok - and you also managed to omit what exactly the problem is... in your non-psuedo code, what exactly is it not doing? It would help if we knew that or saw the actual code. Edit - ok see that the else/if/else if statements were the problem
×
×
  • Create New...