Jump to content

Andy90

Developers
  • Posts

    219
  • Joined

  • Last visited

Everything posted by Andy90

  1. I think it has something to do with the model. After I fixed the issue on the zombie model today, the hit registration on it is now perfect. It might be due to the surface size.
  2. Thanks for the anwesers. i will check this yeah i set a boolean variable to true within the method and set it to false within UpdatePhysics. So at the moment its working fine.
  3. Thank you, this is very helpful. I believe I've properly configured the parameters in my pick function to acquire the closest target. However, there's a chance I may have misunderstood something. self.cam:Pick(p.x, p.y, pickinfo, pickradius, true, Collision.Prop) ----- I also edited the model a bit because at some parts of the body was no hit registration. So i added some spheres and asign them an invisible hitbox material. Works great so far
  4. I got another problem with pick. It seems pick is ignoring animations. Without animation with the idle animation
  5. ah ok i dont know this. Its a nice feature
  6. Hello :), I believe that incorporating widgets and plugins for the new engine would be a fantastic addition. This would enable users to customize and enhance their workflow with personalized "features" and also allow for easy sharing within the community. For instance, if you wish to generate random elements within a scene, you could design a custom widget for the right tab bar. This widget could be programmed to create these elements and seamlessly integrate them into the active scene. Another example could be the implementation of a "road" tool designed to efficiently construct roads.
  7. Some Ingame footage here also check out the first dev diary from the game
  8. Hello I would like to inquire if it's possible to use an Lua function to determine if one entity collides with another. My objective is to verify whether the player remains within a trigger area. At present, I accomplish this by setting a boolean variable to true in the event of a collision with the player using Script:Collision. Then, in Script:UpdatePhysics(), I repeatedly reset this variable to false.
  9. Here is my effect manager script. It's really simple to use. Just create a pivot in your map and add the script. Then assign your camera to the script. Script.effects = {} Script.camera = nil --Entity "Camera"; function Script:Start() self:AddEffect("bloom", "Shaders/PostEffects/bloom.lua", true) self:AddEffect("ssao", "Shaders/PostEffects/ssao.shader", true) self:AddEffect("godrays", "Shaders/PostEffects/godrays.lua", true) self:AddEffect("grayscale", "Shaders/PostEffects/grayscale.shader", false) self:BuildEffectChain() end --Adds a new effect to the effect chain function Script:AddEffect(name, file, enabled) local effect = { name = name, file = file, enabled = enabled } table.insert(self.effects, effect) if enabled then self:BuildEffectChain() end return #self.effects + 1 end --Disables the effect at position n function Script:DisableEffect(index) if self.effects[index].enabled == true then self.effects[index].enabled = false self:BuildEffectChain() end end --Enables the effect at position n function Script:EnableEffect(index) if self.effects[index].enabled == false then self.effects[index].enabled = true self:BuildEffectChain() end end --Returns the effect index with the given name function Script:GetEffectIndex(name) for i, item in ipairs(self.effects) do if item.name == name then return i end end end --Returns the effect with the given name (untested) function Script:GetEffect(name) local effectIndex = self:GetEffectIndex(name); return self.effects[effectIndex]; end -- Rebuils the effect chain function Script:BuildEffectChain() self.camera:ClearPostEffects() for i, item in ipairs(self.effects) do if item.enabled then self.camera:AddPostEffect(item.file) end end end You can call the functions from the script when you assign the pivot as the entity. For example: and use local effectIndex = self.effectManager.script:GetEffectIndex("grayscale"); self.effectManager.script:DisableEffect(effectIndex);
  10. oh ok so in this case i write an effect manager script. I will share it tomorrow here if anyone else needs it.
  11. Hello, i want to ask how i can remove a single post effect from the camera with lua. I was looking in the documentation but there is only a function to remove all.
  12. Thanks i starting to read all the tutorials i think if im able to create own shader in leadwerks and afterwards in ultimate it would be realy helpful.
  13. yeah i know. I just want know if its possible to pay with paypal because i dont have a credit card.
  14. Is it possible to buy the non steam version with paypal ?
  15. Hello the camera pick is working realy wired for me. You can see it within the video 2023-09-30 02-36-14 (streamable.com). This is my code function Script:Shot() --Create a sphere to indicate where the pick hits local pickradius = 0.1; picksphere = Model:Sphere() picksphere:SetColor(1.0, 0.0, 0.0) picksphere:SetPickMode(0) picksphere:SetScale(pickradius * 2.0) picksphere:Hide() picksphere:Hide() local pickinfo = PickInfo() local p = window:GetMousePosition() if (self.cam:Pick(p.x, p.y, pickinfo, pickradius, true, Collision.Prop)) then picksphere:Show(); picksphere:SetPosition(pickinfo.position); local name = pickinfo.entity:GetKeyValue("name"); pickinfo.entity:Hide(); System:Print(name); end end
  16. Hello i want to ask if there is any tutorial to create own shaders with GLSL in Leadwerks?
  17. Hello, I apologize for all these questions, but could you please guide me on how to remove an entity while the game is running? Specifically, when the player picks up an item, I'd like it to be deleted from the world. Thank you!
  18. First Weapon will come into the game today
  19. Ah, that's fantastic! I'm eager to start working with the Ultra Engine soon. It seems like an incredibly robust platform for game development. I'm particularly impressed by the incorporation of AI features. Artificial Intelligence is undoubtedly the next frontier. Perhaps it might also be worth considering the possibility of implementing AI to assist in script creation. During my design study, many people struggled with programming. A feature like this could be really helpful for them.
  20. I found another solution which could improve the performance when you have more than 1000 entities in your scene. With the new solution, you won't need to iterate through all entities anymore. Instead, we'll create an EventHandler Script where we can register widgets with callback methods. When a widget is clicked, it will trigger the specified function. Let's start by creating the EventHandler. In this new file, we'll create a table called "EventHandler" and two functions: "EventHandler:AddListener" function which adds a new listener to the EventHandler, and the "EventHandler:ProcessEvent" function which gets called when an event is triggered. 1. EventHandler.Lua EventHandler = {} function EventHandler:AddListener(widget, callback, parent) listener = { widget = widget, callback = callback, parent = parent }; table.insert(self, listener); end function EventHandler:ProcessEvent(event) for _, listener in ipairs(self) do if event.source == listener.widget then listener.callback(event, listener.parent); end end end As you can see, the EventHandler:AddListener function takes three parameters: the widget that triggers the event, the callback function to execute when the event is triggered, and the parent script. 2. Implementing the EventHandler To implement the EventHandler, you'll need to import it within the main.lua file. import("Scripts/Menu.lua") import("Scripts/EventHandler.lua") --this is our script within the main.lua After this step, we will modify the EventQueue within the main.lua file. It should look like this afterwards: while EventQueue:Peek() do local event = EventQueue:Wait() event = gamemenu:ProcessEvent(event) -- Here the Event Handler Process EventHandler:ProcessEvent(event); end 3. Using the EventHandler for your widgets After creating and implementing the EventHandler, it's time to use it for your widgets. Let's create a button widget and add a listener to the EventHandler. -- Create a ui and add a listener to the EventHandler for the button click function Script:CreateInventory() inventoryUI = Widget:Panel(10, 10, 300, 500, base) x = 20 y = 20 local sep = 20 label = Widget:Label("Items:", x, y, 300, 14, inventoryUI) y = y + sep itemList = Widget:ListBox(x, y, 260, 300, inventoryUI) y = y + 300 + sep btnDrop = Widget:Button("Drop", x, y, 260, 26, inventoryUI) -- add your listener for the btnDrop here. EventHandler:AddListener(btnDrop, DropButtonClick, self); y = y + sep inventoryUI:Hide() end -- this is the function which gets called when the button get clicked. function DropButtonClick(event, parent) System:Print(parent.player:GetPosition()); end
  21. Okey i figured out the problem and how to fix it. It might be usefull for some other people so i post my solution. First of all i found this post this means you can have only one event queue. There is allready one within the main.lua. If you want process the events within multiple scripts you need to edit the event queue like this Main.lua --Update events while EventQueue:Peek() do local event = EventQueue:Wait() event = gamemenu:ProcessEvent(event) -- Own Event Callbacks paste the following bellow for x = 0, world:CountEntities() - 1 do local entity = world:GetEntity(x); local entityScript = entity.script; if entityScript and entityScript.ProcessEvent then entityScript:ProcessEvent(event); end end end with this edit the main loop will iterate all entitys in your map and checks if the entity has a script attached and if the script have the "ProcessEvent" function. If this statement true it will call the ProcessEvent function within this script and sets the event message as parameter. So you can now insert this function in your scripts and handle events in diffrent scripts like this Example Script attached to an entity function Script:ProcessEvent(event) System:Print(event.source); if event.source == btnDrop then System:Print("Hello Button Event!"); end end
  22. This is my code but nothing happesn function CreateInventory() inventoryUI = Widget:Panel(10, 10, 300, 500, base); x = 20; y = 20; local sep = 20; label = Widget:Label("Items:", x, y, 300, 14, inventoryUI); y = y + sep; itemList = Widget:ListBox(x, y, 260, 300, inventoryUI); y = y + 300 + sep; btnDrop = Widget:Button("Drop", x, y, 260, 26, inventoryUI); btnDrop.onclick = function() System:Print("hello"); end y = y + sep; inventoryUI:Hide(); end function Script:Start() CreateInventory() end function Script:UpdateWorld() if (window:KeyHit(Key.I)) then if (inventoryUI:Hidden()) then inventoryUI:Show() mousePos = window:GetMousePosition() self.player.script.canMove = false window:ShowMouse() else inventoryUI:Hide() window:SetMousePosition(mousePos.x, mousePos.y) self.player.script.canMove = true window:HideMouse() end end while EventQueue:Peek() do local event = EventQueue:Wait() if event.source == widget then print("OK!") end end end
  23. Hello, i want to ask how i can run a script when a widget button get clicked ?
  24. Hello, i want ask if its possible to snap an entity to an pivot ? For example i got multiple weapons and want switch them?
×
×
  • Create New...