Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. does not matter if its started from steam or via a shortcut - same results. Edit -- went through the steps listed here: https://support.steampowered.com/kb_article.php?ref=9764-IJVM-3291 and its allowing me to start stop the Leadwerks app without having to end the Steam process manually. Not quite sure which one fixed the problem as I did not test in between -- half asleep, but Solved!
  2. For the last couple of weeks, I have had to use the task manager to shut down steam because Leadwerks is not properly shutting down when closed. Steam reports Leadwerks as still running even though no Leadwerks application is running. This prevents starting Leadwerks until I stop/restart Steam. This does not occur with other Steam apps/games. I get the same issue in the beta and archived versions. Another person appears to be having the same issue as me: http://www.leadwerks.com/werkspace/topic/13833-leadwerks-not-launching-from-steam/#entry95562
  3. The earlier versions of LE3 used App.lua which included the App class with the App:Start() and App:Loop(). That was later removed as a requirement and now the main lua script is just Main.lua without the App class. My guess is that you are using the Main.lua script as your main script, so that means the App.context does not exist. I would change this line: self.screenWidth = App.context:GetWidth() to these two lines: local context = Context:GetCurrent() self.screenWidth = context:GetWidth() or to this combined one-liner: self.screenWidth = Context:GetCurrent():GetWidth()
  4. You are going to have to give more information than that. Please post the script in question that is causing the error. While Jorn's videos are probably top notch, please be advised these are 3rd party scripts/video tutorials that are not officially supported by Leadwerks. So if you are having problems, its best to post the code along with the description of the problem. In any case, anytime you see the error 'index field 'xxxxxx' (a nil value)', it typically means that 'xxxxxx' has not been defined prior to you trying to use any of its associated class methods/functions.
  5. I am having similar issues lately as steam reports leadwerks as still running after I used it and try to run LE again. I have to close Steam by using the task manager (since it will not close steam by normal means since its waiting for LE to close) and restart steam. This lets me restart LE successfully. But then the problem starts all over again.
  6. Remove the jpg and/or png from the zip file. The preview image can only be jpeg/jpg. And according to the workshop publishing tutorial: "Note that only Leadwerks asset file formats can be included in your zip file." That means only assets that are *.tex, *.mat, *.mdl, *.pfb, *.lua, *.shader, etc... should be included in the attached zip file.
  7. You can read but you can't write files when its enabled. Only certain commands of FileSystem will not work when sandbox mode is enabled - writing files, creating files/directories, copying files/directories, deleting files/directories... all for obvious reasons. But just reading files and directory paths is still allowed. Hence why reepblue's code with FileSystem:StripDir() will work with sandbox enabled.
  8. FileSystem is a Leadwerks class so it will work in sandbox mode. The sandbox mode prevents the inherent lua modules like IO, OS, or file from working. My guess is that it doesn't load these packages/modules if in sandbox mode.
  9. Yes, it can be done with just lua because that's all i have. When I get a chance sometime this week (probably the weekend), I will shoot you a PM with my messy un-optimized code showing how I did exactly what you are describing. And btw the buffer class is exposed to lua. http://www.leadwerks.com/werkspace/topic/10171-buffer-commands-exposed-to-lua-with-documentation/#entry75328 Refer to any of the post-process shaders in the workshop with lua scripts (or the screen distortion shader I showed above) and you will see references to the buffer class.
  10. @wchris - not sure if I understand what you exactly asking for but for the screen distortion shader I posted in the forum, I pass a texture with a defined pattern to the post process shader and then distort the rendered world buffer based on its pattern. http://www.leadwerks.com/werkspace/topic/12886-more-overlay-type-shaders-please/#entry92116
  11. hmmm... dunno. I cannot get it to not crash with your scripts. Even reworking the scripts to have the vehicle built within the Start function (because it must be done before the next call to World:Update()) just causes another glitchy behavior whereas the player falls through the scene on scene startup. If I do not build the vehicle then no issues (no falling through the map, no crashes, changes maps ok). If I build the vehicle, player falls through the map immediately.
  12. i tested it in debug and it crashes with one or two scripts attached.
  13. Agree with seeing a running example that can be tested but what I question is the code in the Script:Detach() function as well. You are releasing each tiremodel and setting them to nil, but then afterwards you are performing 'ReleaseTableObjects(self.tiremodel)' on something that has already been released. I would say do one or the other but not both. Also, along the same lines but directed more at Josh: Looking through all of the inherent entity script examples, I see Script:Release() instead of Script:Detach(). Are these interchangeable or are these two separate functions that should be used only for specific reasons? --Edit - Josh says they are interchangeable.
  14. macklebee

    Vegetation Update

    The shader is there but its in a different folder. The materials for the grass, bush, and tree lists the leaves.shader in the Shader/Model folder, but its actually in the Shader/Vegetation folder. Make the changes to those materials and the errors go away. I assume thats due to number and size of the shadows that are created.
  15. "Needs more pouches!" - Rob Liefeld Looks good - are the animations/skeleton going to be custom as well or from a standard rig like you would get from mixamo or other provider? Thinking about future uses when wanting to rig other characters with its rig/animations or vice versa.
  16. I have seen 8192x8192 used in previous versions of LE but it really has more to do with how many textures and what an individual graphics card can handle. In any case, why are you necro-posting - especially on a post that has nothing to do with your question? Just start your own thread.
  17. er... you still are creating the bullet in that function? Place that bit of code in the Script:Start() function as 'self.bullet = Model:Box()', scale it, set the pickmode, and hide it. Then instance the self.bullet in the Script:Shoot() function.
  18. You would make this a lot easier for anyone willing to help you if you posted the model with its entity script. Just providing the script doesn't allow anyone to easily test the code especially when the model's submeshes inherent orientation may be screwing up the math if they are not aligned to the global axis. But just a quick look at the script, I see a couple of issues. First, you are missing out on the whole reason to use instancing since you are creating a new bullet each time the Script:Shoot() function is called. Create and Hide the bullet in the Script:Start() function and then instance that in the Script:Shoot() function. Second, I replied in your previous post yesterday about this same topic on how to do physics bullets. You are not doing either of the two ways I showed how it could be accomplished. Either calculate the forces on the global axis required to make the bullet shoot in the right direction or set the bullet's position/rotation in relation to the turret's/muzzle's local axis position/rotation and apply a force to the bullet on its Z-axis.
  19. When one does not give enough information or assets for others to use, you get simple examples that may or may not resolve their issue based on what assumptions we have to make. Anything that is shown in a simple main.lua script can be worked into an entity script. Is there a particular reason why the bullet/shooting would be attached to a pivot? Why would you not have the bullet/shooting code as part of the turret tracking script? Are you wanting a raycast or an actual physics bullet? If a physics bullet, there are a couple of ways to make the bullet move in the direction of the target. Above I show how to calculate the forces to control the angle that the bullet will go with the assumption that the turret just rotates solely around the Y-axis. You can also go about it another way: set the position/rotation of the bullet on the local axis of the turret, and then just apply a force in the local +Z-axis direction. See here for an old LE2 example of that: http://www.leadwerks.com/werkspace/topic/2542-bullet-help-wanted/#entry23432 If a raycast bullet, then I suggest just using a simple World:Pick() between the end of the turret and the target.
  20. small example: 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() bigfont = Font:Load("Fonts/arial.ttf", 48, 1) toggle = 0 while window:KeyDown(Key.Escape)==false do if window:Closed() then break end box:Turn(Time:GetSpeed()*0.5,Time:GetSpeed()*0.5,0) if window:KeyHit(Key.Space) then toggle = 1 - toggle end if toggle==0 then context:SetFont(lilfont) else context:SetFont(bigfont) end Time:Update() world:Update() world:Render() context:SetBlendMode(Blend.Alpha) context:DrawText(string.format("FPS: %.2f",Time:UPS()),0,10) context:DrawText("HIT SPACE",0,80) context:Sync(true) end
  21. just a simple example of a turret tracking and shooting window = Window:Create("Example",0,0,800,600) context = Context:Create(window) world = World:Create() camera = Camera:Create() camera:SetPosition(0,7,0) camera:SetRotation(90,0,0) light = DirectionalLight:Create() light:SetRotation(45,45,0) ground = Model:Box(10,1,10) ground:SetPosition(0,0,-0.5) ground:SetColor(0,1,0,1) base = Model:Cylinder(16) base:SetColor(0,0,1,1) base:SetPosition(4,1,4) base:SetPickMode(0) turret = Model:Box(base) turret:SetScale(0.1,0.1,1) turret:SetColor(1,0,0,1) turret:SetPosition(0,0.5,0.5,false) firespot = Pivot:Create(turret) firespot:SetPosition(0,0,1,false) bullet = Model:Box() bullet:SetScale(0.1,0.1,0.1) bullet:SetPickMode(0) bullet:Hide() target = Model:Sphere(16) target:SetColor(1,0.5,0,1) target:SetPickMode(0) pickinfo = PickInfo() time = Time:Millisecs() function PerfectAngle(pos1,pos2) local dx, dz dx = pos2.x - pos1.x dz = pos2.z - pos1.z return Math:ATan2(dx,dz) end while window:KeyDown(Key.Escape)==false do if window:Closed() then break end mousepos = window:GetMousePosition() if camera:Pick(mousepos.x,mousepos.y,pickinfo,0,true,0) then target:SetPosition(pickinfo.position + Vec3(0,1,0)) end perfectangle = PerfectAngle(base:GetPosition(true),target:GetPosition(true)) currentangle = base:GetRotation(true).y angle=Math:IncAngle(perfectangle,currentangle,5/Time:GetSpeed()) base:SetRotation(0,angle,0,true) if Time:Millisecs() > time + 500 then bullets = bullet:Instance() bullets:SetPosition(firespot:GetPosition(true)) bullets:Show() bullets:SetMass(1) force = Vec3(2000*Math:Sin(angle),0,2000*Math:Cos(angle)) bullets:AddPointForce(force,firespot:GetPosition(true),true) time = Time:Millisecs() end Time:Update() world:Update() world:Render() context:Sync(true) end
  22. http://www.leadwerks.com/werkspace/topic/12081-installing-dlc-instructions/ http://www.leadwerks.com/werkspace/page/tutorials/_/workshop-r11#section2
  23. you cannot use 'self' inside the callback function as there is nothing to refer to... try using 'Script.target' instead of 'self.target'
  24. hmmm - i must have super secret double permission cuz they work just fine for me.
  25. assume the same as in LE2: terrain:GetHeight(x,y) - Retrieves relative height - returned as a value between 0 and 1 terrain:GetElevation(x,y) - Retrieves the terrain height at the specified position. The height will be interpolated between the nearest 4 grid points to provide a very close estimation of the terrain height at any given position.
×
×
  • Create New...