Forum

> > CS2D > General > "sv_restart" resets "mp_timelimit" countdown?
Forums overviewCS2D overviewGeneral overviewLog in to reply

English "sv_restart" resets "mp_timelimit" countdown?

6 replies
To the start Previous 1 Next To the start

old "sv_restart" resets "mp_timelimit" countdown?

RichNagel
User Off Offline

Quote
A small question:

When you issue an "restart" (which according to the CS2D help web page is the same as "restartround", "sv_restart", and "sv_restartround"), does the game ALSO start counting down the "mp_timelimit" again from it's *original* set value?

In other words (an example):

"mp_timelimit" is set to 10 minutes.

5 minutes into the game I issue an "sv_restart" (or "restart", "restartround", or "sv_restartround).

Is the "mp_timelimit" setting reset to 10 minutes again (starts to count down from 10 minutes again), or does it *continue* to count down from where it currently was when I restarted the round (in the above example, 5 more minutes would be remaining in the "mp_timelimit" countdown)?

From what I've experienced with my experimentation, it appears that the former is true (the "mp_timelimit" setting is *reset* to 10 minutes *again* after issuing an "sv_restart"), which IMHO is the opposite of how it should function

IMHO the game should *continue* to count down from the *remaining* "mp_timelimit" time when the "sv_restart" was issued, and only be reset to 10 minutes when the server cycles to the next map in the mapcycle rotation.

Anyhow, I'm thinking that if the latter is *supposed* to be true, there may be a little buglet in the game.

old Re: "sv_restart" resets "mp_timelimit" countdown?

RichNagel
User Off Offline

Quote
user Yates has written
Restart does exactly what it says. Restart. Nothing wrong here.


I REALIZE that "restart" restarts the round... but my question is, does it *inadvertently* reset the"mp_timelimit" countdown timer (which it shouldn't do; as "restart" should *only* restart the round, and not actually 'reset' the "mp_timelimit" setting)?

(Edit) Because if it inadvertently does, THAT would explain this problem -> http://www.unrealsoftware.de/forum_posts.php?post=343192 (as well having that same problem with any other Lua scripts that restart the round, as the server would never cycle to the next map via the "mp_timelimit" setting).
edited 1×, last 30.12.12 02:19:16 am

old Re: "sv_restart" resets "mp_timelimit" countdown?

DC
Admin Off Offline

Quote
cs2d cmd restart actually resets the map time countdown. This is an intended behavior though. The command does not change the cs2d cmd mp_timelimit setting but the game starts to count from 0 when cs2d cmd restart is used.

Originally this command was only planned to be used for manual restarts (there wasn't even Lua when it has been implemented). It also resets the all player scores etc. It's basically like doing a mapchange without changing the map.

A workaround would be to end the round in another way. Like changing cs2d cmd mp_roundtime to a low value and changing it back to a higher one afterwards or killing all players.

I changed the command description and I'll think about adding another command to actually end a round.

old Re: "sv_restart" resets "mp_timelimit" countdown?

RichNagel
User Off Offline

Quote
Thanks for the detailed explanation, DC! That definitely answers my question (as well as solving the mystery of the "GunGame.lua" problem that I posted about over in the Lua subforum)

The reason that I was so confused about the matter:

In regular CS16/CS:CZ an "sv_restart" (or "sv_restartround") simply restarts the current round... it doesn't reset the "mp_timelimit" setting/countdown (or the affect the "mp_maxrounds" or "mp_winlimit" settings either); although, it does reset the players' scores.


user DC has written
I changed the command description and I'll think about adding another command to actually end a round.


Many thanks, DC!

old Re: "sv_restart" resets "mp_timelimit" countdown?

Yates
Reviewer Off Offline

Quote
You can also make your own time with Lua. This way on restartround it will not change plus you can change it whenever you want without having to figure out how much time has already passed with mp_timelimit.

old Re: "sv_restart" resets "mp_timelimit" countdown?

RichNagel
User Off Offline

Quote
I made this little modification to the the default "GunGame.lua" that comes with the game, it works great for changing the map via the "MapCycle.cfg" file each time directly after any player wins

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
addhook("kill","sample.gg.kill")
function sample.gg.kill(id)
	-- Add Kill
	sample.gg.kills[id]=sample.gg.kills[id]+1
	-- Next Level?
	-- if (sample.gg.kills[id]>=*REQUIRED_KILLS_PER_WEAPON_TO_INCREASE_PLAYER_LEVEL*) then --
	if (sample.gg.kills[id]>=2) then
		-- Reset Kills
		sample.gg.kills[id]=0
		-- Increase Level
		sample.gg.level[id]=sample.gg.level[id]+1
		-- Win?
		if (sample.gg.level[id]>=#sample.gg.wpn) then
			-- *START OF MAP CYCLE MODIFICATION* --
			-- msg("©000255000"..player(id,"name").." has won the game!@C")
			-- parse("restart")
			msg("©000255000"..player(id,"name").." has won the Gun Game!@C")
			msg("©25500000030 second melee killing spree before map change, take no prisoners!@C")
			msg(string.format("©255255000Next map: %s@C", game("nextmap")))
			freehook("kill","sample.gg.kill")
			addhook("spawn","melee_killing_spree_weapon_strip")
			function melee_killing_spree_weapon_strip()
				for i=1,32 do
					if (player(i,"exists")) then
						parse("strip "..i.." 0")
					end
				end
			return "x";
			end
			timer(30000,"cyclemap")
			function cyclemap()
				parse("map "..game("nextmap"))
			end
			-- *END OF MAP CYCLE MODIFICATION* --
		else
			-- Give new Weapon
			parse("equip "..id.." "..sample.gg.wpn[sample.gg.level[id]])
			-- Remove last Weapon
			parse("strip "..id.." "..sample.gg.wpn[sample.gg.level[id]-1])
		end
	end
	-- Info
	-- if (sample.gg.level[id]<*TOTAL_NUMBER_OF_LEVELS_IN_GUN_GAME_PLUS_ONE*) then --
	if (sample.gg.level[id]<33) then
		msg2(id,"Level: "..sample.gg.level[id].." Kills: "..sample.gg.kills[id])
	end
end

The reason for the "melee killing spree":

I wanted to be able to display the "Joe Blow has won the game!" message for a short bit before the map cycled, but not have everyone running around killing players with their last used weapon <grin>. So, I stripped everyone of all weapons except a knife, and delayed the map cycling a bit (30 seconds)
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview