Page 1 of 1

"Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Sat Sep 18, 2010 6:15 pm
by The Chosen One
TL;DR: An Onperforms script for Dystopia (like the ones you see in IRC clients)

So, after playing OBtopia for a few days, I noticed that my in-game name (which was different from my Steam Name) had defaulted to my Steam name. Knowing that the OB engine sets in-game names to Steam names, I used setinfo name to change my name. A few rounds later, I noticed that it had defaulted back yet again. Puzzled, I set changed again with setinfo, this time taking note of how long it remained changed. Apparently setinfo stops working after a new map loads, or you connect to a server.

So, I had a thought. *Cue Windows 7 commercial-like effects*

"There should be a script that executes when the map loads!"


What if there was a script like "onpreforms.cfg" that functions similar to the onpreforms function in most IRC clients. It doesn't start when the client loads, but rather when it finishes connecting to a server.

Pros:
  • Could be used to change names without having to manually execute a script.
  • Could be used to auto-authenticate to servers if needed
  • Could be used to set functions that may only be set when joining a server
Cons:
  • Could technically be hijacked to disconnect a user as they join a server
    --You could also just put "quit prompt" in valve.rc and do more damage.
  • Could be hijacked to screw up settings upon joining server.
    --See above
  • Could be read by a 3rd party on a remote machine to gain passwords if the system is comprimised
    --Dude. If someone hacked your PC, they're not gonna just go after a password to one server in one (little-known about) game.

Re: "Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Sun Sep 19, 2010 6:38 am
by KindredPhantom
Or perhaps you could put it in a cfg and execute it on map load?

Re: "Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Sun Sep 19, 2010 10:10 am
by UsefulId|ot
Or perhaps you could put it in a cfg and execute it on map load?
when was simplicity ever the best answer?!

Re: "Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Sun Sep 19, 2010 11:29 am
by Zero-Flame
When we developed the first nuclear bomb of course :)

Yeah,

bind z "exec onPerform.cfg"

Tada, no code changes needed.

Re: "Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Sun Sep 19, 2010 12:09 pm
by The Chosen One
Yes, but that requires you having to remember to press a key on map load. What if you're too forgetful or lazy to do so?

Re: "Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Sun Sep 19, 2010 12:11 pm
by KindredPhantom
Yes, but that requires you having to remember to press a key on map load. What if you're too forgetful or lazy to do so?
Then you will still have the same name.

Re: "Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Sun Sep 19, 2010 3:16 pm
by Juan
bind it to "w"

Re: "Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Sun Sep 19, 2010 8:36 pm
by Zero-Flame
bind mouse1 "+fire;exec onperforms.cfg;"

Re: "Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Mon Sep 20, 2010 1:00 am
by UsefulId|ot
bind mouse1 "+fire;exec onperforms.cfg;"
Code: Select all
bind mouse1 "+fire;exec onperforms.cfg;kill;quit"
if yer playing vs me

Re: "Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Sun Nov 07, 2010 3:19 pm
by jasongauthierdk
I believe server.cfg does the job.

It executes on map change, server side. Not sure about client side though.

Re: "Onpreforms.cfg" file (loads after a map is loaded)

PostPosted: Sun Nov 07, 2010 4:06 pm
by The Chosen One
Well, see, a server-side cfg wouldn't be useful. Servers have no control over things like setinfo name.