[ZScript] Weapon input shortcuts: no more Refire headaches!

Handy guides on how to do things, written by users for users.
Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.

[ZScript] Weapon input shortcuts: no more Refire headaches!

Postby Matt » Wed Oct 10, 2018 2:16 am

Here's a guide that no one asked for, but hopefully can prove helpful to someone trying something that can easily turn into a not-exactly-flying spaghetti monster without sufficient planning.

Your weapon controls allow up to 8 buttons. This is quite a lot, but sometimes you want to accomplish things through specific combinations of buttons - without getting trapped in a maze of A_(Clear)Refire hacks trying to trace a unique path for every possibility.

Examples:
  • Dual-wield (or double-barreled, double-triggered) weapons: each of the two fire buttons handles one weapon, and each weapon (which is on a different overlay from the other, of course) can be fired totally independently of what the other is doing - even if the other fire button is still being held down.
  • Heavy Weapon Guy-style gun spinup: hold altfire to keep your gun ready to fire at any time.
  • Slam fire shotgun: hold trigger down, hold altfire to rack the shotgun, gun immediately goes off once you chamber the new round.
  • Panic shot: shoot in the middle of a reload sequence, spending whatever happens to be in the chamber already.
  • Check for holding Zoom/Reload/other non-A_Refire-able inputs outside of a ready state.
  • Daggerfall-style melee weapons: hold button, move mouse in the direction to swing.
  • Wacky weapon with a "jamming typewriter" interface that prevents the weapon from operating if you mash the buttons too fast.
  • Spellcasting decision trees.
  • You're a bloody maniac, or extremely undisciplined and disorganized, and have actually run out of buttons for calling all the various weapon functions you have coded.

I've developed some shortcuts that massively improve my own quality of life while trying to do stuff like this. It occurs to me that my setup is not self-evident and might be good to share.

(Yes, what I'm doing here goes against the warning in the performance note here, but given you're not going to be dealing with more than 8 players at any given moment this is relatively trivial.)

Spoiler:



EDIT: Example of how this looks in application:
Spoiler:
Last edited by Matt on Tue Oct 16, 2018 3:37 pm, edited 7 times in total.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
 
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: [ZScript] Cheating with weapons

Postby Nash » Wed Oct 10, 2018 5:37 am

Thanks for these timesavers.
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests