Jump to content

Slimwaffle

Members
  • Posts

    245
  • Joined

  • Last visited

Everything posted by Slimwaffle

  1. Hey guys I was working on a new inventory system for my game. And I was just wondering before I get too in depth with it. Is there a better or easier way I should be doing it? Because I can see where its going in my head and it just seems like a lot of code. I will attach the script and a small video here so you can get the basic idea of where I am going with it. Basically I want to be able to click and move everything from slot to slot. And the only info I can find on leadwerks is for systems that are a little more basic in functionality. 2018-12-30_17-30-04.mp4 Inventory.lua
  2. I am still getting this error and so are my players. I am using the live version of leadwerks not the beta.
  3. We also still need a fix for the resolution problem and higher end graphics cards.
  4. Never mind Josh has fixed this in the beta already. In the beta the SetText() command works exactly as you would expect.
  5. So the only option I can see to make this somewhat work is possibly creating a blank square and then a label over the top. To make it look like a textarea. Because SetText on a label does exactly what it is supposed to do. Its just a shame because a clear text command is really badly needed.
  6. No you can't and this is part of the problem. So SetText doesn't work like java's Set and append. It doesn't matter if you use SetText or AddText it will always add it under existing text and Setting empty text just creates an empty line. And the Scroll bar always stays at the top even though new text is added to the bottom. So to prevent the player from having to scroll through walls of text to see if an item is created or not. I want to be able to clear the Text before setting it again.
  7. Hey Guys I need a way to remove the text from a textArea before setting it again. I am using lua. Can anyone please help? I have checked everywhere possible and can't find a solution.
  8. Thanks mate that looks like a way better way of doing it
  9. Hey guys. I was looking on the forums to find a way to center a drawn image. Couldn't find a solution. I figured it out and then thought hey this might be useful. So I am going to post some code here. You guys might find easier ways to do this. But whatevs hope this helps someone. local a = self.player.script.stamina local b = self.player.script.maxstamina local d = self.staminaBarColor local e = a / b local sx = 70 local sy = 10 local hbc = self.staminabarbackColor local ix = 105 local iy = 5 local c1 = 90 * e local ix2 = ix + (90 - c1) / 2 local iy2 = iy + (90 - c1) / 2 --Background Square context:SetColor(0.2,0.2,0.2,1) context:DrawRect(105, 5, 90 , 90) context:SetColor(1,1,1,1) context:DrawImage(self.run ,ix2, iy2, c1 , c1)
  10. Hey guys and girls So in preparation for 4.6 and multiplayer functionality to leadwerks. I have been thinking about my game and how to prep it. I have decided to use the existing FPS script but add a character model and animations for walking crouching running etc. What I want to know is that when it comes to the weapons, is there a way to do this where the weapons are a child of the character? So that way I can keep the existing fps code and just remove the arms from the weapons models and then just position the guns as children of the characters hands or arms. Are there any examples of something similar being done before? Also when the multi player stuff is added will there be a function like update world that works for the multiplayer calls?
  11. So if I wanted to create a second GUI that doesn't use the menu or a background panel I would have to put the if events for the second GUI in the menu script?
  12. So instead of gui:GetBase(). I would use context?
  13. So I am able to successfully create widgets inside the menu. But is there a way to create them directly on to the player camera?
  14. This was very similar to the first method I tried. What I figured out is that no matter what you do each armature is treated as a separate animation. I wanted to keep the gun and hands in their original forms when combining them to be able to separate the textures over two objects (so I could keep the original textures). What I decided to do in the end was keep the bones for the hands (to allow posing) and remove all the bones from the gun. Then when I did the animations I was able to pose the hands and move them. Then add all the separate parts of the gun and movements using object mode movement and rotations. I still ended up with the same result and was able to do everything as a single animation because there is only one armature.
  15. Does anyone have any experience animating with blender? I have a gun and fps hands model each made separate. I want to create a animation that combines the two. So far I have them combined fine and able to assign original textures inside leadwerks to each part. The problem is that my gun model has loose parts each with its own armature. I tried making an animation in blender that moves the trigger, hammer and the fingers. When I added the animation model to leadwerks it gave me 4 separate animations. Is there a way to combine these animations? I just used a basic one that uses bone rotation and key-framing.
  16. Thanks I will give it a try and let you know how I go
  17. I had this issue a while back and got help finding a fix. I will link the forum for you.
  18. Yeah that was one of the first ones I read.
  19. If I don't set it to red then it just shows grey squares instead.
  20. The material and texture are the default ones for wound. That come with leadwerks. And the only code I had to reference it was the code I used above.
  21. yeah pretty much exactly what happened. As an alternative until I can fix this. I have made a prefab box with one surface textured to the blood. This has transparency and works perfectly (using the same material) and fixes all issues at once.I would like to however get this working with decals. Because scene overload from too many scripted prefabs is a big issue with my game. Every time I make something new I have to find ways to balance it.
  22. I need help with blood decals for my game. They are loading in fine. But they are square looking patches and the keep flickering and vanishing.I have tried everything I can think of. And the fact that I can't see a preview in the material editor isn't helping. I will provide a screen shot and the code I am using. Ideally I would like them to look like pools of blood. And not vanish at all. So that I can create a whole other script that dictates how long to wait before vanishing. --Moving Check if self.mode == "roam" then self.moving = 1 elseif self.mode ~= "roam" then self.moving = 0 end --Foot step sound if self.moving == 1 then if self.sound.foot ~= nil then self.footdelay2 = self.footdelay2 - 1 if self.footdelay2 <= 0 then self.entity:EmitSound(self.sound.foot, 30 , 1 , 1 , false) self.footdelay2 = self.footdelay --Blood Texture for ground if wounded == 1 then --Bullet mark decal --Bullet mark decal local mtl local scale = 0.1 mtl = Material:Load("Materials/Decals/wound.mat") end local decal = Decal:Create(mtl) --decal:SetScript("Scripts/Objects/Effects/BulletMark.lua") decal:SetColor(1,0,0,1) decal:SetPosition(self.entity:GetPosition()) decal:SetParent(terrain.entity) end end end
  23. Is there a list of steamworks commands available using lua? Or do I have to use c++ for anything steam related?
×
×
  • Create New...