Marine + Kharaa Upgrade Script

cortexcortex Join Date: 2003-11-28 Member: 23707Members
edited May 2005 in Scripting Discussion
<div class="IPBDescription">need a lil help</div> Hey, I need some help with my script, can't quite figure out what's wrong.
Basicly what it does is, i press a button and then one of two-four mouse buttons to select an upgrade, would be great if i could get this to work.

well anyway heres the marine.cfg

<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->bind "v"  "+upgrade1"
bind "b"  "+upgrade2"
bind "n"  "+upgrade3"
bind "t"  "+upgrade4"
bind "m"  "+upgrade5"
bind "mouse3" "+upgrade5"

alias "Armour 1" "impulse 20; dev1; motdfile echo.txt; motd_write :: Armour 1 Selected ::; dev0"
alias "Armour 2" "impulse 21; dev1; motdfile echo.txt; motd_write :: Armour 2 Selected ::; dev0"
alias "Armour 3" "impulse 22; dev1; motdfile echo.txt; motd_write :: Armour 3 Selected ::; dev0"
alias "Weapons 1" "impulse 23; dev1; motdfile echo.txt; motd_write :: Weapons 1 Selected ::; dev0"
alias "Weapons 2" "impulse 24; dev1; motdfile echo.txt; motd_write :: Weapons 2 Selected ::; dev0"
alias "Weapons 3" "impulse 25; dev1; motdfile echo.txt; motd_write :: Weapons 3 Selected ::; dev0"
alias "Catalyst" "impulse 27; dev1; motdfile echo.txt; motd_write :: Catalyst Selected ::; dev0"
alias "Resupply" "impulse 31; dev1; motdfile echo.txt; motd_write :: Resupply Selected ::; dev0"
alias "Motion" "impulse 33; dev1; motdfile echo.txt; motd_write :: Motion Tracking Selected ::; dev0"
alias "HandGren" "impulse 37; dev1; motdfile echo.txt; motd_write :: Hand Grenade Selected ::; dev0"
alias "HeavyArmour" "impulse 38; dev1; motdfile echo.txt; motd_write :: Heavy Armour Selected ::; dev0"
alias "Jetpack" "impulse 39; dev1; motdfile echo.txt; motd_write :: Jetpack Selected ::; dev0"
alias "Scan"  "impulse 53; dev1; motdfile echo.txt; motd_write :: Scan Team Selected ::; dev0"
alias "Mines"  "impulse 61; dev1; motdfile echo.txt; motd_write :: Mines Selected ::; dev0"
alias "Welder" "impulse 62; dev1; motdfile echo.txt; motd_write :: Welder Selected ::; dev0"
alias "Shotgun" "impulse 64; dev1; motdfile echo.txt; motd_write :: Shotgun Selected ::; dev0"
alias "HMG"  "impulse 65; dev1; motdfile echo.txt; motd_write :: HMG Selected ::; dev0"
alias "GL"  "impulse 66; dev1; motdfile echo.txt; motd_write :: GL Selected ::; dev0"
alias "+upgrade1" "unbind mouse4;unbind mouse5;bind mouse4 Resupply;bind mouse5 Shotgun"
alias "-upgrade1" "unbind mouse4;unbind mouse5;bind mouse4 Xenoform;bind mouse5 Follow me"
alias "+upgrade2" "unbind mouse4;unbind mouse5;bind mouse4 Armour 1;bind mouse5 Weapons 1"
alias "-upgrade2" "unbind mouse4;unbind mouse5;bind mouse4 Xenoform;bind mouse5 Follow me"
alias "+upgrade3" "unbind mouse4;unbind mouse5;bind mouse4 Armour 2;bind mouse5 Weapons 2"
alias "-upgrade3" "unbind mouse4;unbind mouse5;bind mouse4 Xenoform;bind mouse5 Follow me"
alias "+upgrade4" "unbind mouse4;unbind mouse5;bind mouse4 Jetpack;bind mouse5 Motion"
alias "-upgrade4" "unbind mouse4;unbind mouse5;bind mouse4 Xenoform;bind mouse5 Follow me"
alias "+upgrade5" "unbind mouse4;unbind mouse5;bind mouse4 Armour 3;bind mouse5 "weapons 3"
alias "-upgrade5" "unbind mouse4;unbind mouse5;bind mouse4 Xenoform;bind mouse5 Follow me"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

aaand... the kharaa.cfg

<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->bind "mouse2" "+aupgrades1"
bind  "v"  "+aupgrades2"
bind  "b"  "+aupgrades3"
bind "n"  "+aupgrades4"
bind "t"  "+aupgrades5"

alias "OC"  "impulse 91; dev1; motDfile echo.txt; motd_write :: OC Placed ::; dev0"
alias "DC"  "impulse 91; dev1; motdfile echo.txt; motd_write :: DC Placed ::; dev0"
alias "MC"  "impulse 91; dev1; motdfile echo.txt; motd_write :: MC Placed ::; dev0"
alias "SC"  "impulse 91; dev1; motdfile echo.txt; motd_write :: SC Placed ::; dev0"
alias "RT"  "impulse 91; dev1; motdfile echo.txt; motd_write :: RT Placed ::; dev0"
alias "Hive"  "impulse 91; dev1; motdfile echo.txt; motd_write :: Hive Placed ::; dev0"
alias "Skulk"  "impulse 91; dev1; motdfile echo.txt; motd_write :: Skulking ::; dev0"
alias "Gorge"  "impulse 91; dev1; motdfile echo.txt; motd_write :: Gorging ::; dev0"
alias "Lerk"  "impulse 91; dev1; motdfile echo.txt; motd_write :: Lerking ::; dev0"
alias "Fade"  "impulse 91; dev1; motdfile echo.txt; motd_write :: Fading ::; dev0"
alias "Onos"  "impulse 91; dev1; motdfile echo.txt; motd_write :: Onosing ::; dev0"
alias "Carapace" "impulse 91; dev1; motdfile echo.txt; motd_write :: Carapace Selected ::; dev0"
alias "Regeneration" "impulse 91; dev1; motdfile echo.txt; motd_write :: Regeneration ::; dev0"
alias "Redemption" "impulse 91; dev1; motdfile echo.txt; motd_write :: Redemption ::; dev0"
alias "Adrenaline" "impulse 91; dev1; motdfile echo.txt; motd_write :: Adrenaline ::; dev0"
alias "Celerity" "impulse 91; dev1; motdfile echo.txt; motd_write :: Celerity ::; dev0"
alias "Silence" "impulse 91; dev1; motdfile echo.txt; motd_write :: Silence ::; dev0"
alias "Cloaking" "impulse 91; dev1; motdfile echo.txt; motd_write :: Cloaking ::; dev0"
alias "Focus"  "impulse 91; dev1; motdfile echo.txt; motd_write :: Focus ::; dev0"
alias "Scent of Fear" "impulse 91; dev1; motdfile echo.txt; motd_write :: Scent of Fear ::; dev0"
alias "+aupgrade1" "bind mouse3 Silence;bind mouse2 Celerity;bind mouse4 Adrenaline;bind mouse5 Redemption"
alias "-aupgrade1" "bind mouse3 +jump;unbind mouse2;unbind mouse4;unbind mouse5"
alias "+aupgrade2" "bind mouse3 Carapace;bind mouse2 Regeneration bind mouse4 Scent of Fear;bind mouse5 Cloaking"
alias "-aupgrade2" "bind mouse3 +jump;unbind mouse2;unbind mouse4;unbind mouse5"
alias "+aupgrade3" "bind mouse3 Focus;bind mouse2 Skulk;bind mouse4 Gorge; bind mouse5 RT"
alias "-aupgrade3" "bind mouse3 +jump;unbind mouse2;unbind mouse4;unbind mouse5"
alias "+aupgrade4" "bind mouse3 DC;bind mouse2 OC;bind mouse4 SC; bind mouse5 MC"
alias "-aupgrade4" "bind mouse3 +jump;unbind mouse2;unbind mouse4;unbind mouse5"
alias "+aupgrade5" "bind mouse3 Lerk;bind mouse2 Fade;bind mouse4 Onos;"
alias "-aupgrade5" "bind mouse3 +jump;unbind mouse2;unbind mouse4;unbind mouse5"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

