Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. http://www.leadwerks.com/werkspace/topic/8347-beta-branch-available-in-steam/
  2. http://www.leadwerks.com/werkspace/topic/13422-draw-image-mirror-options/#entry94355
  3. Use this shader Use the shader located here: http://www.leadwerks.com/werkspace/topic/12537-drawing-a-section-of-a-2d-texture-setting-uv-coords/#entry90453
  4. LE4 is a completely different engine from LE2.3. While a lot of the LE4 API is very similar to the older API, the editor interface is completely redone. If for whatever reason you are wanting to stick with LE2.3 (as there are some things available there that are not available in LE4), then my suggestion for you is to purchase Ultimate Unwrap 3D for converting model files to GMF (the UU3D plugin will be listed as Leadwerks MDL but gives the option to save to GMF). But if you want to convert your project to an engine that is supported, I think you will find that LE4 has a more user-friendly editor and workflow than what was available for LE2.3.
  5. This is possible in the windows version. I assume you are using linux version?
  6. I assume this suggestion is for linux? As you can use the delete key in windows.
  7. Look at your tree's material shader settings. I suspect you are missing your shadow shaders for the trees. As an example: http://www.leadwerks.com/werkspace/topic/14178-dark-shadow/#entry97265 and http://www.leadwerks.com/werkspace/topic/14726-dlc-oak-tree-shadow/#entry100102
  8. Suggestion on how can you duplicate this? It sounds like this only happens when something else running in windows is having trouble. Is it your game that is showing a wait icon?
  9. Here's a quick and dirty method version of drawing text onto a textured object using the emissions shader: window = Window:Create("CLOCK",0,0,500,500,Window.Titlebar+Window.Center) context = Context:Create(window) world = World:Create() camera = Camera:Create() light = DirectionalLight:Create() light:SetRotation(30,35,0) mat1 = Material:Create() tex0 = Texture:Load("Materials/Concrete/concrete_clean_diff.tex") tex1 = Texture:Load("Materials/Concrete/concrete_clean_dot3.tex") tex2 = Texture:Load("Materials/Concrete/concrete_clean_spec.tex") mat1:SetTexture(tex0,0) mat1:SetTexture(tex1,1) mat1:SetTexture(tex2,2) shader = Shader:Load("Shaders/model/diffuse+normal+specular+emission.shader") mat1:SetShader(shader) box1 = Model:Box() box1:SetPosition(0,0,1.5) box1:SetMaterial(mat1) buffer = Buffer:GetCurrent() mybuffer = Buffer:Create(100,100,1,1) while not window:KeyHit(Key.Escape) do if window:Closed() then return false end box1:Turn(0,Time:GetSpeed()*0.5,0) Time:Update() world:Update() world:Render() Buffer:SetCurrent(mybuffer) context:SetBlendMode(Blend.Alpha) context:SetColor(0,0,0,0) mybuffer:Clear() context:SetColor(1,0,0,1) context:DrawText(os.date("%I:%M:%S"),25,45) tex4 = mybuffer:GetColorTexture(0) mat1:SetTexture(tex4,4) Buffer:SetCurrent(buffer) context:Sync(true) end
  10. Well, yeah its not part of Render - but thats why you draw to a custom buffer/texture then apply it to a model. But its the exact same concept. There really is no difference between drawing a 2D image vs 2D text onto a model. My "decal" is not a LE decal. I was drawing on the texture/buffer being applied to the model as the video shows in the upper left hand corner. But after Josh put out his LE4 decals there was no reason to continue with it. And the first post I showed is a way to perform it. Apply the drawn text in a custom buffer as a texture to a material.
  11. http://www.leadwerks.com/werkspace/page/api-reference/_/window/windowcreate-r462
  12. http://www.leadwerks.com/werkspace/topic/10311-drawing-dynamic-material-on-models-and-similar/#entry76089 and similarly, my attempt at one point of doing decals prior to them being implemented in LE4:
  13. You should be able to just set the position (using entity:SetPosition) to align on whatever value for Z that you would want. Just perform it prior to the SetInput(). An example on one way to perform this: window = Window:Create("Example", 0, 0, 800, 600,257) context = Context:Create(window) world = World:Create() camera = Camera:Create() camera:SetDebugPhysicsMode(true) camera:SetPosition(0,6,0) camera:SetRotation(90,0,0) light = DirectionalLight:Create() light:SetRotation(35,35,0) ground = Model:Box(10,1,10) ground:SetPosition(0,-0.5,0) ground:SetColor(0.6,1,0.6) shape = Shape:Box(0,0,0, 0,0,0, 10,1,10) ground:SetShape(shape) shape:Release() ground:SetCollisionType(Collision.Scene) player = Model:Load("Models/characters/crawler/crawler.mdl") player:SetCharacterControllerAngle(180) player:SetPhysicsMode(Entity.CharacterPhysics) player:SetCollisionType(Collision.Character) player:SetPosition(0,0,2.5) player:SetMass(10) angle = player:GetRotation(true).y Zpos = player:GetPosition(true).z move = 0 while not window:KeyHit(Key.Escape) do if window:Closed() then return false end move = 0 if window:KeyDown(Key.Left) then angle = 90 move = 3 end if window:KeyDown(Key.Right) then angle = -90 move = 3 end p_pos = player:GetPosition(true) if math.abs(p_pos.z-Zpos)>0.01 then player:SetPosition(p_pos.x,p_pos.y,Zpos) end p_rot = player:GetRotation(true) finalangle = Math:CurveAngle(angle, p_rot.y, 3) player:SetInput(finalangle,move,0,0,false,1,0.5,false,5.0) Time:Update() world:Update() world:Render() context:SetBlendMode(Blend.Alpha) context:DrawText("Press LEFT/RIGHT arrow keys to move",2,2) context:DrawText(string.format("Player Z Position: %.1f",p_pos.z),2,22) context:DrawText(string.format("Player Angle: %.1f",player:GetRotation(true).y),2,42) context:SetBlendMode(Blend.Solid) context:Sync(true) end
  14. Honestly, I do not think that has been fully implemented as I never saw any difference in behavior from a max rotation speed between 5000 or 0.0005. What you can do is control how fast the angle value is changed to the final amount. example: angle = player:GetRotation(true).y --defined before main loop move = 0 strafe = 0 jump = 0 crouch = false maxaccel = 1 maxdecel = 0.5 detailed = false maxrotationspeed = 0.5 .. .. --Main Loop p_rot = player:GetRotation(true) if window:KeyHit(Key.Right) then angle = 270 end if window:KeyHit(Key.Left) then angle = 90 end finalangle = Math:CurveAngle(angle, p_rot.y, 10) --decrease step to quicken rotation player:SetInput(finalangle,move,strafe,jump,crouch,maxaccel,maxdecel,detailed,maxrotationspeed)
  15. No idea that your code was just for visualizing so assumed that the issue was the incorrect syntax. And Genebris is correct, for any of the FileSystem commands that write/delete files/directories (and any lua IO functions), the lua sandbox must be disabled. Just keep in mind that disabling the lua sandbox will not work for any game you make for the Leadwerks Game Launcher.
  16. Typically located at 'C:\Users\~ComputerName~\AppData\Local\~ProjectName~\ProjectName.cfg' for Windows users.
  17. +1 - Yes, it appears window.Center is missing now. Thanks for finding this Michael_J. That was an annoying one to figure out when all of my main scripts failed this morning due to always creating a window with the center style.
  18. It should be: for e=1, #entities do end
  19. The syntax is wrong for FileSystem:WriteFile(). The API example shows how to properly do this. But for your example, it would be like this: function Script:Start() local gamedata = {} gamedata.playerHealth = 100 gamedata.playerWeapon = "Sword" --Note the quotes gamedata.playerPos = Vec3(10, 100, 53) local stream = FileSystem:WriteFile("gamedata.lua") stream:WriteLine(gamedata.playerHealth) stream:WriteLine(gamedata.playerWeapon) stream:WriteLine(gamedata.playerPos:ToString()) end But this method will only write the value and not the key that is associated with that value. Another way to do this (as there are many), is to use System:SetProperty(key, value) which will write the key and value into the game's config file. Then use System:GetProperty(key) to read the value.
  20. Open the 'oakbranch.mat' in the Material Editor and add the shadow shader for the vegetation shader option. The same problem exists for some of the other trees as well - missing shadow shaders in the branch/trunk materials.
  21. Did you import the GetEntityNeighbors script into your script before trying to use the above code?
  22. The sliding door is the model I am referring to - you can just place the swinging door script on it. As for your issue, the offset value was wrong based on the size of your door. A 1-meter offset on the X-axis was too far but was just right for the sliding door model. For your CSG door which is 128 cm wide, you should use an offset of 0.64 on the X-axis instead.
  23. Yes - swinging door script. In any case, it works fine for the model I suggested above. Are you using your own custom model? If so, then I suggest you post it as all we can do without seeing the model is guess how to resolve the problem. Edit -- in my suggestion above, I am not using a pivot but rather just the door model itself.
  24. The only way i was ever able to load the animations properly into the base model was if the single animations were also skinned just like the base model.
  25. The sliding swinging door script comes with an 'Offset' property that allows you to set the pin's local position on the door. So for example, if you want the inherent model 'slidingdoor_left' to swing open at its side instead of its origin (which is at its bottom-center), then set the 'Offset' property to (-1.0,0.0,0.0).
×
×
  • Create New...