Config execution through scripting?

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Config execution through scripting?

Post by Pedsdude » March 21st, 2006, 8:06 pm

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?
Image
Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 21st, 2006, 8:33 pm

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...
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » March 21st, 2006, 8:35 pm

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?
Image
Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 21st, 2006, 8:39 pm

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)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » March 21st, 2006, 8:43 pm

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?
Image
Image

leveller
CJ Fan
CJ Fan
Posts: 156
Joined: June 25th, 2005, 12:24 pm

Post by leveller » March 21st, 2006, 9:19 pm

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.

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » March 22nd, 2006, 6:19 pm

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?
Image
Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 22nd, 2006, 8:14 pm

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.

;)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Pedsdude
Site Admin
Site Admin
Posts: 15914
Joined: October 15th, 2004, 7:18 pm
Location: UK

Post by Pedsdude » March 22nd, 2006, 11:30 pm

Hmm, I'll try it out ;)
Image
Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests