Server command does only work after changelevel
Quote from PortalCombat on May 19, 2013, 3:55 pmHey 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.
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.
Quote from FelixGriffin on May 19, 2013, 8:27 pmWhat 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.
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.

Quote from ChickenMobile on May 19, 2013, 9:40 pmFelixGriffin 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.
Indeed. Create a intro map (as small as possible) which executes the commands and then changes the level.
Quote from PortalCombat on May 19, 2013, 11:36 pm.. 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?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.
.. 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?
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.

Quote from josepezdj on May 20, 2013, 2:26 amI 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.
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.

Quote from ChickenMobile on May 20, 2013, 4:02 amIt 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.
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.
Quote from PortalCombat on May 20, 2013, 5:44 amWell, 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.
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.
Quote from PortalCombat on May 20, 2013, 9:27 amYeah... sometimes I love randomness!
I just slipped over the solution by accident.![]()
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. =)
Yeah... sometimes I love randomness!
I just slipped over the solution by accident.
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. =)

Quote from ChickenMobile on May 22, 2013, 7:25 amPortalCombat wrote:Yeah... sometimes I love randomness!
I just slipped over the solution by accident.![]()
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
I just slipped over the solution by accident.

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
Quote from PortalCombat on May 22, 2013, 8:54 pmChickenMobile wrote:What is this command? Sounds truly odd xDsv_speed_normal <value> (speed when you are not on speed gel)
sv_speed_normal <value> (speed when you are not on speed gel)