havenphillip Posted November 2, 2018 Posted November 2, 2018 Some hud elements I was able to make with help around the community. HUD Elements.zip 5 3 Quote
grinseengel Posted January 26, 2019 Posted January 26, 2019 Thank you for your great work. I have some elements built into my project. As a basic level, I use The Zone. that fits 100 percent. 1 Quote
havenphillip Posted January 26, 2019 Author Posted January 26, 2019 Thanks. What is it missing, in your opinion? Seems like there should be more to it. Quote
grinseengel Posted January 29, 2019 Posted January 29, 2019 Hello, I have a question about the crawler prefab. I noticed that the AI of the crawler is slightly different than the regular monster script. Can it be, or is it just me? I think the crawler runs rather in a zigzag and not directly to the player. Quote
havenphillip Posted January 30, 2019 Author Posted January 30, 2019 I don't know, man. I added very little to the crawler. Quote
grinseengel Posted January 30, 2019 Posted January 30, 2019 Ok, with the crawler I'll take a look again. I have two questions or requests to you. I downloaded some monster models from the workshop. How can I include the prefab (as well as the crawler) in my project? Can you help me create a munitions pickup script for the weapons in the project? I have already loaded the models for the ammunition from the workshop. Quote
havenphillip Posted January 30, 2019 Author Posted January 30, 2019 Include a crawler.pfb in your game? Can't you just drag and drop the prefab into the screen? Not sure what you mean. But here's a basic ammo pickup script. Just add one of your ammo models to your scene and attach this script to it. Also you might need to add a collision shape to your ammo model. ammo_pickup.lua Quote
grinseengel Posted February 1, 2019 Posted February 1, 2019 Thanks for the script. Works really well. Quote
grinseengel Posted February 7, 2019 Posted February 7, 2019 I have now downloaded and installed the explosion example from the steam workshop. If I want to pick up the bomb prefab as a player now I get the following error message. Do you have a chance to install the grenade in your HUD script? Quote
havenphillip Posted February 8, 2019 Author Posted February 8, 2019 It's because the grenade weapon doesn't have a "clip" variable. One thing you could try is adding these in the Start() function of the Fps_GrenadeView.lua script. That will get you past that error: self.clipammo = 1 self.clipsize = 1 self.ammo = 1 Basically the ammo script is trying to figure out what numbers to display. It's asking the pipebomb script "How much ammo do I display?" and the pipebomb script is like "I don't know what you're talking about. I've never heard of clip, or clipsize, or clipammo, etc." So you have to add the variables in the pipebomb script so it can tell the ammo.lua PostRender() what to display. I used "1" which is completely arbitrary. The next thing will be to figure out how to get the pipebomb to count down as you chuck grenades. Quote
grinseengel Posted February 8, 2019 Posted February 8, 2019 Thank you for the info. I have now added this to the script. See Attachment. That works too. I can choose between the weapons and the grenade. If I throw the grenade, then it works too. However, the game then freezes. Sometimes it freezes after throwing a grenade, sometimes after two or three throws. This always happens when I want to run with the player afterwards. Do you have any idea? Quote
havenphillip Posted February 8, 2019 Author Posted February 8, 2019 Yeah. It was freezing up on me, too. I have a fix. Just for fun I was working on it last night. It has to do with a line in the FPS_Grenade.lua script. Open the FPS_Grenade.lua script right next to the other script. Go down to about line 480 and look for "self.entity:Release()" Uncomment it or change it to "self.entity:Hide()" Then, just under that write: if self.entity:Hide() then self.entity:Release() end Like this: Quote
havenphillip Posted February 8, 2019 Author Posted February 8, 2019 Also, if you want the ammo.lua script to display the actual count of grenade ammo you have you can fix that in the Fps_GrenadeView.lua script by making use of the comparable variables that script already has. Open Fps_GrenadeView.lua Add this (change this) under the Start() function: self.clipammo = self.GrenadeAmmo self.clipsize = self.MaxGrenades self.ammo = self.MaxGrenades In the Fire() function under "self.GrenadeAmmo = self.GrenadeAmmo - 1" add this: self.clipammo = self.clipammo - 1 Like this: Quote
grinseengel Posted February 9, 2019 Posted February 9, 2019 Thanks alot. I inserted your lines of code and everything works really well .......... Quote
havenphillip Posted February 9, 2019 Author Posted February 9, 2019 Cool, man. Enjoy it. I think I recall reading you are pretty new. If you haven't checked out Aggror's Project Saturn series on YouTube I would highly recommend. That's where I started two years ago with no prior coding experience. He explains things really well and introduces a lot of the concepts. He shows how to make a health bar, health kit, an inventory system, respawn the player, and a few other things. Plus he's an actual coder and is frequently on here answering questions, and he's always been really patient with me. Josh did a good job making the Leadwerks lua language accessible and once you start to get it you catch on quick. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.