APROP_GunOffset
Moderator: GZDoom Developers
APROP_GunOffset
Allows setting a player's weapon's sprite offsets from ACS. Added to *ActorProperty instead of *PlayerProperty because the latter seems ill suited to handling non-flags and the former already has player-only stuff.
I wanted to add an A_SetOffset for dynamic offsetting from DECORATE, but I felt the lack of a way to access the current offset was a deal-breaker since I wouldn't take 0 to mean unchanged. (OK, you could use ACS to retrieve it, but then you might as well just use ACS.)
I wanted to add an A_SetOffset for dynamic offsetting from DECORATE, but I felt the lack of a way to access the current offset was a deal-breaker since I wouldn't take 0 to mean unchanged. (OK, you could use ACS to retrieve it, but then you might as well just use ACS.)
- Attachments
-
APROP_GunOffset.patch.7z- patch for r3218
- (600 Bytes) Downloaded 30 times
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: APROP_GunOffset
These variables are far too dynamic to be checked and set from ACS. Sorry.
- Ryan Cordell
- Posts: 4349
- Joined: Sun Feb 06, 2005 6:39 am
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Capital of Explodistan
Re: APROP_GunOffset
Um.. What the hell are you talking about? The only issue is that it affects A_Lower and possibly firing, that can be circumvented with Instant Weapon Switch.
When people use this, they'll probably have to acknowledge the fact that it might require more work than just simply getting/setting the offsets in the first place. Not every modder has to be treated like a baby.
EDIT: On the A_Lower issue let me elaborate. If SetActorProperty with GunOffsetY is called constantly (e.g. while loop), then A_Lower will not work. This issue can easily be circumvented by just using a player health check for the loop's condition.
Also, other things are also dynamic as well, so.. Yeah..
When people use this, they'll probably have to acknowledge the fact that it might require more work than just simply getting/setting the offsets in the first place. Not every modder has to be treated like a baby.
EDIT: On the A_Lower issue let me elaborate. If SetActorProperty with GunOffsetY is called constantly (e.g. while loop), then A_Lower will not work. This issue can easily be circumvented by just using a player health check for the loop's condition.
Also, other things are also dynamic as well, so.. Yeah..
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: APROP_GunOffset
Yes, but trying to control the weapons from ACS is guaranteed to cause problems. The way these variables are used makes any attempt to control them from the outside a more or less futile endeavor.
Re: APROP_GunOffset
Well, so much for your Blood-style guns, Ryan. :(
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: APROP_GunOffset
The whole weapon offsetting feature needs a fundamental overhaul before it can be exposed to modders. What's there right now is just too problematic.
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: APROP_GunOffset
Any suggestions on how it needs to be changed, then? There's clearly people who are willing to dive into the code for stuff like this, so it would be helpful to actually know what needs to be done.
- Ryan Cordell
- Posts: 4349
- Joined: Sun Feb 06, 2005 6:39 am
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Capital of Explodistan
Re: APROP_GunOffset
It's alright. I can always make my own fork of ZDoom.Nash wrote:Well, so much for your Blood-style guns, Ryan.
Re: APROP_GunOffset
Besides the normal bobbing (which isn't ruined by this) what else controls them?Graf Zahl wrote:Yes, but trying to control the weapons from ACS is guaranteed to cause problems. The way these variables are used makes any attempt to control them from the outside a more or less futile endeavor.
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: APROP_GunOffset
Bobbing, lowering and raising, and of course the (limited, thanks to the shitty implementation) OFFSET parameters in DECORATE. But the big issue is the bobbing. The offsets are constantly changed so if you start to mess around with them from ACS I don't even want to think about the interference problems this might cause.
- Ryan Cordell
- Posts: 4349
- Joined: Sun Feb 06, 2005 6:39 am
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Capital of Explodistan
Re: APROP_GunOffset
If you think that the offsets are somehow reset when GunOffset is used, they aren't, actually. It's added on top of what's already there, so it's relative, not absolute.
As far as raising goes, I haven't seen a problem with gun raising when GunOffset is used, A_Lower can also be circumvented by somehow giving it priority over GunOffset (I know it's possible, just not sure how).
As far as raising goes, I haven't seen a problem with gun raising when GunOffset is used, A_Lower can also be circumvented by somehow giving it priority over GunOffset (I know it's possible, just not sure how).