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!)

Weapon user states not working

Postby Endie » Tue Nov 21, 2017 7:01 pm

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 allExpand view
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 allExpand view
Alias "Run" "+User1"

AddKeySection "Custom Controls - Moves" "Moves"

addmenukey "Run" "+User1"

Defaultbind "E" "+User1"
User avatar
Endie
I'm doing what i love. Doesn't mean i'm good at it though
 
Joined: 16 Mar 2017
Location: Somewhere in the void
Discord: 「Moa Dixøn」#4254
Operating System: Windows Vista/7/2008 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: Weapon user states not working

Postby Endie » Tue Nov 21, 2017 7:13 pm

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
Endie
I'm doing what i love. Doesn't mean i'm good at it though
 
Joined: 16 Mar 2017
Location: Somewhere in the void
Discord: 「Moa Dixøn」#4254
Operating System: Windows Vista/7/2008 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: Weapon user states not working

Postby wildweasel » Tue Nov 21, 2017 7:35 pm

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
wildweasel
from a different perspective.
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: Weapon user states not working

Postby Endie » Tue Nov 21, 2017 8:05 pm

Ooh nice, i'll check that now, thanks
User avatar
Endie
I'm doing what i love. Doesn't mean i'm good at it though
 
Joined: 16 Mar 2017
Location: Somewhere in the void
Discord: 「Moa Dixøn」#4254
Operating System: Windows Vista/7/2008 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)


Return to Scripting

Who is online

Users browsing this forum: No registered users and 5 guests