Hello Again forums,
I have been having an unusually hard time trying to get one of my weapons to work. I can't seem to pick up my BFG weapon and I can't seem to find what is wrong with it, but I have a feeling it must be something very obvious. Everything in my code seems to be fine, but it isn't working no matter what I do. When I try to add it to inventory using console commands, it doesn't appear.
https://pastebin.com/bS5VCC1k
this is the main weapon code.
ZScript Weapon Problem (SOLVED)
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
ZScript Weapon Problem (SOLVED)
Last edited by Exosphere on Sat Jul 14, 2018 12:30 pm, edited 1 time in total.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: ZScript Weapon Problem
Do you have the BFGK* sprites loaded when you run this? That's the only issue I can see just looking at this code.
EDIT:This is wrong and should be "...A_Raise();". If you're not getting an error message then this code isn't even being loaded. How are you running this?
EDIT:
Code: Select all
BFGK A 1 A_Raise;
-
- Posts: 4949
- Joined: Sun Nov 14, 2010 12:59 am
Re: ZScript Weapon Problem
That's acceptable actually.Matt wrote:EDIT:This is wrong and should be "...A_Raise();"Code: Select all
BFGK A 1 A_Raise;
Re: ZScript Weapon Problem
The weapon is model based. Thats why there is only is BFGK. Also, I can successfully summon it with the summon command, and it appears but thats it. Another thing, I can confirm that A_Raise; can be written without the parentheses.Matt wrote:Do you have the BFGK* sprites loaded when you run this? That's the only issue I can see just looking at this code.
EDIT:This is wrong and should be "...A_Raise();". If you're not getting an error message then this code isn't even being loaded. How are you running this?Code: Select all
BFGK A 1 A_Raise;
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: ZScript Weapon Problem
Has it always been like that? I remember this being one of the first things I had to learn when anonymous functions first came out.
In that case I see nothing else that could prevent the BFG from working.
Do give or IDFA work?
In that case I see nothing else that could prevent the BFG from working.
Do give or IDFA work?
-
- Posts: 4949
- Joined: Sun Nov 14, 2010 12:59 am
Re: ZScript Weapon Problem
I pretty much know nothing about models. But usually, if you can't receive or pick a weapon up, it's because the engine can't find the sprite used by the Ready state.Exosphere wrote:The weapon is model based. Thats why there is only is BFGK.
Yes. The parentheses are required only inside functions, anonymous or otherwise. They appear to be optional if you're calling the function directly from a state.Matt wrote:Has it always been like that?
Re: ZScript Weapon Problem
Solved it. It was a sprite problem. Fixed it by adding the BFGK to my TEXTURES file. I knew it was going to be something relatively minor that I would forget.Blue Shadow wrote:Exosphere wrote:The weapon is model based. Thats why there is only is BFGK.Blue Shadow wrote: I pretty much know nothing about models. But usually, if you can't receive or pick a weapon up, it's because the engine can't find the sprite used by the Ready state.