APROP_GunOffset

Moderator: GZDoom Developers

Post Reply
User avatar
DavidPH
Posts: 382
Joined: Fri Aug 28, 2009 1:46 pm

APROP_GunOffset

Post by DavidPH »

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.)
Attachments
APROP_GunOffset.patch.7z
patch for r3218
(600 Bytes) Downloaded 30 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: APROP_GunOffset

Post by Graf Zahl »

These variables are far too dynamic to be checked and set from ACS. Sorry.
User avatar
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

Post by Ryan Cordell »

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..
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: APROP_GunOffset

Post by Graf Zahl »

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.
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: APROP_GunOffset

Post by Nash »

Well, so much for your Blood-style guns, Ryan. :(
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: APROP_GunOffset

Post by Graf Zahl »

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.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: APROP_GunOffset

Post by XutaWoo »

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.
User avatar
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

Post by Ryan Cordell »

Nash wrote:Well, so much for your Blood-style guns, Ryan. :(
It's alright. I can always make my own fork of ZDoom.
User avatar
MG_Man
Posts: 1401
Joined: Sat Jul 28, 2007 1:24 pm
Contact:

Re: APROP_GunOffset

Post by MG_Man »

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.
Besides the normal bobbing (which isn't ruined by this) what else controls them?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: APROP_GunOffset

Post by Graf Zahl »

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.
User avatar
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

Post by Ryan Cordell »

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).
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”