any help would be appreciated, have a feeling i mucked something up with the +'s and -'s <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad-fix.gif' border='0' style='vertical-align:middle' alt='sad-fix.gif' /><!--endemo-->

EDIT:sry for the huge post too <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink-fix.gif' border='0' style='vertical-align:middle' alt='wink-fix.gif' /><!--endemo-->

Comments

  • BlueNovemberBlueNovember hax Join Date: 2003-02-28 Member: 14137Members, Constellation
    OK, the code can be imagined to be a tree, where all the possible branches resemble other branches, so let's just examine one of those branches:

    <!--QuoteBegin-Cut down code+ moved into more logical order--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Cut down code @ moved into more logical order)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
    bind "v"  "+upgrade1"
    ...
    alias "+upgrade1" "unbind mouse4;unbind mouse5;bind mouse4 Resupply;bind mouse5 Shotgun"

    alias "-upgrade1" "unbind mouse4;unbind mouse5;bind mouse4 Xenoform;bind mouse5 Follow me"

    alias "Resupply" "impulse 31; dev1; motdfile echo.txt; motd_write :: Resupply Selected ::; dev0"

    alias "Shotgun" "impulse 64; dev1; motdfile echo.txt; motd_write :: Shotgun Selected ::; dev0"
    ..
    <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->

    You press <b>AND HOLD</b> V, upgrade1 up is called
    Mouse 4 is rebound to "resupply", and mouse5 to "shotgun"
    At this point you must press mouse4 or mouse5 <b>BEFORE YOU RELEASE V</b> in order to select these aliases.

    We'll come back to that.
    You could now release V, and mouse4 becomes "Xenoform" and mouse 5 "follow me"

    Points to notice so far:<ul>
    </li><li>"Xenoform" is not aliased. Presumeably it's aliased elsewhere or you've been doing too much copying+pasting. <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
    </li><li>"follow me" contains a space. :S Avoid! There's a chance mouse5 will be bound to simply "follow". In my experience, sometimes it happens, sometimes it does not.
    </li><li>"Follow me" is not aliased either!
    </li></ul>

    Pressing mouse4 before releasing V:
    "Resuply"
    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->alias "Resupply" "impulse 31; dev1; motdfile echo.txt; motd_write :: Resupply Selected ::; dev0"<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    Gack.
    For the purposes of debugging, can't we change this to:
    alias "Resupply" "impulse 31;developer 1;echo Resupply_Selected;developer 0"


    Pressing mouse5 before releasing V
    Shotgun
    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->impulse 64; dev1; motdfile echo.txt; motd_write :: Shotgun Selected ::; dev0"<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    As above. Alter to:
    alias "Shotgun" "impulse 64;developer 1;echo Shotgun_Selected;developer 0"

    Pressing mouse4 after releasing V
    Xenoform is triggered, but there is no code for it.

    Pressing mouse5 after releasing V
    "Follow me" is triggered, but there is no code for it and the space in its alias name may cause problems.
    ---

    Whew.
    Good luck, take it step by step, and stop using spaces in aliases!
    HTH
  • cortexcortex Join Date: 2003-11-28 Member: 23707Members
    edited May 2005
    Thanks for the help <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin-fix.gif' border='0' style='vertical-align:middle' alt='biggrin-fix.gif' /><!--endemo-->, follow me etc were already aliased but ill simplify the names of the alias' to get rid of spaces... let you know how it goes <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink-fix.gif' border='0' style='vertical-align:middle' alt='wink-fix.gif' /><!--endemo-->

    EDIT: Oh yeah, afaik echo doesnt work since steam...
  • surprisesurprise Join Date: 2003-01-16 Member: 12382Members, Constellation
    yes, it should, but it only shows in the console, and its useless there...

    you dont check the console when you want statusmessages like that


    so you have to use the motd-trick
  • coriscoris Join Date: 2003-07-08 Member: 18034Members, Constellation
    I'd like a marine-upgrade scripts that get the following (bound to one button).

    Resupply
    Weapons 1
    Shotgun
    Armour 1
    Armour 2
    Jp
    Dmg 2
  • a_civiliana_civilian Likes seeing numbers Join Date: 2003-01-08 Member: 12041Members, NS1 Playtester, Playtest Lead
    coris:

    bind <key> "impulse 31; wait; impulse 23; wait; impulse 64; wait; impulse 20; wait; impulse 21; wait; impulse 39; wait; impulse 24"

    Only issue is that if you have one too few levels to get a jetpack with that sequence, you'll get weapons 2 instead.
  • coriscoris Join Date: 2003-07-08 Member: 18034Members, Constellation
    <!--QuoteBegin-a civilian+Jun 6 2005, 06:50 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (a civilian @ Jun 6 2005, 06:50 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> coris:

    bind <key> "impulse 31; wait; impulse 23; wait; impulse 64; wait; impulse 20; wait; impulse 21; wait; impulse 39; wait; impulse 24"

    Only issue is that if you have one too few levels to get a jetpack with that sequence, you'll get weapons 2 instead. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    I can live with that. <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink-fix.gif' border='0' style='vertical-align:middle' alt='wink-fix.gif' /><!--endemo-->

    Thanks a lot civ!
  • ReKReK Join Date: 2004-08-30 Member: 31058Members, Constellation, Reinforced - Shadow, WC 2013 - Silver
    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->alias resup "impulse 31; alias rineUps weap1; dev1; motdfile echo.txt; motd_write Resupply; dev0"
    alias weap1 "impulse 23; alias rineUps shirtgun; dev1; motdfile echo.txt; motd_write Weapons 1; dev0"
    alias shirtgun "impulse 64; alias rineUps arm1; dev1; motdfile echo.txt; motd_write Shotgun; dev0"
    alias arm1 "impulse 20; alias rineUps arm2; dev1; motdfile echo.txt; motd_write Armour 1; dev0"
    alias arm2 "impulse 21; alias rineUps jp; dev1; motdfile echo.txt; motd_write Armour 2; dev0"
    alias jp "impulse 39; alias rineUps weap2"; dev1; motdfile echo.txt; motd_write Jetpack; dev0
    alias weap2 "impulse 24; alias rineUps done; dev1; motdfile echo.txt; motd_write Weapons 2; dev0"
    alias done "dev1; motdfile echo.txt; motd_write Upgrades finished; dev0"
    alias reset "alias rineUps resup"
    reset
    bind "key" "rineUps"
    bind "key" "reset"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    Try that, would work better imo. Change the first bind to the upgrade key, change the second to a key that will reset it, incase you order your jp with only 1 point, for example. Note that it will reset to resup, so you'll have to cycle through again.
  • cortexcortex Join Date: 2003-11-28 Member: 23707Members
    Mmmm none of my alien binds seem to be working, have nfi whats wrong with them. But thanks rek, ill give that a shot.
  • Amped1Amped1 Join Date: 2003-02-08 Member: 13287Members
    That's because they're all the exact same impulse. <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
  • cortexcortex Join Date: 2003-11-28 Member: 23707Members
    *sigh* i r teh ****. thnx though <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink-fix.gif' border='0' style='vertical-align:middle' alt='wink-fix.gif' /><!--endemo-->
Sign In or Register to comment.