Aiming with holding down altfire

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!)
Post Reply
User avatar
GamingGargoyle
Posts: 4
Joined: Sun Jan 22, 2017 6:32 am
Location: Czech

Aiming with holding down altfire

Post by GamingGargoyle »

The method of switching aim on and off is kinda weird. So i wanted to make the iron sights method like in Far Cry 3 or BorderLands 2. I ended up really close but i got a better idea. Could it be somehow possible, that holding altfire just changes the sprite of the weapon? I got a feeling something like that could be done through Zscript but iam very unexperienced with it. Any help?
User avatar
MFG38
Posts: 414
Joined: Sun Apr 14, 2019 8:26 am
Graphics Processor: nVidia (Modern GZDoom)
Location: Finland
Contact:

Re: Aiming with holding down altfire

Post by MFG38 »

You don't even need ZScript - the same can be done just as efficiently in DECORATE.
User avatar
GamingGargoyle
Posts: 4
Joined: Sun Jan 22, 2017 6:32 am
Location: Czech

Re: Aiming with holding down altfire

Post by GamingGargoyle »

And do you know how?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Aiming with holding down altfire

Post by Matt »

MFG38 wrote:You don't even need ZScript - the same can be done just as efficiently in DECORATE.
As someone who's tried both, I can verify that this statement is false. It can be done as effectively from the user end, and since it's a player interface that doesn't need to be done with dozens of actors every tick there won't usually be a noticeable system slowdown, but the Decorate version of this is going to rely on a lot of weapon ready/refire/hold loops that are a horror to try to maintain.

I made a tutorial for some shortcuts precisely for this kind of thing.

EDIT: Come to think of it it might be possible to insert this actor into a mod, create a Decorate actor that inherits from it, then call A_JumpIf(PressingAltFire(),"ready_holdingaltfire") or something in the ready state.
Post Reply

Return to “Scripting”