objectives - time based scripting


(Doc_A) #1

Someone posted a wonderful idea on the shrubmod site. We all play
on many maps where players simply go on to pointwhore, and frankly
I’m sick of playing 30 minute XP-a-thon maps when one team could care
less about the objectives.

This person suggested that the maps begin with a base time, and the
offense then earns more time by completing objectives. The idea is
simply brilliant. If a team chooses to sit back then the map will end early.
How’s that for incentive??

Here is the post from the shrubmod forums:

Time decreasing

The main idea is to make the round shorter if the attackers can not do
anything, no-one wants to spawn camp for 30 mins. So if the attackers
can not do anything on a map the map should be shorter, examples:

Oasis: Max 25 min.
Base time 10 minutes
Destruction of the old city wall +10mins
Destruction of a gun +5mins

Battery: Max 25 min.
Base time 10 minutes
Construction of foot bridge +5mins
Destruction of generator +5mins (1 time only)
Capturation of West bunker +5mins

Gold rush: Max 30 mins
Base Time 10 minutes.
Tank barrier 1 passed +5mins
Tank barrier 2 passed +5mins
Gold crate 1 secured +5 mins
Gold crate 2 secured +5 mins

Radar: Max 25 minutes
Base time 10 minutes
Destruction of side door +5min
Destruction of main door +5min
Radar part secured +5mins

Railgun: Max 25 mins
Base time 10 minutes
Ammo loaded to first tug +10 minutes
Ammo loaded to second tug +5mins

Fueldump: Max 30 mins
Base time 10 mins
Destruction of sewer gate +5 mins
Destruction of tunnel door +10mins
Destruction of the corner (the place where the tank finally stops) +5mins

Notice that the bonuses are one-time only so if you rebuild the command post in battery you wont get extra 5mins.

So any arguments/comments on the figures?

Note: I have already posted this on several forums, but it has not yet gotten in. Hopefully this time…

Q1: Is it possible to recreate the game scripts and add time to the clock at each of these points.

Q2: If so, could we create a custome pk3 with these new scripts to override the current game scripts?

Q3: Would we need variables to keep track so that the timer doesn’t get added to twice by accident, if an item is repaired twice?

Thank You.

Doc


([rD]MrPink) #2

Q1.) I don’t think the game was programmed with those kinds of things in mind
Q2.) Game wont run with a custom pak0.pk3
Q3.) You would need variable to keep track, but that stuff is simple.


(Vetinari) #3

If there was such a mod I wouldn’t play this…
it’s true, it’s a pain sometimes being spawn raped as the attacking team. But there were many games I’ve played where those settings would’ve meant a loss to the attacking team, e.g.

  • getting the 2 gold crates and escaping with the truck in the last 4 minutes of goldrush …finishing a few secs (< 10) before time ends
  • being raped for 25 minutes on fuel dumpwhen without building the bridge and then winning by a covops and an eng getting the job done
  • …same on battery

  • it’s much more satisfying to see the "WTF"s at the end :bump:

(Doc_A) #4

I didn’t ask if anyone wants to play this, just if it can be done.

What is the syntax to increment game time in the script??

I tried this:

wm_set_round_timelimit inc 5

but all it did was remove the game clock completely. Any ideas Splash damage folk?

-Doc


(sock) #5

The script command “wm_set_round_timelimit” affects the console cvar called “timelimit”. The script can query cvar values and change the values of cvars.

For example: cvar timelimit inc “1”

Unfortunately the “inc” parameter ignores the values and always increases by 1. If you do not supply a value it will break. The real shame is that the “set” parameter is broken and does not work, but luckly you have the “wm_set_round_timelimit” script command.

So you could do the following code:


game_manager
{
	spawn
	{
		wm_set_round_timelimit 10
		wait 1000
		trigger game_manager plus5time
	}

	trigger plus5time
	{
		wm_announce	"Timelimit change"
		cvar timelimit inc "1"
		cvar timelimit inc "1"
		cvar timelimit inc "1"
		cvar timelimit inc "1"
		cvar timelimit inc "1"
	}		
}

Sock
:moo:


(Doc_A) #6

Thanks sock,

You always have the answers… :clap: :clap: :clap:

Much appreciated.

Doc