-
Posts
3,946 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by macklebee
-
Yes, you can open the zip but can you actually access any of the files? Try it. If it works like everyone else's zip file, it will ask for a password. EDIT -- gamecreator beat me to it.
-
FBX from MODO Cannot Be Picked Up?
macklebee replied to Monkey Frog Studio's topic in General Discussion
At the moment, I would say collision hulls are broken and probably have a lot to do with with the same thing that is happening here: A couple of things to note: - Your model can be picked up by setting the child mesh's mass to 1 but this breaks the physics and the collision hull will not move with it. (also requires the child mesh's gravity to be turned off) - Make sure you delete or at least don't export your modo directional light and camera when exporting the model (I don't think this is an issue but no reason to have these as children in the model) At the moment, I think would majority of people could get by with built in physics shapes being created, but if someone just has to have a custom shape before this issue gets fixed then: - Model custom shape (keeping in mind the origin of the actual model you are wanting to apply it towards). - Import in LE, view in asset browser, right-click and pick Generate Shape --> Polymesh or Convex Hull - Save the new PHY file as the same name as actual model that needs a custom physics shape - Place the actual model into scene and it will have your custom shape applied automatically. -
with inherent lua: http://www.lua.org/manual/5.1/manual.html#5.6 math.randomseed(Time:Millisecs()) myvariable = math.random(min,max) with LE functions: https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Random Math:SeedRandom(Time:Millisecs()) myvariable = Math:Random(min,max) In both cases, you need to set the minimum and maximum values (min & max) that the random number should be equal to or fall between. Just FYI - there is a search available in the upper right-hand corner of the forum that can allow you to search for stuff like this :
- 1 reply
-
- 2
-
function Script:PostRender(context) context:SetBlendMode(Blend.Alpha) context:DrawImage(self.imgHudPlayer,context:GetWidth()-200, context:GetHeight()-200,200,200) context:SetBlendMode(Blend.Solid) end
-
DXT1 compression does not store alpha. DXT3 will show alpha - but its all or nothing. DXT5 will show alpha in a full gradient from 0 to 1. Uncompressed texture will also show the alpha and is best for a GUI image. Read the documentation on compression as this information is available: https://www.leadwerks.com/learn?page=Tutorials_Editor_Textures
-
Test Objects From Blender Not Selectable in Viewports
macklebee replied to Monkey Frog Studio's topic in General Discussion
Its the same thing already reported in the second bug report posted above. Until Josh re-releases the fix that was done for it in 4.6, this will be an issue. -
Test Objects From Blender Not Selectable in Viewports
macklebee replied to Monkey Frog Studio's topic in General Discussion
What version of LE are you using? This sounds like previous bug reports that has been resolved if memory serves. -
The error tells you exactly the problem. You are trying to mathematically add something to a string in lua. In lua, concatenation is two periods not a plus sign. So your code should look like this: System:Print(nameRequest.." has been found!") https://www.lua.org/pil/3.4.html
- 2 replies
-
- 1
-
- arithmetic
- lua
-
(and 1 more)
Tagged with:
-
context:DrawText(string.format("%02d:%02d",hours,minutes), 40,175) will give your displayed clock time leading zeroes. EDIT -- gave a simplified version
-
Two things that I can see: 1) you are using the wrong blendmode and 2) not the textures I mentioned in the link. Also for the 100th time, if you do not post your files for us to try, we can only guess at what else you are doing wrong. Help us to help you.
-
hmmm... but in any case, try this: and for some reason, Josh has managed to break all the attachments at some point so here is the shader from that post: diffuse+normal+specular+cubemap.zip
-
Again, I can't speak for what you have because I do not have it. If you are using the standard monster AI script on the crawler, then it should work correctly just like the test that I did above. If you are using your own custom scripts for the AI and whatever you currently have for the minimap, then nobody but you probably has that exact setup. Provide an example project that shows the issue and someone may be willing to help troubleshoot.
-
If the minimap you are referring to was the simple shader and script version I posted and then Aggror added a sphere to it to check for nearby enemies, then the problem could be that the sphere is being set as a child to the player. Twice for some reason? If i had to guess what the problem was without testing it out, i would say its because the sphere is now a child of the player which the enemy AI script assumes the sphere is the player. The sphere is 50 meters in diameter. function Script:Start() self.miniMapSphere = Model:Sphere(8,self.player) -- by putting the player as the second parameter, you just set the sphere as a child to the player self.miniMapSphere:SetScale(50,50,50) self.miniMapSphere:SetPosition(self.player:GetPosition(true)) --Parenting the sphere to the player, means we dont have to update the position ourselves again. self.miniMapSphere:SetParent(self.player) -- this is duplicating setting the parent? self.miniMapSphere:Hide() end so what you can try is to remove the parenting and then update the position of the sphere in the Script:UpdateWorld() function. function Script:Start() self.miniMapSphere = Model:Sphere(8) self.miniMapSphere:SetScale(50,50,50) self.miniMapSphere:SetPosition(self.player:GetPosition(true)) self.miniMapSphere:Hide() end function Script:UpdateWorld() self.timer = self.timer + Time:GetSpeed() self.miniMapSphere:SetPosition(self.player:GetPosition(true)) --add this to update the position of the sphere if self.timer > self.timeUntilMinimapUpdates then self.timer = 0 self.enemyEntities = nil local AABB = self.miniMapSphere:GetAABB(1) --We pass along the entity that our current script is attached to world:ForEachEntityInAABBDo(AABB, "Callback", self.entity) end end If the above is not the latest and greatest code you are working from, then my apologies. This is just a guess since i don't have an easy way to test it out, but it may be worth a try to see if it resolves your issue. --EDIT: I just tested my theory above by placing a crawler with the standard monster AI script into a simple terrain scene in the editor. I changed the visual range to 5 meters. i then placed a player prefab in the scene about 30 meters away. Then I created a 50-m diameter CSG sphere with the invisible material. Placed the sphere's center at the location of the player and dragged the sphere in the scene browser to be a child under the player. Started the game and once the player moves a couple of steps toward the crawler, and it immediately starts to chase me. So it looks like my theory may be correct.
-
Eh actually its probably still important for users to understand that by having the sandbox disabled that it loads specific lua libraries that could be used to run unsafe code. Of course, it should be left up to the programmer to decide their needs, but without that option I do not think most people here would understand what was being enabled in the background. I personally like having the option.
-
Numbers not showing up on screen?
macklebee replied to havenphillip's topic in Leadwerks Engine Bug Reports
well, it does if you just redraw the gui base as shown in my above example... I don't know if that's necessarily a good thing or not or will cause a problem with something else, but it appears to get around the problem at the moment. also it works just fine when you don't have any gui elements... -
Numbers not showing up on screen?
macklebee replied to havenphillip's topic in Leadwerks Engine Bug Reports
The normal would be just 'context:DrawText("text",x,y)'. This version of DrawText() is not affected by the creation of gui element. But if you use 'context:DrawText("text",x,y,w,h,style)' and have created a gui element, it will be hidden - unless of course you redraw the gui base as shown in my example. So for whatever reason, the two versions of DrawText() react differently depending on whether a gui element exists. -
I could be wrong but I believe the tabber is an illusion of sorts that requires the programmer to create the effect of changing tabs by showing and hiding the other gui elements depending on which tab is selected. EDITED -- Added panels to allow for grouping of gui elements to make showing and hiding for the different tabs easier. example: local window = Window:Create("tabber example",0,0,400,300,Window.Titlebar+Window.Center) local context = Context:Create(window) local gui = GUI:Create(context) tabber = Widget:Tabber(20,20,300,150,gui:GetBase()) tabber:AddItem("Buildings1", true) tabber:AddItem("Buildings2",false) tabber:AddItem("Buildings3",false) panel0 = Widget:Panel(0,0,300,150,tabber) wbase = Widget:Button("Foundation",10,60,80,30,panel0) panel1 = Widget:Panel(0,0,300,150,tabber) wwall = Widget:Button("Wall",100,60,80,30,panel1) checkbox = Widget:Button("Checkbox",10,60,76,26,panel1) checkbox:SetString("style","Checkbox") panel1:Hide() panel2 = Widget:Panel(0,0,300,150,tabber) wroof = Widget:Button("Roof",190,60,80,30,panel2) panel2:Hide() while not window:KeyHit(Key.Escape) do if window:Closed() then return false end while EventQueue:Peek() do local event = EventQueue:Wait() if event.source == tabber then if event.data == 0 then panel0:Show() panel1:Hide() panel2:Hide() elseif event.data == 1 then panel0:Hide() panel1:Show() panel2:Hide() else panel0:Hide() panel1:Hide() panel2:Show() end end end context:Sync() end
-
With Turbo and its extreme lightning cowabunga speed capabilities , do you plan to have dynamic navmesh generation to be an available feature like shown in the early LE3 dev videos?
-
Numbers not showing up on screen?
macklebee replied to havenphillip's topic in Leadwerks Engine Bug Reports
So if that was the case, then shouldn't that also prevent just a normal DrawText() from appearing as well? Because it doesn't. Does the new DrawText() have a different drawing order than a normal DrawText()? -
Numbers not showing up on screen?
macklebee replied to havenphillip's topic in Leadwerks Engine Bug Reports
This above is what was needed to be provided to help troubleshoot. An example that demonstrates the issue. So from the looks of it, anything that uses the undocumented, new DrawText() with the extended parameters for centering within a given rectangle does not play well not just with the gamemenu script but any gui element you create. As a test I created a simple program that created a label and then just performed the new DrawText() version that was not part of the label/gui. The new version of DrawText() if not part of the gui for some reason will be hidden. So what I found is if I just simply redraw the gui's base whether its hidden or not, the new DrawText() will show properly. Example: window = Window:Create("Label Example",0,0,800,600,Window.Titlebar + Window.Center) context = Context:Create(window) world = World:Create() camera = Camera:Create() camera:SetPosition(0,0,-3) light = DirectionalLight:Create() light:SetRotation(35,35,0) box = Model:Box() box:SetColor(1,0.5,0,1) gui = GUI:Create(context) base = gui:GetBase() base:SetScript("Scripts/GUI/panel.lua") base:SetObject("backgroundcolor",Vec4(0,0,0,0.5)) colorlabel = Widget:Create("Example", 20, 20, 300, 80, base, "Scripts/GUI/Label.lua") colorlabel:SetString("align","Center") colorlabel:SetString("valign","Center") colorlabel:SetBool("border",true) gui:Hide() toggle = 0 clip = 10 Ammo = 100 counter = 1400 while not window:KeyHit(Key.Escape) do if window:Closed() then return false end box:Turn(Time:GetSpeed()*0.5,Time:GetSpeed()*0.3,0) if window:KeyHit(Key.Space) then toggle = 1 - toggle if toggle == 1 then gui:Show() else gui:Hide() end end Time:Update() world:Update() world:Render() context:SetBlendMode(Blend.Alpha) context:SetColor(1,0,0,.5) context:DrawText(string.format("Ammo1: "..clip.. " | " ..Ammo), 100, 80) context:DrawText("Press SPACE to toggle gui", 100, 300) context:DrawText(counter,38,30,300,300,Text.VCenter+Text.Center) context:SetBlendMode(Blend.Solid) --base:Redraw()--uncomment this and you will draw the new DrawText() version above context:Sync() end So based on that little example, all we need to fix the OP issue is to redraw the gamemenu's gui base. So if you add the redraw code to Menu.lua, it will draw properly everything in Jazz's example. So in the GameMenu:Update() function in the Menu.lua script, before it returns true, add the following code to line 480: gui:GetBase():Redraw() Edit -- this is admittedly a work around, but a fairly simple fix for something that Josh might not ever get around to resolving with DrawText() - especially since this version of DrawText() isn't officially documented. Edit-- Or if you don't want to edit the Menu.lua script, then in the example Jazz provided, just add this before the context:Sync(true): gamemenu.gui:GetBase():Redraw() and everything appears to be drawn properly. This should also fix the problem the OP is having if he adds it to the default Main.lua as well. -
Numbers not showing up on screen?
macklebee replied to havenphillip's topic in Leadwerks Engine Bug Reports
Both of those work fine, even though there is no reason to use 'string.format()' in your example. example: window = Window:Create("example",0,0,400,400) context = Context:Create(window) world = World:Create() light = DirectionalLight:Create() light:SetRotation(45,45,0) camera = Camera:Create() camera:SetPosition(0,0,-3) counter = 1400 toggle = 0 myfont = Font:Load("Fonts/arial.ttf", 24) context:SetFont(myfont) clip = 10 Ammo = 100 while not window:KeyHit(Key.Escape) do if window:Closed() then return false end if toggle==1 then counter = counter + 10 end if toggle==0 then counter = counter - 10 end if counter>=1400 then toggle = 0 end if counter<=10 then toggle = 1 end Time:Update() world:Update() world:Render() context:SetBlendMode(Blend.Alpha) context:SetColor(1,0,0,.5) context:DrawRect(38,30,300,300,1,30) context:DrawText(string.format("%.0f",counter),38,30,300,300,Text.VCenter+Text.Center) context:SetColor(1,1,1,1) context:DrawText("Ammo: "..clip.. " | " ..Ammo, 20,108) context:DrawText(string.format("Ammo: "..clip.. " | " ..Ammo), 20, 248, 300, 50, Text.VCenter+Text.Center) context:SetBlendMode(Blend.Solid) context:Sync(true) end At this point, you really need to provide something that we can try that replicates your issue. There is a reason no one has replied to your post - there's not enough information provided for anyone to do anything other than guess at what you are doing wrong. Actually provide a simple example that shows the problem that people can try and more than likely someone can help you. -
Post something that will allow us to replicate the problem - the map, the project, the materials, etc. anything. Without an example to test, all we can do is guess at what the problem could be. Edit: Since you provided nothing to let us test, I would guess that your issue is that the light is being blocked by a model / player. The spotlight shown is not the standard flashlight image obtained from the standard player model and script. So are we to assume you are using your own player model and script with a custom light?
-
Short answer: No. As it stands, the vegetation paint tool was meant for placement of thousands of static models not prefabs into a scene. Long answer: There may be things that could be done as a work around for what you want. Explain what these scripts you are wanting to attach to the trees and rocks would do. Example of affecting painted vegetation in a scene with a script from the old LE2 days: