An extreme autoexec.cfg undertaking

Status
Not open for further replies.

Zubat

GFZ (WIP) theme enthusiast
After recently learning the camera's height and distance could be changed, I found new ways to play SRB2. Since then I've got my own, simple, autoexec.cfg up and running just fine. It sets custom camera options not available in the game's settings menu, enters a netgame with a golden knuckles, and binds the screenshot button to M. But I have a bigger project in mind.

The first thing I want to add (and the only simple one) is binding gif recording buttons to the brackets. I'm on a laptop and the function keys that normally control screenshots and gifs are coupled with volume, brightness, and other commands that make it very awkward to utilize them in-game. Everything else here on is something I'm not sure will even work.

The next thing I want to deal with is that pesky chasecam. It's nice and all for ringslingers, but when I'm loading up a netgame that automagically turns it on (and thus turning off analog mode), I immediately turn it off for hide and seek. When I do that, the cam_dist is reset to default meaning I have to not only turn analog back on, but also reset the cam_dist. If there's a way to keep the cam_dist from resetting when exiting chasecam, or to set it back to the way I had it (analog on included) I'd be more than happy to hear it.

The biggest and toughest part (or so it seems to me) is this: switching predetermined control schemes on the fly. I'm an antsy gal on a laptop, and I need to be able to drop using my wireless mouse at a moment's notice. I want to have six (6) control schemes set up: P1 mouse and keyboard, P1 keyboard analog on, P1 keyboard analog off, and P2 equivalents of these. All of them will utilize some, but not all, of the same buttons and will overlap one another, so to turn only one on at a time and cycle through them with a single button (or each scheme set to it's own button, I'm thinking the symbols would work fine) is my end goal. I need the keyboard only scheme to automatically turn analog on as well as turn it off when switching to keyboard and mouse, or non analog keyboard scheme. I only want the P2 controls for the times I'm playing as Sonic and Tails and need to pick myself up and fly somewhere.

So, does anybody have experience with autoexecs? Who can tell me what's possible and what isn't? Anything and everything could help me at this point. Thank you in advance!

---------- Post added at 09:40 PM ---------- Previous post was at 08:51 PM ----------

After some time on IRC, I was taught aliases and the like. Now my final goal can be achieved! All that's left to figure out is how to bind to symbol keys, shift, capslock, tab, alt, enter, that kind of stuff. I have a feeling I can figure it out, but we'll see.

Also, I figured posting my current autoexec.cfg wouldn't hurt any. If you wanna test it out, just drop it into SRB2's root folder. Just remember this is an incredibly early version of the final product.
@echo off; chasecam 0; analog 1; cam_height 220; cam_dist 50; cam_speed 2; bind m screenshot; name autocfg test; skin knuckles; color gold

Once again, a HUGE thank you to all those on IRC for helping me out with this so far! I know sometimes people like me seem to ask questions that only come across as pure ignorance, but it's people like you that make a difference and lasting impression for us beginners and our learning processes!
 
As for special keys, I believe this is what you were looking for.

Don't sweat it; we all gotta start somewhere.
 
Nah, of all the things you can product in SRB2, I'd have to say that console scripting is by far the least time consuming once you get a good handle on it. Go nuts, I'd say.
 
Cobalt, you're an angel for digging that up for me~

I've got a proof of concept now with a working gif recording key binding and dedicated messages (and accompanying sound effects) to me know what control scheme I've switched to next. Gif recording is on N, Screenshot on M, and control cycle is on \ (backslash). What do you guys think of the sound effect? Should I switch it to the sound that netplay chat makes, or something else?

chasecam 0; analog 1; cam_height 220; cam_dist 50; cam_speed 2; bind m screenshot; name autocfg test; skin knuckles; color gold
alias recordgif "bind n savegif; startmovie"
alias savegif "bind n recordgif; stopmovie"
bind n recordgif
alias combop1 "bind \ combop2; CECHODURATION 1; CECHO Combo P1 Set; soundtest 0; soundtest 151;"
alias combop2 "bind \ keyboardanalogp1; CECHODURATION 1; CECHO Combo p2 Set; soundtest 0; soundtest 151;"
alias keyboardanalogp1 "bind \ keyboardanalogp2; CECHODURATION 1; CECHO Analog P1 Set; soundtest 0; soundtest 151;"
alias keyboardanalogp2 "bind \ keyboardnop1; CECHODURATION 1; CECHO Analog P2 Set; soundtest 0; soundtest 151;"
alias keyboardnop1 "bind \ keyboardnop2; CECHODURATION 1; CECHO Classic P1 Set; soundtest 0; soundtest 151;"
alias keyboardnop2 "bind \ combop1; CECHODURATION 1; CECHO Classic P2 Set; soundtest 0; soundtest 151;"
bind \ combop1
The next problem that I've run into is making sure the mouse is disabled when the controls that DON'T include the mouse are activated. I'm also going to have to write in something that makes my normal "chasecam" button alternate between normal view, first person, and my custom camera, but I think I can get that one done no problem. Right now, the majority of this is just setting all the key bindings and testing them.

EDIT: Solved the mouse issue, AND removed combo and analog p2 controls for the sake of simplifying into a single Player 2 control scheme. Also, new control scheme names are coming~
 
Last edited:
As for special keys, I believe this is what you were looking for.

Don't sweat it; we all gotta start somewhere.

Huh, had no idea these would work with the bind command, but thanks to you I went and checked the source code ...and yep, that does seem to be the case after all. Probably worth adding that info to the SRB2 Wiki then, that article there I made assumed they were just for SETCONTROL/SETCONTROL2.

...so in a way, thanks indirectly for uncovering undocumented info \o/
 
Around half a year ago I lost my srb2 install, and my autoexec with it. Today I found this old thread, grabbed what I had a few posts back, and remade what I lost. Major differences are a few new commands at the start, a different sound effect for the cycling, and lowering to 2 control schemes. Here's what it's looking like now (STILL UNFINISHED).
skipintro; itemfinder on; flipcam yes; soniccd on; homremoval yes; gr_anisotropicmode 16; shadow on; name autocfg test; skin knuckles; color gold
bind m screenshot
bind n recordgif
alias recordgif "bind n savegif; startmovie"
alias savegif "bind n recordgif; stopmovie"
bind x cam2
alias cam1 "bind x cam2; chasecam 1; resetcamera; soundtest 0; soundtest 56;"
alias cam2 "bind x cam3; chasecam 1; resetcamera; cam_dist 250; cam_height 50; soundtest 0; soundtest 56;"
alias cam3 "bind x cam1; chasecam 0; resetcamera; analog 0; soundtest 0; soundtest 56;"
bind b SRB2scheme
alias SRB2scheme "bind b SA2scheme; CECHODURATION 1; CECHO Default Controls; analog 0; soundtest 0; soundtest 56;"
alias SA2scheme "bind b SRB2scheme; CECHODURATION 1; CECHO SA2 Style; analog 1; cam_speed 2; soundtest 0; soundtest 56;"
I made new threads about questions regarding commands. I wasn't sure if they would be answered properly if they were asked here. If they should be merged with this thread, I invite the admins to do their magic. I have no idea when this will be finished, if at all. Thanks again everyone for the help!
 
When my little sister was maybe three or four years old, she didn't exactly know how to read or write, meaning she did not know how to use the menus. So, out of courtesy for her, I made three files that basically created four toggle buttons. The first one would cycle through the skins, the second one would cycle through the colours, the third one would cycle through a bunch of chat macros and the fourth one would let her say the message. Obviously the third and fourth buttons were for when she got older. I did this for skin and color because you couldn't use the toggle command to cycle them anymore.

I've known about cycle binds for quite a while and I even made a simple calculator using it!

YevaEA uses cycling buttons for some pretty cool purposes which I find neat!
 
When my little sister was maybe three or four years old, she didn't exactly know how to read or write, meaning she did not know how to use the menus. So, out of courtesy for her, I made three files that basically created four toggle buttons. The first one would cycle through the skins, the second one would cycle through the colours, the third one would cycle through a bunch of chat macros and the fourth one would let her say the message. Obviously the third and fourth buttons were for when she got older. I did this for skin and color because you couldn't use the toggle command to cycle them anymore.

I've known about cycle binds for quite a while and I even made a simple calculator using it!

YevaEA uses cycling buttons for some pretty cool purposes which I find neat!

aww
you're a great brother/sister/brister (male-female hybrid)
how's her skills on SRB2?
 
I'm done early, folks. I mapped some controls that made the script a lot less heavy than I originally planned. Here's the final version.
skipintro; itemfinder on; flipcam yes; soniccd on; homremoval yes; use_mouse on; gr_anisotropicmode 16; shadow on; name autocfg test; skin knuckles; color gold
bind p screenshot
bind o recordgif
alias recordgif "bind o savegif; startmovie"
alias savegif "bind o recordgif; stopmovie"
bind x cam2
alias cam1 "bind x cam2; chasecam 1; resetcamera; cam_dist 128; cam_height 20; soundtest 0; soundtest 56;"
alias cam2 "bind x cam3; chasecam 1; resetcamera; cam_dist 250; cam_height 50; soundtest 0; soundtest 56;"
alias cam3 "bind x cam1; chasecam 0; resetcamera; analog 0; soundtest 0; soundtest 56;"
bind g SA2scheme
alias SRB2scheme "bind g SA2scheme; CECHODURATION 1; CECHO Mouse & Keyboard; resetcamera; cam_dist 128; cam_height 20; analog 0; use_mouse on; soundtest 0; soundtest 56;"
alias SA2scheme "bind g SRB2scheme; CECHODURATION 1; CECHO Keyboard Only; analog 1; cam_speed 2; resetcamera; cam_dist 250; cam_height 50; use_mouse off; soundtest 0; soundtest 56;"
setcontrol "forward" "w"
setcontrol "backward" "s"
setcontrol "strafeleft" "a"
setcontrol "straferight" "d"
setcontrol "turnleft" "KEY0"
setcontrol "turnright" "KEY0"
setcontrol "weaponnext" "Wheel 1 UP"
setcontrol "weaponprev" "Wheel 1 Down"
setcontrol "weapon1" "1"
setcontrol "weapon2" "2"
setcontrol "weapon3" "3"
setcontrol "weapon4" "4"
setcontrol "weapon5" "5"
setcontrol "weapon6" "6"
setcontrol "weapon7" "7"
setcontrol "weapon8" "8"
setcontrol "weapon9" "9"
setcontrol "weapon10" "0"
setcontrol "fire" "MOUSE2"
setcontrol "firenormal" "e"
setcontrol "tossflag" "q"
setcontrol "use" "SPACE" "k"
setcontrol "camtoggle" "KEY0"
setcontrol "camleft" "u"
setcontrol "camright" "i"
setcontrol "camreset" "z"
setcontrol "lookup" "KEY0"
setcontrol "lookdown" "KEY0"
setcontrol "centerview" "KEY0"
setcontrol "mouseaiming" "v"
setcontrol "talkkey" "t"
setcontrol "teamtalkkey" "y"
setcontrol "scores" "TAB"
setcontrol "jump" "MOUSE1" "j"
setcontrol "console" "TILDE"
setcontrol "pause" "MOUSE3"
setcontrol "custom1" "r"
setcontrol "custom2" "f"
setcontrol "custom3" "c"
setcontrol2 "forward" "h"
setcontrol2 "backward" "n"
setcontrol2 "strafeleft" "b"
setcontrol2 "straferight" "m"
setcontrol2 "turnleft" ","
setcontrol2 "turnright" "/"
setcontrol2 "weaponnext" ";"
setcontrol2 "weaponprev" "'"
setcontrol2 "weapon1" "KEY0"
setcontrol2 "weapon2" "KEY0"
setcontrol2 "weapon3" "KEY0"
setcontrol2 "weapon4" "KEY0"
setcontrol2 "weapon5" "KEY0"
setcontrol2 "weapon6" "KEY0"
setcontrol2 "weapon7" "KEY0"
setcontrol2 "weapon8" "KEY0"
setcontrol2 "weapon9" "KEY0"
setcontrol2 "weapon10" "KEY0"
setcontrol2 "fire" "RSHIFT"
setcontrol2 "firenormal" "RCTRL"
setcontrol2 "tossflag" "g"
setcontrol2 "use" "."
setcontrol2 "camtoggle" "UP ARROW"
setcontrol2 "camleft" "KEY0"
setcontrol2 "camright" "KEY0"
setcontrol2 "camreset" "\"
setcontrol2 "lookup" "KEY0"
setcontrol2 "lookdown" "KEY0"
setcontrol2 "centerview" "KEY0"
setcontrol2 "mouseaiming" "KEY0"
setcontrol2 "talkkey" "KEY0"
setcontrol2 "teamtalkkey" "KEY0"
setcontrol2 "scores" "KEY0"
setcontrol2 "jump" "l"
setcontrol2 "console" "KEY0"
setcontrol2 "pause" "KEY0"
setcontrol2 "custom1" "LEFT ARROW"
setcontrol2 "custom2" "DOWN ARROW"
setcontrol2 "custom3" "RIGHT ARROW"
There it is. All done. I'll enjoy playing with the script commands I've made, and I invite others to try out mine or tinker with it. Thanks again for the help, everyone!
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top