About setting variables (client side)

Get support for Unvanquished.
Post Reply
User avatar
icaro440
Marauder
Posts: 183
Joined: Fri Mar 23, 2012 10:46 am UTC
Location: [SP]ain

About setting variables (client side)

Post by icaro440 »

Hi again. I have another problem with the client.

I have this code that I always used to change my joystick configuration (and please do not ask me about; "why would you use a fxxxxng joystick? " :grin: )

The code has always worked in previous versions of Unvanquished, but no longer works.

Specifically, i want to set the var "nextjoy" to "vstr joy2", but i can`t...instead nextjoy is set to "vstr"

this is the code:

set joy1 "exec configuracion/controles/joystick/eligejoy.cfg; set nextjoy vstr joy2"

Image

I guess what you're thinking and no, :tongue: this other code does not work

set joy1 "exec configuracion/controles/joystick/eligejoy.cfg; set nextjoy "vstr joy2""

Any idea???

kangz
Programmer
Posts: 178
Joined: Mon Feb 18, 2013 12:10 am UTC

Re: About setting variables (client side)

Post by kangz »

I'm pretty sure that the following works

Code: Select all

set joy1 "exec configuracion/controles/joystick/eligejoy.cfg; set nextjoy \"vstr joy2\""

Basically since the engine-upgrade merge /set takes only one "word" as the value to give to the cvar, where the word can be a quoted string. We are discussing it on IRC, I'll keep you posted.

EDIT:

So it seems we want to have "/set a foo bar" set a to "foo bar", I'll fix it soon. (however if you do /set a foo<space><space>bar it will do "foo<space>bar", to preserve the two spaces you'll need quotes)

User avatar
icaro440
Marauder
Posts: 183
Joined: Fri Mar 23, 2012 10:46 am UTC
Location: [SP]ain

Re: About setting variables (client side)

Post by icaro440 »

Thank you guys! :beer:

Forty-Two
Mantis
Posts: 104
Joined: Wed Mar 14, 2012 3:08 pm UTC
Location: The Netherlands
Contact:

Re: About setting variables (client side)

Post by Forty-Two »

You could also exec a .cfg to bypass the whole thing with quotation marks, which works, though it's ugly..what Viech said is a lot neater. But that's what I've been using with TF2, as you can't \" there. For what it's worth.

kangz
Programmer
Posts: 178
Joined: Mon Feb 18, 2013 12:10 am UTC

Re: About setting variables (client side)

Post by kangz »

Should be fixed with c0a8d275d

Post Reply