Server command does only work after changelevel

Avatar
PortalCombat
306 Posts
Posted May 19, 2013
Hey guys.

I have a small problem and want to know, if there is a way to fix it.

I have a 'sv_' command which only works with 'sv_cheats 1' and
when I use 'changelevel <mapname>' to restart the coop map.

The console shows up the changed value, so I am sure it is set up right,
but as long as I dont restart the map, or go to another map, it wont take effect.

So now I am looking for a way to either restart the map via OnMapSpawn (Once only!),
so I guess i would need a global variable or a file to save a variable to or I need
a console command to 'refresh' or 'load' the current 'sv_' values, to make them active.

Advertisement
Registered users don’t see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted May 19, 2013
Replied 4 hours later
What command are you talking about?

The easiest way might be to make two BSP files, the first connecting to the second. The first will set the necessary values, then changelevel to the next.

Avatar
ChickenMobile
2,460 Posts
Posted May 19, 2013
Replied 1 hour later

FelixGriffin wrote:
The easiest way might be to make two BSP files, the first connecting to the second. The first will set the necessary values, then changelevel to the next.

Indeed. Create a intro map (as small as possible) which executes the commands and then changes the level.

Avatar
PortalCombat
306 Posts
Posted May 19, 2013
Replied 1 hour later
.. so there is no way to check the state of a 'sv_' variable?
.. and there is no way to save a value to a file or use a global variable? :sad:

I guess I will just add a button to restart the map then, and add a text message
so that players will know what to do. I just started to work on an old map idea
which i started in 2011 but stopped it, because there were too many problems.

Avatar
josepezdj
2,386 Posts
Posted May 20, 2013
Replied 2 hours later
I guess you're using a logic_auto to fire those outputs OnMapSpawn, ensure you leave enough delay to let the map settle everything down before your outputs (like 0.10 or 0.20). However, sometimes in coop, the problem is the logic_auto entity that's buggy. Try a trigger brush under any player instead.
Avatar
ChickenMobile
2,460 Posts
Posted May 20, 2013
Replied 1 hour later
It really depends on what server command you want to execute. There are some commands which only take effect after you change or restart the level.

I always wondered if there was a way to figure out the value of a server variable and use some sort of script to execute commands based off it, but never figured it out.
Creating a dummy map is a good alternative if a map restart is a must.

Remember to change the command back after the map has been finished just in case it interferes with other maps they would play.

Avatar
PortalCombat
306 Posts
Posted May 20, 2013
Replied 1 hour later
Well, thanks for your replies.
I am already using a trigger brush and OnStartTouchOrangePlayer Output.

But even if I try to set the value myself, it wont work without a changelevel command.
So I guess I will have to live with that. :sad:

Avatar
PortalCombat
306 Posts
Posted May 20, 2013
Replied 3 hours later
Yeah... sometimes I love randomness!
I just slipped over the solution by accident. :lol:

Instead of restarting the map with change level, I just have to kill both players.
The command works as soon as at least one of them got killed. =)

Avatar
ChickenMobile
2,460 Posts
Posted May 22, 2013
Replied 1 day later

PortalCombat wrote:
Yeah... sometimes I love randomness!
I just slipped over the solution by accident. :lol:

Instead of restarting the map with change level, I just have to kill both players.
The command works as soon as at least one of them got killed. =)

What is this command? Sounds truly odd xD

Avatar
PortalCombat
306 Posts
Posted May 22, 2013
Replied 13 hours later

ChickenMobile wrote:
What is this command? Sounds truly odd xD

sv_speed_normal (speed when you are not on speed gel)

Avatar
FelixGriffin
2,680 Posts
Posted May 22, 2013
Replied 1 hour later
Player_speedmod anyone?
Avatar
ChickenMobile
2,460 Posts
Posted May 23, 2013
Replied 9 hours later

FelixGriffin wrote:
Player_speedmod anyone?

Wouldn't this also change the speed when you are on speed gel too?

Avatar
FelixGriffin
2,680 Posts
Posted May 23, 2013
Replied 35 minutes later
Well, yes, but it would just scale it by the same amount. And I'm pretty sure the gel speed convar can be set instantly.
Avatar
ChickenMobile
2,460 Posts
Posted May 25, 2013
Replied 1 day later

FelixGriffin wrote:
Well, yes, but it would just scale it by the same amount. And I'm pretty sure the gel speed convar can be set instantly.

It can, however I've found that a number of people have had trouble when I used this command in tc_vitrified. It would be better to change one thing rather than have to change one thing and then fix up the others.

Avatar
FelixGriffin
2,680 Posts
Posted May 25, 2013
Replied 41 minutes later
Oh, you used it in Vitrified? Where?
Advertisement
Registered users don’t see ads! Register now!
Avatar
ChickenMobile
2,460 Posts
Posted May 26, 2013
Replied 20 hours later

FelixGriffin wrote:
Oh, you used it in Vitrified? Where?

The command for making max speed of the gel faster. I used it in my map so then you can make the jump to the other side. I think I increased both of these values so it made the jump easier to achieve.

sv_speed_paint_acceleration //how fast you speed up on gel
sv_speed_paint_max //max speed when running on gel