-
Posts
3,946 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by macklebee
-
-
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.
-
-
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
- 1
-
Look at any and all vegetation materials. More than likely you are missing the appropriate shadow shaders.
-
good question - i had a 9800 gt back when we had LE2.2...
-
14 minutes ago, Josh said:
What did you have before?
-
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
- 1
-
Try the same action as shown in the above link. The hidden code area could be on the right, left, or bottom.
-
6 hours ago, Rick said:
I think josh removed require() ability which almost all external modules use.
require() works just fine as long as lua is not sandboxed. Uncheck this option in the editor's Tools>Options...>General tab.
- 1
-
2 hours ago, Crazycarpet said:
I'm not sure what the terms of licensing would be...
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,
-
Understand. I always refer to these sites when I want to double check anything lua:
-
3 minutes ago, Angelwolf said:
It's psuedo, sorry, should have mentioned. I re-wrote the entire post and managed to omit that part!
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
-
is this psuedo-code? or are you asking why it is not working?
if health>=1 and health <25 then hudText = "Critical" elseif health>=25 and health<50 then hudtext = "Caution" elseif health>=50 and health<75 then hudText = "Injured" elseif health>=75 then hudText = "Fine" end
- 1
-
The only crash i get is when I melee the boxes. But I can see if i let this run for awhile there will be issues as the script memory is just constantly rising even when not doing anything. My guess that the issues are somewhere inside the 3 separate player entities with their own scripts you have sitting ontop of each other?
- 1
-
Quote
For animation in Leadwerks to work you require bones. Keyframe animation won't work.
are the trigger and magazine bones or just other sub meshes in the model?
hmmm - if you post the model, i think uu3d can convert it properly to something LE can use. But other than that you would need to place bones in the model and set the keyframes based on their PRS.
- 1
-
You have to manage your fonts just like any asset.
window = Window:Create("font example",0,0,400,300) context = Context:Create(window) world = World:Create() camera = Camera:Create() light = DirectionalLight:Create() light:SetRotation(45,45,0) box = Model:Box() box:SetPosition(0,0,3) box:SetColor(1,0,0,1) lilfont = context:GetFont() medfont = Font:Load("Fonts/arial.ttf", 24, Font.Smooth) bigfont = Font:Load("Fonts/arial.ttf", 48, Font.Smooth) while window:KeyDown(Key.Escape)==false do if window:Closed() then break end box:Turn(Time:GetSpeed()*0.5,Time:GetSpeed()*0.5,0) Time:Update() world:Update() world:Render() context:SetBlendMode(Blend.Alpha) context:DrawText(string.format("FPS: %.2f",Time:UPS()),0,10) context:SetFont(bigfont) context:DrawText("BIG FONT",0,30) context:SetFont(medfont) context:DrawText("MEDIUM FONT",0,80) context:SetFont(lilfont) context:SetBlendMode(Blend.Solid) context:Sync(true) end
- 1
-
Agree that the default style should be turned back to Font.Smooth. In the meantime while waiting for this to be changed back, just set the style to smooth when you load your font.
https://www.leadwerks.com/docs?page=API-Reference_Object_Asset_Font_Load
- 1
-
Canardian/megatron/mika/cant-remember-previous-name was well known for making "strong statements" about everything that typically resembled what people nowadays call "alternative facts". So don't take anything posted by him to heart.
- 1
-
You don't need to create a camera at all when you are using the player with the fpsplayer.lua script. That script creates a camera. Just delete the default camera.
-
2 hours ago, martyj said:
The Entity has a Physics Mode of Rigid Body,
Why would this return false?
The entity must have character physics mode to use the navigation commands.
- 1
-
Have you followed the steps described in the tutorial?
https://www.leadwerks.com/docs?page=Tutorials_Games_First-Person-Shooter_Character-Controllers
Does the character have mass, does it have the fps script attached, etc?
-
Set the groundrocks shader as the vegetation shader in your model's material file.
-
That only happens when you have the base model and all of its children selected. Just click the parent / base model in the Scene tab. A quick way to tell if you have more than just the object / asset selected will be if the Name property value is '<different>' instead of the object / asset's name.
- 1
-
Its already been implemented via shader.
Rotating A Model Via Vertexes
in Programming
Posted
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.