Secondary Trigger
Created By: | CheapAlert |
eMail: | cheapalert@yahoo.com |
Difficulty Scale: | Easy |
// CheapAlert - Secondary Trigger Tut .float finger; // your fastest finger that picks in order A B C or DThat's the floating finger, that is really the value of which trigger to use. Now go to WEAPONS.QC. This is where we make most of the changes. Copy the entire W_Attack function and paste to make a new one. Call this function "W_Attack2". All righty! 2 ways to fire! But how do we fire the 2nd way? Go to the old W_Attack function and add this at the top:
if (self.finger == 1) { W_Attack2(); // use the other trigger return; }This will make sure that the right finger is in the right trigger. Now we're getting somewhere, aren't we?
void() W_MoveFinger = { if (self.finger == 0) { self.finger = 1; // now put it on the other trigger centerprint(self,"Secondary Mode\n"); // let him know without clogging the console with unsubliminal messages return; } if (self.finger == 1) { self.finger = 0; // ditto centerprint(self,"Primary Mode\n"); return; } };Now it's getting obvious about what we're doing here. Now let's add the impulses. Paste this under "CheatCommand();":
if (self.impulse == 210) self.finger = 0; // primary trigger if (self.impulse == 211) self.finger = 1; // secondary trigger if (self.impulse == 212) W_MoveFinger(); // toggle switchAhh....
// QUAKE RC begins // load the base configuration exec default.cfg // load the last saved configuration exec config.cfg // run a user script file if present exec autoexec.cfg // // stuff command line statements // stuffcmds // start demos if not allready running a server startdemos demo1 demo2 demo3 // CheapAlert - putting in the triggers alias +primary "impulse 210;+attack" alias -primary "-attack" alias +secondary "impulse 211;+attack" alias -secondary "-attack"Save as "QUAKE.RC" into your mod's root folder. (not your source code folder)