Upvote Upvoted 11 Downvote Downvoted
An Idea on the Alias command in TF2.
posted in Customization
1
#1
0 Frags +

To start off, I haven't taken though too much into this.
However I have taken into account on how this can be done.

The idea is... Well just imagine this for a moment. You probably know how r_drawviewmodel has two settings, 0 and 1.
0 to turn it off, and 1 to turn it on.
Well I had the idea where the alias command could have an extension on allowing the user to have a similar command.
Here's just a little bit of code that I have:

alias vm_on "r_drawviewmodel 1;viewmodel_fov 100"
alias vm_off "r_drawviewmodel 0;viewmodel_fov 100"

alias *tr_map (
1 = "map pl_badwater;exec regen"
2 = "map pl_upward;exec regen"
3 = "map tr_walkway_fix"
_define = "This is a command to set for opening certain maps in the maps folder."				
	//_define would define the command.
	//	Meaning it would tell the player what the command would do.
	//	For example:
	//	
	//	help tr_map
	//	
	//	- This is a command to set for opening certain maps in the maps folder.
	//	
	//	
	//	That's it.
	//	If there isn't a _define command, then it wouldn't say anything in the help command.
_name 3
	//_name would define how many different commands there are.
	// Aka, it would tell how many numbers to use in the command. Simular to a "endif" statement.
)

alias *vm_set (
0 = "vm_off"
1 = "vm_on"
_name 2
)

tr_map 1
	//This would load up pl_badwater and turn on the rocket jumping practice stript.

When this is active in a .cfg file, it allows the user to use the commands, vm_set, to have two different settings. 0 to turn it off, and 1 to turn it on. You can also use this kind of alias to allow for multiple commands as explained above.

I hope you can at least understand this. If you have any suggestions to change this or maybe add more features to this, then please do tell me and others.

Thanks.

To start off, I haven't taken though [b][u]too[/u][/b] much into this.
However I have taken into account on how this can be done.

The idea is... Well just imagine this for a moment. You probably know how r_drawviewmodel has two settings, 0 and 1.
0 to turn it off, and 1 to turn it on.
Well I had the idea where the alias command could have an extension on allowing the user to have a similar command.
Here's just a little bit of code that I have:
[code]alias vm_on "r_drawviewmodel 1;viewmodel_fov 100"
alias vm_off "r_drawviewmodel 0;viewmodel_fov 100"

alias *tr_map (
1 = "map pl_badwater;exec regen"
2 = "map pl_upward;exec regen"
3 = "map tr_walkway_fix"
_define = "This is a command to set for opening certain maps in the maps folder."
//_define would define the command.
// Meaning it would tell the player what the command would do.
// For example:
//
// help tr_map
//
// - This is a command to set for opening certain maps in the maps folder.
//
//
// That's it.
// If there isn't a _define command, then it wouldn't say anything in the help command.
_name 3
//_name would define how many different commands there are.
// Aka, it would tell how many numbers to use in the command. Simular to a "endif" statement.
)

alias *vm_set (
0 = "vm_off"
1 = "vm_on"
_name 2
)

tr_map 1
//This would load up pl_badwater and turn on the rocket jumping practice stript.[/code]

When this is active in a .cfg file, it allows the user to use the commands, vm_set, to have two different settings. 0 to turn it off, and 1 to turn it on. You can also use this kind of alias to allow for multiple commands as explained above.

I hope you can at least understand this. If you have any suggestions to change this or maybe add more features to this, then please do tell me and others.

Thanks.
2
#2
6 Frags +

I'd like it, if only so that you could actually store variables in a way that makes sense (tf2 scripting is technically turing complete within size limits, so you can still make psuedo-variables that work fine, though I won't get into that). But at the same time, I can't see it being used the way you intend it too much either. The way scripting is now, as long as you type an underscore instead of a space, that's equivalent to:

alias tr_map_1 "map pl_badwater;exec regen"
alias tr_map_2 "map pl_upward;exec regen"
alias tr_map_3 "map tr_walkway_fix"
alias help_tr_map "echo This is a command to set for opening certain maps in the maps folder."

alias vm_set_1 "r_drawviewmodel 1;viewmodel_fov 100"
alias vm_set_0 "r_drawviewmodel 0;viewmodel_fov 100"

