-
Posts
219 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Andy90
-
For some reasons its also not possible to create a NavMesh wich is a bit bigger. I try it with this->nav_mesh = CreateNavMesh(entity->GetWorld(), 5, 16, 16); this->nav_mesh->SetPosition(0, 0, 0); this->nav_mesh->Build(); and get the following result Error: dtNavMesh::addTile failed it Prints this output multiple times. If i do the NavMesh with 8x8 its fine.
-
-
-
Sorry for the delayed response. I usually aim to release dev diaries on a weekly schedule, but I've been unwell for the past few days. The next dev diary will be released this Sunday.
-
Well when it comes to multiplayer you can create a own service. Since you can use c++ scripts. And you can also do some bigger projects if you have a look at my project. I think @Josh is creating guides for FPS games because its more easy for beginners.
-
Hello, Since the vegetation hasn't been completed yet, it might be a great addition to have the option to exclude it from different paint layers. For example, I'm currently working on painting roads, and it would be beneficial if the grass, doesn't appear where these textures are applied. You can observe this in the screenshot. Im not sure how difficult this would be.
-
New sunday new dev diary
-
This looks like a fun game
-
Hello, after some development, my game has been growing quite well. With the expansion of the game, the number of UI "windows" has also increased. To effectively manage all these windows or widgets, I've decided to create a simple script that will handle them. The script includes a table with the information about each "window" and several functions: HideAll(): This function hides all managed windows. AddWindow(widget, show_callback, hide_callback): This function adds a window to the table. The parameters are straightforward. widget refers to the created widget, show_callback is a function that is called whenever the manager opens this window, and hide_callback is called whenever the manager closes the window. It will also return the window ID for the added widget. Show(id): This function displays the window with the specified window ID (which you received from the AddWindow function). Hide(id): It hides the window with the given ID (which you received from the AddWindow function). IsAnyWindowOpen(): This function checks if any window is open. WindowManager.lua WindowManager = {} function WindowManager:AddWindow(window, show_callback, hide_callback) table.insert(self, { Widget = window, OnShow = show_callback, OnHide = hide_callback }) return #self end function WindowManager:HideAll() for _, item in ipairs(self) do if not item.Widget:Hidden() then item.Widget:Hide() item.OnHide() end end end function WindowManager:Show(index) self:HideAll() self[index].Widget:Show() self[index].OnShow() end function WindowManager:Hide(index) if self[index] ~= nil then if not self[index].Widget:Hidden() then self[index].Widget:Hide() self[index].OnHide() end end end function WindowManager:IsAnyWindowOpen() for _, item in ipairs(self) do if not item.Widget:Hidden() then return true end end return false end Implementation the Script Just include the script file within your main lua. For example import("Scripts/Own/WindowManager.lua") Adding a widget self.panel = Widget:Panel(10, 10, 600, 500, base) self.windowID = WindowManager:AddWindow( self.panel, function() self:ShowUI() end, function() self:HideUI() end ) I hope this can help someone maybe @Josh can create a new forum category for source codes which other users can use.
-
Leadworks as Game Engine for Commercial Projects ?
Andy90 replied to Andy90's topic in General Discussion
Well Leadwerks is still a good engine. You still can make good games with it. -
Ah, okay, this makes sense. I'm relatively new to shaders. It's a fascinating aspect of game development, so I'm trying to grasp what's happening rather than just copying and pasting. I believe that being able to create your own shaders is a significant skill that opens up a world of possibilities. Thanks all again for your help.
-
Wow, this looks perfect. Thank you so much. Do you happen to know why there were artifacts? Was it due to the texture?
-
sure here he is. RainShader.zip
-
Seems to work now...at least a bit. But there are some artifacts wich looking not that good at all Do someone knows why ?
-
Okey i miss the noise texture. So in this case i need to create the shader itself and a lua post effect wich loads the noise texture in the shader itself right? But how can i set the texture? I searched within the documentation but there is nothing to set a texture.
-
I made this tutorial but my shader ist just black Fragment Shader #version 400 out vec4 fragData0; uniform vec2 buffersize; uniform float currenttime; uniform sampler2D texture0; void main() { vec2 q = gl_FragCoord.xy/buffersize.xy; vec2 p = -1.0+2.0*q; p.x *= gl_FragCoord.x/buffersize.y; vec3 col = vec3(0.0, 0.0, 0.0); // Rain vec2 st = p * vec2(.5, .01)+vec2(currenttime*.3-q.y*.6*-0.0, currenttime*.3); float f = floor(mod(currenttime/9., 2.0)); f = texture(texture0, st).y * texture(texture0, st*.773).x * 1.55; f = clamp(pow(abs(f), 23.0) * 13.0, 0.0, q.y*.14); col += f; fragData0=vec4(col, 1.0 ); } Vertex Shader #version 400 uniform mat4 projectionmatrix; uniform mat4 drawmatrix; uniform vec2 offset; uniform vec2 position[4]; in vec3 vertex_position; void main(void) { gl_Position = projectionmatrix * (drawmatrix * vec4(position[gl_VertexID]+offset, 0.0, 1.0)); } and here is the source Simple rain (shadertoy.com)
-
I think a context menu widget is an realy helpfull widget for gui's. I created a script to create one. I will post it in case some needs it 1. Context Menu Script Script.itemHeight = 22 --Height of the menu entry Script.hovered = false --Is hovered variable Script.menuItems = {} --The menu items as table Script.padding = 2 --The padding between the menu entrys --Shows the context menu function Script:ShowContextMenu(x, y) self:HideContextMenu() local sz = self.widget:GetSize(true) local height = self:CalculateHeight() self.widget:SetLayout(x, y, sz.width, height) self.widget:Show() self.widget:Redraw() end --Hides the context menu function Script:HideContextMenu() self.widget:Hide() self.widget:GetParent():Redraw() end --Sets new context menu items function Script:SetContextMenuItems(contextMenuItems) self.menuItems = contextMenuItems self.widget:Redraw() end --Calculates the height of the context menu function Script:CalculateHeight() return (#self.menuItems * self.itemHeight) + (#self.menuItems * self.padding) + self.padding end --Renders the context menu function Script:Draw(x, y, width, height) local gui = self.widget:GetGUI() local pos = self.widget:GetPosition(true) local sz = self.widget:GetSize(true) local fontHeight = gui:GetFontHeight() local height = self:CalculateHeight() local iX = pos.x + self.padding local iY = pos.y + self.padding local iWidth = sz.width - (self.padding * 2) gui:SetColor(0.145, 0.145, 0.145) gui:DrawRect(pos.x, pos.y, sz.width, height, 0) gui:SetColor(0, 0, 0) gui:DrawRect(pos.x, pos.y, sz.width, height, 1) for _, item in ipairs(self.menuItems) do local centerX = (iX + sz.width) / 2 local textX = centerX - (gui:GetTextWidth(item.Text) / 2) local textY = (iY + (self.itemHeight / 2)) - ((gui:GetFontHeight() / 2) - self.padding) if self:IsItemHovered(iX, iY, iWidth, self.itemHeight) then gui:SetColor(0.075, 0.075, 0.075) item.Hovered = true else gui:SetColor(0.175, 0.175, 0.175) item.Hovered = false end gui:DrawRect(iX, iY, iWidth, self.itemHeight, 0) gui:SetColor(1, 1, 1) gui:DrawText(item.Text, iX + self.padding, textY, iWidth, self.itemHeight) iY = iY + self.itemHeight + self.padding end end --Returns the hovered item function Script:GetHoveredItem() for _, item in ipairs(self.menuItems) do if item.Hovered then return item end end return nil end --On mouse enter event function Script:MouseEnter(x, y) self.hovered = true self.widget:Redraw() end --On mouse leave event function Script:MouseLeave(x, y) self.hovered = false self.widget:Redraw() end --On mouse down event function Script:MouseDown(button, x, y) if button == Mouse.Left then self.widget:Redraw() end end --On mouse up event function Script:MouseUp(button, x, y) if button == Mouse.Left then if self.hovered then EventQueue:Emit(Event.WidgetAction, self.widget) local selectedItem = self:GetHoveredItem() if selectedItem ~= nil then selectedItem.OnClick(selectedItem) end self:HideContextMenu() end self.widget:Redraw() end end --On mouse move event function Script:MouseMove(x, y) self.widget:Redraw() end --Check if a item is hovered function Script:IsItemHovered(x, y, width, height) if self.hovered then local mousePos = Window:GetCurrent():GetMousePosition() if mousePos.x > x and mousePos.y > y and mousePos.x < x + width and mousePos.y < y + height then return true end end return false end 2. Intial the widget self.contextMenu = Widget:Create("", 15, 15, 150, 64, base, "Scripts/Own/GUI/ContextMenu.lua") local menuItems = { { Text = "Unequip", OnClick = function() System:Print("Unequip Item") self.ivEquipItem3.script:ClearItem() self.Tool = nil end }, { Text = "Repair Item", OnClick = function() System:Print("Repair Item") end } } self.contextMenu.script:SetContextMenuItems(menuItems) self.contextMenu.script:HideContextMenu() 3. Open the context menu widget function IvEquipItem3Click(event, parent) local mousePos = window:GetMousePosition() parent.contextMenu.script:ShowContextMenu(mousePos.x,mousePos.y) end
-
This would be great.
-
New Dev Diary is online: Its including the following things: Items in the inventory can now stack Implementet Tree Spawner and Harvesting System Implementet Object Spawner Implementet Stone Spawns Implementet Bushs Spawns Implementet the player crafting menu Implementet the building menu Changes to the Terrain height and the level design POI: Abandoned Summercamp
-
Sure, I unchecked the option to include only used files in the zip. Now it's working. By the way, it's an encrypted zip, correct? This is important to me because I use some TurboSquid models, and they require that the model itself isn't accessible as a file.
-
Hello i made todays a first test with a standalone version. For some reason the game is crashing while the world get loaded. Is there some error log?
-
nono i dont want collapse a prefabs this is the point. Im bad in explaining its more to create a simple model from a collection.
-
Yes sure but is it possible to collapse the prefab to one entity ?
-
Yes I know and I find this tool great. I mean the create model function a little differently. Let's say we have a house. In this house we add other entities like a table, sofa etc and set the house as parent for these entities and the function should now make a model out of this collection. With the house and its content.
-
I mean within the editor. So you select a node and have a context menu entry. Like the "Create Prefab" function in Leadwerks.