Powered by Invision Power Board [ Resend Validation Email ]
Welcome Guest [ Log In · Register ]
Forum Rules HelpSearchMembersCalendar


 
Reply to this topicStart new topicStart Poll
[ Track this topic · Email this topic · Print this topic ]
> Script Help, Why doesn't this work?
Gneralas
Posted: January 21, 2005 08:54 am
Quote Post


Last hope of Mankind
*****

Group: Members
Posts: 680

Joined: January 15, 2005



CODE
alias mouseToggle "mouse_on"
alias mouse_on "+mouse;developer 1;echo mouse is on;developer 0;alias mouseToggle mouse_off"
alias mouse_off "-mouse;developer 1;echo mouse is off;developer 0;alias mouseToggle mouse_on"

bind "mouse3" "mouseToggle"


I made this little script to make upgrade selecting a little easier but it doesn't work, whats wrong with it?

Please no Flames. ph34r.gif


--------------------
User Posted Image*
User Posted Image
*OMG!!1 A signature change!!!
PMEmail Poster
Top
Zpin
Posted: January 21, 2005 10:29 am
Quote Post


Einherjar
Group Icon

Group: IronOak Leader (Admin)
Posts: 1337

Joined: July 14, 2002



you can just use the commands:
hpup - adds a skillpoint to hitpoints
dmgup - adds a skillpoint to skill
spdup - adds a skillpoint to speed


--------------------
The race is not to the swift or the battle to the strong, nor does food come to the wise or wealth to the brilliant or favor to the learned; but time and chance happen to them all. - Ecclesiastes IX. 11.
---
The fool speaks, the wise man listens. - unknown
PMUsers Website
Top
Gneralas
Posted: January 21, 2005 11:35 am
Quote Post


Last hope of Mankind
*****

Group: Members
Posts: 680

Joined: January 15, 2005



Oh cool, i didnt know that, thanks!

Are there commands for spawning as a human and zombie?

I would like to know whats wrong with my script anyway please because this is the first one i have written and i just want to know my mistakes.


--------------------
User Posted Image*
User Posted Image
*OMG!!1 A signature change!!!
PMEmail Poster
Top
Immoral Sniper
Posted: January 21, 2005 04:07 pm
Quote Post


The force is strong in me
Group Icon

Group: BB Betatesters
Posts: 1177

Joined: December 10, 2004



You never, ever, EVER, declare an alias within a script.

It should be "bind mouse3 mouse_off" and "bind mouse3 mouse_on" instead of your aliases as the last command.


--------------------
BB Maps I've made...
bb_stronghold {Beta 9}
bb_shootingrange {Beta 1}

Threads you should read before posting...
Immoral's List of Things Not to Suggest
Immoral's Mapping Guide

Forum Spammers
Name (Number of spamming citations issued)

Nikku (3), -KRUX- (2), Mitchell (2), hunter (2), Gneralas (2), CHAY (2), vyvu (2), Rustie1821 (1), w00t (1), dagny (1), Nandu666 (1), The.Raver(1), moecomputer (1), -=Jouni=- (1), santa_kills (1), DarknessGlams (1)
PMEmail PosterUsers WebsiteAOL
Top
XxAvalanchexX
Posted: January 22, 2005 12:47 am
Quote Post


Rotten Meat


Group: Members
Posts: 4

Joined: January 19, 2005



Put your aliases in userconfig.cfg.

And also, it is perfectly fine to alias inside of a script. This is my userconfig.cfg for Day of Defeat:

CODE
alias "adjust_crosshair" "xhair1"
alias "xhair0" "cl_xhair_style 0; alias adjust_crosshair xhair1"
alias "xhair1" "cl_xhair_style 1; alias adjust_crosshair xhair2"
alias "xhair2" "cl_xhair_style 2; alias adjust_crosshair xhair3"
alias "xhair3" "cl_xhair_style 3; alias adjust_crosshair xhair4"
alias "xhair4" "cl_xhair_style 4; alias adjust_crosshair xhair5"
...etcetera


--------------------
user posted image
Run. Think. Shoot. Live.
PMEmail Poster
Top
Gneralas
Posted: January 22, 2005 08:24 am
Quote Post


Last hope of Mankind
*****

Group: Members
Posts: 680

Joined: January 15, 2005



CODE
alias mouseToggle "mouse_on"
alias mouse_on "+mouse;bind mouse3 mouse_off"
alias mouse_off "-mouse;bind mouse3 mouse_on"

bind "mouse3" "mouseToggle"


After seeing what immoral sniper had written i changed my script but it still doesn't work, is this what you mean?

I still want to know what the commands are for spawning as a human and as a zombie because since i found out that i can just use 3 different buttons for upgrading surely there are buttons for respawning as things.

