Can't pickup my weapon.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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!)
Post Reply
NotGood
Posts: 4
Joined: Fri Oct 23, 2020 7:20 pm
Graphics Processor: Intel (Modern GZDoom)

Can't pickup my weapon.

Post by NotGood »

I can't seem to pickup the weapon. I can spawn it in using doom builder, just cant pick it up.

Code: Select all


actor StG-44 : weapon 203
{
	Weapon.slotnumber 3
	weapon.ammouse 1
	weapon.selectionorder 5
	weapon.ammotype "clip"
	inventory.pickupmessage "You picked up the StG44!"
	Weapon.ammogive 30
	obituary "%o got clensed by %k's StG44"
	attacksound "weapon/stgshot"
	decal "bulletchip"	
	
	states
	  {
		Spawn:
			STGS A -1
			Stop
		Select:
			STGH A 1 a_raise
			loop
		Deselect:
			SRGH A 1 a_lower
                        Loop
		Ready:
			SRGH A 1 a_weaponready
			loop
		Fire:
			SRGF A 0 bright a_firebullets (5,5,1,3,"BulletPuff")
			SRGF A 1
			SRGH C 1
			SRGH B 1
			SRGH A 1 a_refire
			goto ready
		Flash:
			SRFF A 4 bright A_LIGHT2
			goto lightdone
	  }
}

Last edited by NotGood on Sat Oct 24, 2020 4:30 pm, edited 1 time in total.
NotGood
Posts: 4
Joined: Fri Oct 23, 2020 7:20 pm
Graphics Processor: Intel (Modern GZDoom)

Re: Can't pickup my weapon.

Post by NotGood »

User avatar
Logan MTM
Posts: 678
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: Can't pickup my weapon.

Post by Logan MTM »

Stop in Spawn state? Change to Loop and try again

Code: Select all

states
     {
      Spawn:
         STGS A 1
         Loop
NotGood
Posts: 4
Joined: Fri Oct 23, 2020 7:20 pm
Graphics Processor: Intel (Modern GZDoom)

Re: Can't pickup my weapon.

Post by NotGood »

Logan MTM wrote:Stop in Spawn state? Change to Loop and try again

Code: Select all

states
     {
      Spawn:
         STGS A 1
         Loop
That's how i've always done it before and it worked fine.
I change it and it still doesn't work
NotGood
Posts: 4
Joined: Fri Oct 23, 2020 7:20 pm
Graphics Processor: Intel (Modern GZDoom)

Re: Can't pickup my weapon.

Post by NotGood »


Heres a video of the bug
Last edited by Blue Shadow on Sun Oct 25, 2020 1:03 am, edited 1 time in total.
Reason: The [streamable] tag wasn't use correctly.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Can't pickup my weapon.

Post by wildweasel »

This can happen whenever GZDoom can't find the sprites for the weapon's Select, Deselect, or Ready states. In this case, the problem is that your sprites are named STGH**, but you've written your Decorate code to look for SRGH**. Replace all of the references to SRGH with STGH, and your gun will work just fine.

(You may also want to rename the last two sprites to have a zero on the end.)
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: Can't pickup my weapon.

Post by Blue Shadow »

wildweasel wrote:This can happen whenever GZDoom can't find the sprites for the weapon's Select, Deselect, or Ready states.
It's only the Ready state which matters, actually.
Post Reply

Return to “Scripting”