An interesting new way to program feedback in your scripts

GPC2 script programming for Titan Two. Code examples, questions, requests.

An interesting new way to program feedback in your scripts

Postby pablosscripts » Sun Sep 26, 2021 1:34 am

(note: this is probably mostly applicable to coding PC scripts, but may also be useful for console)

You know the scenario - you've toggled on rapid fire, you die, but you didn't realise you left it on. So upon respawning you are back to a full auto weapon but with rapid fire turned on...you know where this usually ends up - with you losing the next fight.

Some of you may have seen in my scripts I use the T2 LCD screen to keep track of this ("P." for primary weapon, "5" for secondary, as well as colour coding it green vs. purple). While it's a great solution, the downside with this is it requires you to constantly look at your T2 screen to double check.

I've always wanted a better way of doing this. I've thought about wiring up a speaker or something so I'd have some audio feedback but last night an idea hit me.

Do you know how in some games if you press a button that hasn't got anything mapped to it, it makes a ding sound? (similar to the first one in this video, but a bit duller: https://www.youtube.com/watch?v=hlItRS5s1JY). You just have to press all the keys until you find one that makes this sound.

Anyway, my idea was...why not use this sound as your feedback mechanism? And after a few hours of testing I can tell you it works perfectly! There are three scenarios you should code for:

1) Notification for when you toggle on rapid fire: When rapid fire is being turned on, you hear a ding sound, so it's crystal clear to you that you've activated it. Obviously when you turn it off it should not make the ding sound so you can differentiate between them.

2) Alert for when you've accidentally left rapid fire on: When you die and respawn and you forget to turn off rapid fire, it should notify you with a double or triple ding sound. You need to find a way to uniquely identify when you're respawning, because each game will differ. E.g. in COD it's repeatedly tapping the reload button (I think), in Halo Infinite it's being idle for exactly 5 seconds while you want for the respawn timer etc etc.

3) Checker key to see if rapid fire is turned on: A key you can press to tell you if it's turned on or not, this is when you forget and lose track of what state you're in. Usually the best way to do this is to shoot a few bullets to test it, but it's a waste of bullets then you have to reload. This gives you a quick way to double check. So with this checker, if rapid fire is turned on, it will play the ding sound.

And there you go. It makes it feel like your toggle state is actually integrated into the game. Also you should note that while all my examples use rapid fire, this concept could be used for any toggle state functionality. I hope someone out there finds this useful!

BONUS POINTS: the same concept can be used with certain in game functions, for when you want visual feedback in addition to audio. For example in Halo Infinite there is a ping marker, and also a "scan" function, which sends out this colourful scan over the entire map. You could link these functions to your state checker as well. Because these functions are benign (like ping) don't really interfere with the game, it doesn't harm you in any way to activate them as described above.
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: An interesting new way to program feedback in your scrip

Postby MyItchyBum » Mon Feb 14, 2022 7:39 pm

Dude, there is a much easier way, I have implemented this in my script: based on the rumble input the script auto detects if Rapid fire should be on or not. It works flawlessly, every time and without fail. If oyu use a silencer though you might have an issue, otherwise this is the best option guaranteed. I got used playing with this soo much that I cannot imagine playing without it anymore.

Another option is that you have weapon swap activated under the reload button, and that you activate a fire mode swap (from rapid fire to auto fire) with a long press. Program the script that it only swaps when you have rapid fire activated. Now, respawn with X/Reload from now on by long pressing the button). From this point onwards you will never have that issue again that you forget to toggle off rapid fire...
User avatar
MyItchyBum
Master Sergeant
Master Sergeant
 
Posts: 29
Joined: Sun Nov 13, 2016 7:04 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: alanmcgregor and 81 guests