Help - Search - Members - Calendar
Full Version: Marine + Kharaa Upgrade Script
Unknown Worlds Forums > Natural Selection > Natural Selection Creation > Scripting Discussion
cortex
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

CODE
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"


aaand... the kharaa.cfg

CODE
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"


any help would be appreciated, have a feeling i mucked something up with the +'s and -'s sad-fix.gif

EDIT:sry for the huge post too wink-fix.gif
BlueNovember
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:

QUOTE (Cut down code @ moved into more logical order)

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"
..


You press AND HOLD V, upgrade1 up is called
Mouse 4 is rebound to "resupply", and mouse5 to "shotgun"
At this point you must press mouse4 or mouse5 BEFORE YOU RELEASE V 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:

  • "Xenoform" is not aliased. Presumeably it's aliased elsewhere or you've been doing too much copying+pasting. tounge.gif
  • "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.
  • "Follow me" is not aliased either!


Pressing mouse4 before releasing V:
"Resuply"
QUOTE
alias "Resupply" "impulse 31; dev1; motdfile echo.txt; motd_write :: Resupply Selected ::; dev0"

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
QUOTE
impulse 64; dev1; motdfile echo.txt; motd_write :: Shotgun Selected ::; dev0"

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
cortex
Thanks for the help biggrin-fix.gif, 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 wink-fix.gif

EDIT: Oh yeah, afaik echo doesnt work since steam...
surprise
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
coris
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_civilian
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.
coris
QUOTE (a civilian @ Jun 6 2005, 06:50 PM)
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.

I can live with that. wink-fix.gif

Thanks a lot civ!
ReK
CODE
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"


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.
cortex
Mmmm none of my alien binds seem to be working, have nfi whats wrong with them. But thanks rek, ill give that a shot.
Amped1
That's because they're all the exact same impulse. tounge.gif
cortex
*sigh* i r teh ****. thnx though wink-fix.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.