Weapon user states not working

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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!)
User avatar
Endie
Posts: 227
Joined: Thu Mar 16, 2017 7:34 pm
Discord: 「Moa Dixøn」#4254
Graphics Processor: nVidia (Modern GZDoom)
Location: Somewhere in the void

Weapon user states not working

Post by Endie »

So, i was trying to add a new state to my gun (to make the player use a fake sprint), and, i used one of the user states that i can, defined the KEYCONF lump, but the state seem to not exist, at all. I'll just send the code here, so can anyone with more decorate experience help me with this?

PS. I've changed the "User1" state for the "Altfire", for testing, and there, the sprint fully worked :/

Code: Select all

User1:
	TNT1 AAAA 0 A_SetPitch(Pitch-0.5)
	TNT1 AAAA 0 A_SetAngle(Angle-0.5)
	ACRS ABCBADE 1 A_Recoil(-3)
	ACRS DA 1 
	TNT1 AAAA 0 A_SetPitch(Pitch+0.5)
	TNT1 AAAA 0 A_SetAngle(Angle+0.5)
	TNT1 A 0 A_Refire
	ACRR BCD 2 
	Goto RealReady
The KEYCONF lump

Code: Select all

Alias "Run" "+User1"

AddKeySection "Custom Controls - Moves" "Moves"

addmenukey "Run" "+User1"

Defaultbind "E" "+User1"
User avatar
Endie
Posts: 227
Joined: Thu Mar 16, 2017 7:34 pm
Discord: 「Moa Dixøn」#4254
Graphics Processor: nVidia (Modern GZDoom)
Location: Somewhere in the void

Re: Weapon user states not working

Post by Endie »

Oh, just saying, at the last line in KEYCONF, the defaultbind is "Run", not "+User1", this one was my mistake, but even fixing this, still not working
User avatar
wildweasel
Moderator Team Lead
Posts: 21384
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: Weapon user states not working

Post by wildweasel »

Is your A_WeaponReady set up to check for a button? It does not by default; you need the WRF_ALLOWUSER1 flag for that, just like with Reload and Zoom buttons.
User avatar
Endie
Posts: 227
Joined: Thu Mar 16, 2017 7:34 pm
Discord: 「Moa Dixøn」#4254
Graphics Processor: nVidia (Modern GZDoom)
Location: Somewhere in the void

Re: Weapon user states not working

Post by Endie »

Ooh nice, i'll check that now, thanks

Return to “Scripting”