I should have said this at the start but what happens with my script is, i press the button and thats fine then it doesn't toggle it back off so i have to type -mouse in the console to get rid of it.


--------------------
User Posted Image*
User Posted Image
*OMG!!1 A signature change!!!
PMEmail Poster
Top
Zpin
Posted: January 22, 2005 11:57 am
Quote Post


Einherjar
Group Icon

Group: IronOak Leader (Admin)
Posts: 1337

Joined: July 14, 2002



rehuman - respawn as human
dzombie - play as zombie (as soon as you escaped)
dspectate - spectate again (as soon as you escaped)

I'll add all of these commands in the keyboard settings next version.


--------------------
The race is not to the swift or the battle to the strong, nor does food come to the wise or wealth to the brilliant or favor to the learned; but time and chance happen to them all. - Ecclesiastes IX. 11.
---
The fool speaks, the wise man listens. - unknown
PMUsers Website
Top
Gneralas
Posted: January 22, 2005 01:50 pm
Quote Post


Last hope of Mankind
*****

Group: Members
Posts: 680

Joined: January 15, 2005



Cool, thanks so much Spin!


--------------------
User Posted Image*
User Posted Image
*OMG!!1 A signature change!!!
PMEmail Poster
Top
Immoral Sniper
Posted: January 22, 2005 03:35 pm
Quote Post


The force is strong in me
Group Icon

Group: BB Betatesters
Posts: 1177

Joined: December 10, 2004



CODE
alias mouse_on "+mouse;bind mouse3 mouse_off"
alias mouse_off "-mouse;bind mouse3 mouse_on"

bind "mouse3" "mouse_on"


This should work...


--------------------
BB Maps I've made...
bb_stronghold {Beta 9}
bb_shootingrange {Beta 1}

Threads you should read before posting...
Immoral's List of Things Not to Suggest
Immoral's Mapping Guide

Forum Spammers
Name (Number of spamming citations issued)

Nikku (3), -KRUX- (2), Mitchell (2), hunter (2), Gneralas (2), CHAY (2), vyvu (2), Rustie1821 (1), w00t (1), dagny (1), Nandu666 (1), The.Raver(1), moecomputer (1), -=Jouni=- (1), santa_kills (1), DarknessGlams (1)
PMEmail PosterUsers WebsiteAOL
Top
XxAvalanchexX
Posted: January 22, 2005 06:03 pm
Quote Post


Rotten Meat


Group: Members
Posts: 4

Joined: January 19, 2005



Oh, I see. Unfortunately, it will not work. When you bind a +command to a key, the -command is automatically called when you release the key. Just like your mouse1 is bound to +attack (most likely, anyway), -attack is called as soon as you release it. However, if you open up your console and type +attack, you will keep firing until you go back into the console and type -attack.


--------------------
user posted image
Run. Think. Shoot. Live.
PMEmail Poster
Top
|2enegade
Posted: January 23, 2005 12:10 am
Quote Post


Last hope of Mankind
*****

Group: Members
Posts: 752

Joined: November 29, 2004



QUOTE (Gneralas @ Jan 21 2005, 08:54 AM)
CODE
alias mouseToggle "mouse_on"
alias mouse_on "+mouse;developer 1;echo mouse is on;developer 0;alias mouseToggle mouse_off"
alias mouse_off "-mouse;developer 1;echo mouse is off;developer 0;alias mouseToggle mouse_on"

bind "mouse3" "mouseToggle"


what went wrong is when you put alias mouseToggle mouse_off in your last line of mouse_on. It should be this:
CODE
alias mouseToggle "mouse_on"
alias mouse_on "+mouse;developer 1;echo mouse is on;developer 0; mouse_off"
alias mouse_off "-mouse;developer 1;echo mouse is off;developer 0; mouse_on"

bind "mouse3" "mouseToggle"


notice I have removed the "alias mouseToggle" prefixes. To switch the alias mouseToggle from mouse_on to mouse_off all you have to type is "mouse_on" or "mouse_off" you do not need to type alias mouseToggle mouse_on, that was what the problem was.

Also @ avalanche, - commands are ONLY activitaded on *hardcoded* + commands (i.e. +attack, +jump, +mouse) any *user* defined +commands MUST have corresponding - commands in the script. Thus if you have +attack, you do not need to type -attack (it is automatically followed because +attack is a hardcoded command) however if you have +mycustomcommand you must type a -mycustomcommand because that is a userdefined command, so HL won't automatically run the - command for it.

P.S. @Spin, that's a good idea!! binding those commands to a key would save a lot of time, thx!


--------------------
PMEmail PosterUsers Website
Top
Topic Options Reply to this topicStart new topicStart Poll