Page 1 of 1

Config execution through scripting?

Posted: March 21st, 2006, 8:06 pm
by Pedsdude
Is it possible to have it so that when someone activates a trigger, a config (included in the .pk3 file) executes? If not is anything similar possible?

Posted: March 21st, 2006, 8:33 pm
by Drofder2004
Its possible but it wont work how you want it to ;)

Any config that is executed through a script is server side and does not apply to clients...

Posted: March 21st, 2006, 8:35 pm
by Pedsdude
Ah... fair enough. Unless the person is playing it on their own computer?

What about doing it so that when they activate the trigger something like cg_hudalpha changes, or drawgun etc?

Posted: March 21st, 2006, 8:39 pm
by Drofder2004
Pedsdude wrote:Ah... fair enough. Unless the person is playing it on their own computer?

What about doing it so that when they activate the trigger something like cg_hudalpha changes, or drawgun etc?
Again, those will affect the server CoD files not the players, unless the player is playing locally.

Not sure how it works with cheat protection, you can only try it ;)

BTW, you dont need a script to change a cvar, just use

Code: Select all

self setCvar(("<cvar>"), "<var>");
where cvar is the cvar you change (cg_hudalpha) and var is the variable (0.1, etc)

Posted: March 21st, 2006, 8:43 pm
by Pedsdude
Drofder2004 wrote:

Code: Select all

self setCvar(("<cvar>"), "<var>");
where cvar is the cvar you change (cg_hudalpha) and var is the variable (0.1, etc)
So that won't work on a public server, only if the player is playing locally?

Posted: March 21st, 2006, 9:19 pm
by leveller

Code: Select all

self setCvar(("<cvar>"), "<var>");
"self" in in this case, is the player, who is running a certain script, on a given time.

eg

"Pedsdude" runs trough a trigger
then print a line

iprintlnbold("Pedsdude has run trough a trigger"); <-- this is a message to all

self iprintlnbold ("you just ran trough a trigger"); <-- this is a message to you alone

so you see, it doesnt mather if its played local, or public, the outcome is always the same.

Posted: March 22nd, 2006, 6:19 pm
by Pedsdude
So I could have:

Code: Select all

self setCvar(("cg_hudalpha"), "0"); 
And it would remove the person's HUD when they set off a trigger?

Posted: March 22nd, 2006, 8:14 pm
by Drofder2004
Pedsdude wrote:So I could have:

Code: Select all

self setCvar(("cg_hudalpha"), "0"); 
And it would remove the person's HUD when they set off a trigger?
trial and error.

Make a map with nothing but a skybox and a trigger and then get someone on a test server with you, and only 1 person touch trigger.

;)

Posted: March 22nd, 2006, 11:30 pm
by Pedsdude
Hmm, I'll try it out ;)