- Code: Select all
//======================================================================
// Alias Switcher V3 | Last Updated 6/7/09
//======================================================================
// Credits:
// PlasmaSheep - Code
// ---------------------------------------------------------------------
// This script implements a player profile/alias carousel. -------------
// ---------------------------------------------------------------------
//Config
//This is the message that shows when you have switched a profile
alias is_switchmessage "echo ${nn_gmessagepre}Identity shifted! (Name is ^4$_cl_name^1)${nn_gmessagepos}"
//Both Insert and Delete must be pressed to disengage safeties.
alias +is_inslevel "bind DEL \"is_safeties\""
alias -is_inslevel "unbind DEL"
//This turns the safeties off, binds F12 to switch nicks, and then waits
//15 seconds to turn safeties on again
//These aliases prevents safeties being turned on twice (once when
//carousel is executed, once when player model switches)
alias is_safetyswitchm "$is_safetyswitch"
alias is_safetyswitch "unbind F12; echo ${nn_gmessagepre}Safeties ^4on^1!${nn_gmessagepos}" //this will never be modified
alias is_safeties "alias is_safetyswitchm \"is_safetyswitch\"; echo ${nn_gmessagepre}Safeties off!${nn_gmessagepos}; bind F12 \"$is_gateway\"; defer 15 \"is_safetyswitchm\";"
//This points to whichever alias will be selected
set is_gateway "is_shift1"
//Now a list of aliases
//Each of these first change settings (name, playermodel, skin),
//then echo that the identity has changed, alias gateway to next
//carousel stop, re-engage safeties (unbind F12), and prevent safeties
//from being re-engaged by the defer process
alias is_shift1 "name XYZ; playermodel models/player/insurrectionist.zym; is_switchmessage; alias is_gateway \"is_shift2\"; unbind F12; alias is_safetyswitchm \"\";"
alias is_shift2 "name ZYX; playermodel models/player/nexus.zym; playerskin 0; is_switchmessage; alias is_gateway \"is_shift3\"; unbind F12;alias is_safetyswitchm \"\";"
alias is_shift3 "name ABC; playermodel models/player/pyria.zym; is_switchmessage; alias is_gateway \"is_shift4\"; unbind F12;alias is_safetyswitchm \"\";"
alias is_shift4 "name CBA; playermodel models/player/specop.zym; is_switchmessage; alias is_gateway \"is_shift1\"; unbind F12;alias is_safetyswitchm \"\";"
//Set the wheels in motion by binding INS
bind INS "+is_inslevel"
Here's how I set nn_gmessagepos and nn_gmessagepre elsewhere (I use the ninja pack):
- Code: Select all
set nn_gmessagepre "^8-^7=^1["
set nn_gmessagepos "^1]^7=^8-"
Put those in the top of the file if you want to use those.
Installation
Save it as is_identityswitcher.cfg in your nexuiz data folder (~./nexuiz/data on *nix). Add this line to autoexec.cfg, also in the data folder:
- Code: Select all
exec is_identityswitcher.cfg
It will load automatically every time you start nexuiz.
Use
Press ins+del together to disengage the safety mechanism. You now have 15 seconds to press F12 before the safeties re-engage. Pressing F12 will execute is_shift1, the first carousel stop. Disengage safeties again and press F12 again, you will be at is_shift2, the second carousel stop. The stops modify both name and player model. This only has two stops, but more can be added if you like aliases.
*Update v2*
Changes:
You can switch profiles while unconnected (dur dur dur): "is_nextprofile" in console.
Message shown when switching displays new name.
Message shown when switching is stored in an alias.
Carousel now picks up where it left off, even if you restart nexuiz.
*Updates v3*
Changes:
The "safeties on" message appears only if the time has run out and no shift has occurred. Before, it was when time has run out with or without an identity switch.