If you wanted a nice fancy interface with it, you could throw this into the above code too, and have it work basically the same as you're suggesting (except the input would be "tr_map;1" instead of "tr_map 1"). Not many (any?) people do, not because it's overly complicated but more because it's just unnecessary, but anyway:

alias tr_map "alias 1 tr_map_1; alias 2 tr_map_2; alias 3 tr_map_3"
alias vm_set "alias 1 vm_set_1; alias 0 vm_set_0"

That would cause issues for if you typed another number in console later, but you could just throw in something inside tr_map_1/2/3 and vm_set_1/2 that runs "alias 1 none" for each number they used if you really cared for it. It wouldn't take much more work to get the help command working too, though the code would look pretty different. And could even throw 'setinfo tr_map " "; setinfo vm_set " "' to make them look like commands (show up in the dropdown menu) if you wanted to go all out.

Not saying I don't like the idea. The syntax is pretty bulky and weird for if you're trying to do things that can already be done almost as well in a similar amount of space. But it'd be a dream come true if it could do more variable-focused stuff. Things like being able to print different things out on the same line, or if statements, or being able to do math on the numbers (ie using multvar). Those three things alone would turn some 5000+ line scripts into 50 line scripts.

I'd like it, if only so that you could actually store variables in a way that makes sense (tf2 scripting is technically turing complete within size limits, so you [i]can[/i] still make psuedo-variables that work fine, though I won't get into that). But at the same time, I can't see it being used the way you intend it too much either. The way scripting is now, as long as you type an underscore instead of a space, that's equivalent to:[code]alias tr_map_1 "map pl_badwater;exec regen"
alias tr_map_2 "map pl_upward;exec regen"
alias tr_map_3 "map tr_walkway_fix"
alias help_tr_map "echo This is a command to set for opening certain maps in the maps folder."

alias vm_set_1 "r_drawviewmodel 1;viewmodel_fov 100"
alias vm_set_0 "r_drawviewmodel 0;viewmodel_fov 100"[/code]

If you wanted a nice fancy interface with it, you could throw this into the above code too, and have it work basically the same as you're suggesting (except the input would be "tr_map;1" instead of "tr_map 1"). Not many (any?) people do, not because it's overly complicated but more because it's just unnecessary, but anyway:[code]alias tr_map "alias 1 tr_map_1; alias 2 tr_map_2; alias 3 tr_map_3"
alias vm_set "alias 1 vm_set_1; alias 0 vm_set_0"[/code]
That would cause issues for if you typed another number in console later, but you could just throw in something inside tr_map_1/2/3 and vm_set_1/2 that runs "alias 1 none" for each number they used if you really cared for it. It wouldn't take much more work to get the help command working too, though the code would look pretty different. And could even throw 'setinfo tr_map " "; setinfo vm_set " "' to make them look like commands (show up in the dropdown menu) if you wanted to go all out.

Not saying I don't like the idea. The syntax is pretty bulky and weird for if you're trying to do things that can already be done almost as well in a similar amount of space. But it'd be a dream come true if it could do more variable-focused stuff. Things like being able to print different things out on the same line, or if statements, or being able to do math on the numbers (ie using multvar). Those three things alone would turn some 5000+ line scripts into 50 line scripts.
3
#3
1 Frags +

Thanks on that. I see what you mean, you think that the way I did it suggests that it's a little to bulky or crowded. I understand. But there has to be a way with how this kind of alias would work.
Another way I think it could work is a simple line by line code:

alias connection_set
	connect_set 1 "bad_net"
	connect_set 2 "good_net"
	connect_set 3 "more_net"
	alias connect_set "1,2,3"
	//This would tell the engine that there's only 3 commands

This is just a little something I came up with. It seems better than what I laid out earlier.
Again, there's many ways that valve would allow this.

Thanks on that. I see what you mean, you think that the way I did it suggests that it's a little to bulky or crowded. I understand. But there has to be a way with how this kind of alias would work.
Another way I think it could work is a simple line by line code:

[code]alias connection_set
connect_set 1 "bad_net"
connect_set 2 "good_net"
connect_set 3 "more_net"
alias connect_set "1,2,3"
//This would tell the engine that there's only 3 commands[/code]

This is just a little something I came up with. It seems better than what I laid out earlier.
Again, there's many ways that valve would allow this.
Please sign in through STEAM to post a comment.