[Solved] Load rotation based on g_gametype?

20 replies [Last post]
SwedishGojira
SwedishGojira's picture
Offline
Joined: Aug 2013
Posts:

Is it possible to make the server load different rotations based on what gametype is set?
Like "g_gametype 0" loads rotation0.txt "g_gametype 1" load rotation1.txt etc.
I have tried, but am failing miserably at scripting I am afraid... Sad

BTW. Nice to meet you all Happy
I discovered this great mod just recently and am trying to set up a private server for my friends to play.

/
q3fun's picture
Offline
Joined: Jun 2010
Posts:
Re: Load rotation based on g_gametype?

yes, just edit callvote.txt:

gametype, g_gametype {
 
	1 {
 
		// don't let them vote for the current gametype
 
 
 
		if ( $g_gametype != GT_FFA ) {
 
			ffa, deathmatch, 0 {
 
				// client might have used one of the alternatives like "ffa"
 
				// explicit use the number "0" instead of the variable "$"
 
				command = "set g_gametype 0; xp_rotation rotation0.txt";
 
			}
 
		}
 
 
 
		// just the same for all other gametypes
 
		if ( $g_gametype != GT_DUEL ) {
 
			duel, tourney, tournament, 1 {
 
				command = "set g_gametype 1; xp_rotation rotation1.txt";

РЕАЛЬНО ВВЕРИТЕ - ВЫ ВСЕ ЗАЕБАЛИ!!

cml
Forum moderator Rank moderator LIVING LEGEND
camel-xp's picture
Offline
Joined: Mar 2006
Posts:
Re: Load rotation based on g_gametype?

SwedishGojira
SwedishGojira's picture
Offline
Joined: Aug 2013
Posts:
Re: Load rotation based on g_gametype?

No way to do it without calling vote? Like checking variables and stuff?
I was hoping to be able to just start a server by using setting g_gamestyle and it loads the corresponding rotation file.
I have tried reading trough the docs and trying myself, but I suck at scripting and was hoping for someone to help me out.

/
q3fun's picture
Offline
Joined: Jun 2010
Posts:
Re: Load rotation based on g_gametype?
SwedishGojira wrote:

No way to do it without calling vote? Like checking variables and stuff?
I was hoping to be able to just start a server by using setting g_gamestyle and it loads the corresponding rotation file.
I have tried reading trough the docs and trying myself, but I suck at scripting and was hoping for someone to help me out.

I gave you an example...

and why bad callvote? any cause... else callvote.txt have commands for REF, You can make it there

РЕАЛЬНО ВВЕРИТЕ - ВЫ ВСЕ ЗАЕБАЛИ!!

cml
Forum moderator Rank moderator LIVING LEGEND
camel-xp's picture
Offline
Joined: Mar 2006
Posts:
Re: Load rotation based on g_gametype?

if ( g_gametype == 3 ) { // TDM
    timelimit: 15
    fraglimit: 200
    capturelimit: 0
 
    q3dm7
    q3dm11
    q3dm12
 
} else if ( g_gametype == 4 ) { // CTF
    timelimit: 15
    fraglimit: 0
    capturelimit: 10
 
    q3ctf1
    q3ctf2
    q3ctf3
 
} else if ( g_gametype == 8 ) { // FREEZE
    timelimit: 15
    fraglimit: 0
    capturelimit: 0
 
    q3dm11
    overkill
    q3dm12
 
}

http://www.excessiveplus.net/documentation/server/rotation-system

SwedishGojira
SwedishGojira's picture
Offline
Joined: Aug 2013
Posts:
Re: Load rotation based on g_gametype?

After reading up on the syntax I came up with almost exactly that code myself.
But it will not start the rotation. It only loads the big box and not the maps on the list, no matter which g_gametype is set.

EVILUTION
fiendsin's picture
Offline
Joined: Jun 2012
Posts:
Re: Load rotation based on g_gametype?
SwedishGojira wrote:

After reading up on the syntax I came up with almost exactly that code myself.
But it will not start the rotation. It only loads the big box and not the maps on the list, no matter which g_gametype is set.

Make sure syntax is correct and no maps are missing,
Rotation should contain *.bsp names not *.pk3 names.


Sometimes I wish I was a NEET again, but life is too fucking expensive man.
The weak plot revenge, the strong forgive and the Lucky forget, but Fiend, Fiend no longer gives a shit

◀█ BIG BOB wrote:
Man you even sound like Lego's

You Fuckers wrote:
I would cut my fifth finger to bang her actually

You Fuckers wrote:
BELIEVE IN BLASPHEMY

SwedishGojira
SwedishGojira's picture
Offline
Joined: Aug 2013
Posts:
Re: Load rotation based on g_gametype?

I just copied the script cml wrote above and added DM to the list to see if it works, but it is only loading the big box. The rotation never start.
Here is the code:

if ( g_gametype == 3 ) { // TDM
    timelimit: 15
    fraglimit: 200
    capturelimit: 0
 
    q3dm7
    q3dm11
    q3dm12
 
} else if ( g_gametype == 4 ) { // CTF
    timelimit: 15
    fraglimit: 0
    capturelimit: 10
 
    q3ctf1
    q3ctf2
    q3ctf3
 
} else if ( g_gametype == 8 ) { // FREEZE
    timelimit: 15
    fraglimit: 0
    capturelimit: 0
 
    q3dm11
    overkill
    q3dm12
 
} else if ( g_gametype == 0 ) { // DM
    timelimit: 10
    fraglimit: 30
    capturelimit: 0
 
    q3dm1
    q3dm2
    q3dm3
 
}

Can somebody see what is wrong here?
I do not want to use callvote.txt because I want to be able to start the server (from cron in Ubuntu) with "+set g_gametype 4" and have it load the rotation for CTF or "+set g_gametype 8" and have it run the rotation for Freezetag.

kszksz
japierdole's picture
Offline
Joined: Jan 2012
Posts:
GB United Kingdom
Re: Load rotation based on g_gametype?

It may be stupid question but did you uploaded maps to root?

And even I walk through the darkest valley of the shadow of death I will be not afraid because I am the worst motherfucker in this place.

SwedishGojira
SwedishGojira's picture
Offline
Joined: Aug 2013
Posts:
Re: Load rotation based on g_gametype?

What do you mean "uploaded maps to root"?
The maps are located in the usual baseq3 directory in the .pk3 files. No troubles with permissions or ownership in Linux, if that is what you are asking.
The
maps all load as they should if I just put them in the rotation without
any conditions or by loading them manually so something must be off
with the syntax. I can not see what it is though.