-
Posts
245 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Slimwaffle
-
Its there so the game pauses while you are going through your inventory screen
-
I am trying to design an inventory system using the gui widgets. The mouse locks to crosshair position when it shouldn't. And I was wondering how I fix it. I want to be able to freely move the mouse around and click on buttons. The same way I can in the main menu when I press escape. <My Code> function Script:Start() local Inventory={} local scale = 1 --Inventory GUI Inventorygui = GUI:Create(context) Inventorygui:Hide() Inventorygui:SetScale(scale) local widget Inventorygui:GetBase():SetScript("Scripts/GUI/Panel.lua") Inventorygui:GetBase():SetObject("backgroundcolor",Vec4(0,0,0,1)) local image = Inventorygui:LoadImage("Bag/bag.tex") local imagePanel = Widget:Panel(0,0,1920,1080, Inventorygui:GetBase()) imagePanel:SetImage(image) imagePanel:Redraw() Inventory.gui=gui Inventory.context = context --Create a link button Inventory.newbutton = Widget:Button("Resume Game",100,Inventorygui:GetBase():GetSize().y/2-60,300,20,Inventorygui:GetBase()) Inventory.newbutton:SetString("style","Link") Inventory.newbutton:SetAlignment(1,0,0,0) Inventory.options = Widget:Button("Inventory",100,Inventorygui:GetBase():GetSize().y/2-10,300,20,Inventorygui:GetBase()) Inventory.options:SetString("style","Link") Inventory.options:SetAlignment(1,0,0,0) optionspanel = Widget:Panel(Inventorygui:GetBase():GetClientSize().x/2-250,Inventorygui:GetBase():GetClientSize().y/2-300,500,600,Inventorygui:GetBase()) optionspanel:SetAlignment(0,0,0,0) Inventory.optionspanel=optionspanel indent=8 --Create a panel widget = Widget:Tabber(indent,indent,optionspanel:GetClientSize().x-indent*2,optionspanel:GetClientSize().y-indent*2,optionspanel) widget:AddItem("Inventory",true) optionspanel:SetObject("backgroundcolor",Vec4(0.15,0.15,0.15,1)) Inventory.tabber = widget local indent = 12 panel = Widget:Panel(indent,indent,widget:GetClientSize().x-indent*2,widget:GetClientSize().y-indent*2-30,widget) panel:SetBool("border",true) Inventory.panel={} Inventory.panel.general=panel Inventory.applyoptions = Widget:Button("Use",widget:GetClientSize().x-72*2-4-indent,widget:GetClientSize().y-28-5,72,28,widget) local y=20 local sep=40 optionspanel:Hide() end function Script:UpdateWorld() if window:KeyHit(Key.I) then Inventorygui:Show() Time:Pause() window:ShowMouse() end end
-
Thanks mate. That worked perfectly.
-
So I have been looking into a save and load function. So far everything I have seen uses tables. I noticed in alot of the code there is an update world function. Is there some kind of way. To save the entire world state (So absolutely everything is included) and then update it back to the world state when using a load function?
-
I was wondering if anyone could help me with a glitch I am experiencing with the gui. So I wanted to load a background image on the main menu.The problem is that it loads buggy then you click and it loads perfectly. The code I used looked like this; --GUI local gui = GUI:Create(context) gui:Hide() gui:SetScale(scale) local widget gui:GetBase():SetScript("Scripts/GUI/Panel.lua") gui:GetBase():SetObject("backgroundcolor",Vec4(0,0,0,1)) --This part is my code local image = gui:LoadImage("Frame/Walkabout.tex") local imagePanel = Widget:Panel(0,0,1920,1080, gui:GetBase()) imagePanel:SetImage(image) --Ends here GameMenu.gui=gui GameMenu.context = context How do I get this to load properly the first time without having to click?
-
I searched everywhere. There is no reference to name. I think I am going to have to add something in myself. I think maybe along the lines of on weapon pick up if weapon file is = "path to mp4.pfb" then name of next index = "mp4" Not sure if that will work. Seems a bit tedious. Would saving all the file paths (For each item) and the equivalent name (for each item) to a table and then search matching string in table and returning name value work better?
-
This is what I came up with that compiles without error. But its not printing a name value to screen. wep = self.weapons[self.currentweaponindex].entity:GetKeyValue("Name") context:SetBlendMode(1) context:SetColor(0,1,1,255) context:DrawText("Weapon = " ..wep , 20,(context:GetHeight() - 80))
-
At the moment its just the default weapon autopistol and the ones from the fps pack. I want to print to screen above my ammo the name of the weapon currently being held So yeah mostly prefabs
-
I was wondering how I would go about getting weapon name to print to screen? I checked all the code and can't find a reference to name anywhere. The closest I found was weapon file. Which prints the weapon file path to screen but does not change when swapping weapons.
-
I fixed everything. Poly count is my only issue now. Thanks for the help guys.
-
I was able to get body and hair to separate properly. Because fuse puts body on one layer and everything else on a second layer when creating textures. I would add hair export. remove hair. So only hair was on second layer. And import skinned FBX to leadwerks. Then apply hair textures to blank material generated for hair. And repeat the process for each item (top, pants and so on). This worked great for hair. But now my problem is clothing items aren't texturing properly. Is there a way to combine surfaces in model editor into a single surface. So that I can do hair and clothes on a single texture? bandicam 2018-06-29 11-28-51-069.mp4
-
yeah I followed this to fix the animations. The only issue now is that importing a skinned character generates blank materials that appear all black.
-
And importing skinned FBX is worse because the textures just go black inside the engine.
-
Ok I fixed the issue. I needed to make the shaders for the material animated. Apply to the character. (This removes animations) then reapply animations and save. Now my only Issue is the texture. Under closer inspection. I have discovered that. Fuse is creating the character and clothes on what I think on different layers. Because substance painter when the model is imported shows them on separate layers. But leadwerks is converting the model from obj all on one layer. Which makes the texture wrap over the clothes and hair.
-
Update - I don't get FPS lag anymore. And everything works fine. My only issue now. Is that when I generate material from tex and apply to character. It makes the character T pose. But from the shadows you can still see the animation playing. Without texture though this worked perfectly just from copying all the settings from crawler into new character.
-
This is just test scene while I am still building things and figuring out the engine. Eventually the project will be a sandbox level
-
Even if I delete them all. And only place in the custom one on its own. I still get the same issue
-
turns out poly count is fine. Here is the attached project. I am getting all kinds of random errors e.g model T posing and not animating when textured. And no matter what massive reduction in fps. The model I am using now is in a folder called mixamo. Waffles.zip
-
thanks heaps guys I haven't added in distance check yet. But I got this working perfectly with two lines of code. My only question is now how do I get the position of the head instead. Because it uses the feet and prints the bar below the enemy. Or even if I got entity height somehow? these were the two lines I used. local p = self.entity:GetPosition() local y = player.camera:Project(p)
-
19648 polygons. Seems like a lot
-
I have tried importing my own character. And attaching the default monster script. I loaded in animations and renamed them accordingly to interact with the script. However I am getting all sorts of random errors. And was wondering if someone could help. For this process I used fuse, mixamo and substance painter. First error is with meshing. When I create a material to apply the textures to my model.it doesn't let me apply textures to clothes and hair separately. The other issue is yes the character moves and the script appears to be working when selecting animations. But I get wild fps drop and stutter. And now the AI behaves erratic. Often stopping and doing nothing. The only thing I can think off is maybe slowing down the animation speeds. But I honestly don't know. Because they should work regardless of speed. Right now my dude has skin pants and his script and movement doesn't work properly. Is anyone able to help fix this? bandicam 2018-06-22 13-28-45-953.mp4
-
I recently posted an updated FPS script with stamina and health bar. You could always tweak the code on that to get it the way you like. You could create extra bars for ammo, breath, xp and so on.
-
Hi Guys I have found a FPS script with parkour stuff on the workshop. Not sure if that stuff works or not. I haven't tested it yet. But I made some modifications and want to make it available to everyone. New Features; Customizable Stamina and health bars. Shift and ctrl buttons that use stamina. ctrl makes the player crouch. For the Customizable bars. You want to create a border picture as a png and make the white space into transparent space. Then save it with the name Frame. Then create a folder in your project folder called "Frame". Then import your png into your Frame folder. Then right click your Frame.tex and edit. Then change your compression to DXT5. And this should work perfectly. Side note; I added in a variable called crouched for people to reference if they want to make a stealth system. Here is a screen for you guys. Showing what the bars look like. FPSPlayer.lua
-
I am still not getting it for some reason. So I will explain what I did. I put the first piece of code into the Start() function. The second piece of code in my PostRender(context) function. Then I changed the line; u = Transform:Point(target:GetPosition(true),nil,entity) So that it now reads; u = Transform:Point(self.target:GetPosition(true),nil,entity) And I did all this on my Monster AI script. If I where to change target from a Vec3() to an entity. How would I do this? Because everywhere else in the code it is referred to as self.target