Rune Central

The Official Rune Quake Message Board
It is currently Sun Dec 10, 2017 11:56 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Setting up a runequake Server
PostPosted: Mon May 11, 2009 7:33 pm 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
I had a couple questions about setting up a runequake server.

1)I want to be able to have a large number of maps available on the server so that if players want to vote to a particular map they can do this. However, I also want it so that when the server changes level after the timelimit has been hit, it will only select a map from a subset of all the maps available on the server. How can I do this? I would also like to apply this same thing to the default id maps, for example, when the server goes to change the level, it will only find a random level from dm1, dm2, dm3, dm4, dm5, dm6, and not select a level from any of the episodic maps. But, also have the episodic maps available to change level to upon player request and vote.

2)I want to be able to lock out certain game modes, but keep others available to vote. For example, I want the clients to be only able to vote between match, practice, and normal, but not be able to vote the game mode to rocket arena or head-hunters or anything else. Is there a way to do this?

Thank you for any guidance with regards to these questions.


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Tue May 12, 2009 1:27 am 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1205
Location: New Jersey, USA
desh wrote:
1)I want to be able to have a large number of maps available on the server so that if players want to vote to a particular map they can do this. However, I also want it so that when the server changes level after the timelimit has been hit, it will only select a map from a subset of all the maps available on the server. How can I do this? I would also like to apply this same thing to the default id maps, for example, when the server goes to change the level, it will only find a random level from dm1, dm2, dm3, dm4, dm5, dm6, and not select a level from any of the episodic maps. But, also have the episodic maps available to change level to upon player request and vote.


This can be done with the standard maps, but you have to modify settings.qc file and replace "TRUE" with "FALSE" to all of the maps in the function user_allowed_maps you don't want the game to select. You must also place the level selection to random, because of the way the linear code selection works. At current, there is no way to allow custom maps and not have them be selected in the rotation. This is something I can easily address though and walk you through if you're interested.

desh wrote:
2)I want to be able to lock out certain game modes, but keep others available to vote. For example, I want the clients to be only able to vote between match, practice, and normal, but not be able to vote the game mode to rocket arena or head-hunters or anything else. Is there a way to do this?


Unfortunately this too is going to require you to modify the source and recompile. You'll need to open up the file vote.qc and in the function vote go through all of the various vote options and change the value of "cancel" to 1. Here is an example block of code specific to one vote option, in this case it's practice mode:

Code:
   else if (self.impulse == IMP_VOTE_PRACTICE)
   {
      cancel      = options & MODE_LOCKED;
      e.frag_rate   = 0.51;   // XXX move to settings.
      e.think1   = change_mode_to_practice;
      e.noise1   = "change";
      e.noise2   = " mode to practice";

      if (cancel)
         self_sprint (self, "mode is locked\n");
      else if (gamemode == MODE_PRACTICE)
      {
         self_sprint (self, "already in practice mode\n");
         cancel = 1;
      }
   }


If you wanted to turn off practice mode all the time, replace

Code:
      cancel      = options & MODE_LOCKED;

with
Code:
      cancel      = 1;


You can apply the same principle to any of the vote options.

Now I'm assuming that you're already familiar with how to compile the source code, but if you're not and need help please let me know.

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Tue May 12, 2009 10:52 am 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
To clarify, in the user_allowed_map function in the settings.qc file, after changing a map (for example e1m8) from "return TRUE" to "return FALSE" this map will not be selected during the random map selection process, but the map (e1m8) would still be able to be voted on and warped to by the clients?

To do this for custom maps, could I simply add code to the user_allowed_map function for all custom maps that I want to "return FALSE"? For example, after the dm6 line add the following:

Code:
else if (m == "cleaver" ) { return FALSE ; } //


would this eliminate the custom map, cleaver.bsp, from being selected during the random map selection process?


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Tue May 12, 2009 11:02 am 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
Slot Zero wrote:
desh wrote:
2)I want to be able to lock out certain game modes, but keep others available to vote. For example, I want the clients to be only able to vote between match, practice, and normal, but not be able to vote the game mode to rocket arena or head-hunters or anything else. Is there a way to do this?


Unfortunately this too is going to require you to modify the source and recompile. You'll need to open up the file vote.qc and in the function vote go through all of the various vote options and change the value of "cancel" to 1. Here is an example block of code specific to one vote option, in this case it's practice mode:

Code:
   else if (self.impulse == IMP_VOTE_PRACTICE)
   {
      cancel      = options & MODE_LOCKED;
      e.frag_rate   = 0.51;   // XXX move to settings.
      e.think1   = change_mode_to_practice;
      e.noise1   = "change";
      e.noise2   = " mode to practice";

      if (cancel)
         self_sprint (self, "mode is locked\n");
      else if (gamemode == MODE_PRACTICE)
      {
         self_sprint (self, "already in practice mode\n");
         cancel = 1;
      }
   }


If you wanted to turn off practice mode all the time, replace

Code:
      cancel      = options & MODE_LOCKED;

with
Code:
      cancel      = 1;


You can apply the same principle to any of the vote options.


But, there are other ways of disabling some of the other vote options, for example, vote-rune and vote-hook can be disabled through other means?

Quote:
Now I'm assuming that you're already familiar with how to compile the source code, but if you're not and need help please let me know.


Yeah, i can compile the code.


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Tue May 12, 2009 2:47 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1205
Location: New Jersey, USA
desh wrote:
But, there are other ways of disabling some of the other vote options, for example, vote-rune and vote-hook can be disabled through other means?


I know that vote-hook is one and vote-team is another, but not vote-rune. Although you might be able to prevent the availability of runes making it zero so regardless of what state vote-rune is in, no runes will ever appear. Some options are prevented from being triggered, like vote-quad for example if there aren't any quads of the level.

desh wrote:
To clarify, in the user_allowed_map function in the settings.qc file, after changing a map (for example e1m8) from "return TRUE" to "return FALSE" this map will not be selected during the random map selection process, but the map (e1m8) would still be able to be voted on and warped to by the clients?

To do this for custom maps, could I simply add code to the user_allowed_map function for all custom maps that I want to "return FALSE"? For example, after the dm6 line add the following:

Code:
else if (m == "cleaver" ) { return FALSE ; } //


would this eliminate the custom map, cleaver.bsp, from being selected during the random map selection process?


Nope. If you want to eliminate all custom maps from the level selection code edit the file map.qc in the functon select_map by changing

Code:
   if (!noexit & NOEXIT_NO_CUSTOM_LEVELS)

with
Code:
   if (0)


This will still give you the freedom of disabling the custom level voting if you wish (using noexit cvar), but will never select a custom map in the rotation.

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Tue May 12, 2009 5:17 pm 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
Slot Zero wrote:
Nope. If you want to eliminate all custom maps from the level selection code edit the file map.qc in the functon select_map by changing


No, what I want to do is eliminate some of the custom maps from the random level selection code, but also keep the availability of having those maps eliminated from the level selection code to be selected by way of vote by the clients currently on the server.


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Tue May 12, 2009 8:11 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1205
Location: New Jersey, USA
desh wrote:
No, what I want to do is eliminate some of the custom maps from the random level selection code, but also keep the availability of having those maps eliminated from the level selection code to be selected by way of vote by the clients currently on the server.


The simplest way to do this is to edit the map-auto.qc script. Since this is a generated script though you would have to manually edit this each time you add/remove more maps so that new level impulses can be generated. You must also make sure that you when you generate the map-auto.qc file, you list the maps you don't want in the rotation last. Next, you need to modify the map-auto.qc script. Search for the function sized_custom_count, here is an example of what it might look like:

Code:
float (float levsize)
sized_custom_count =
{
   if (levsize == 1) return 9;
   if (levsize == 2) return 5;
   if (levsize == 3) return 4;
   return FALSE;
};


In the example above, it shows that I have 9 small levels in the custom rotation. If you generated the map-auto.qc as I suggested by putting the levels you want in the rotation first, all you need to do now is subtract the amount of levels you don't want played from the value per level size. NOTE: You can see what these levels are in the function sized_custom. Here is what my sized_custom function looks like for this example:

Code:
string (float levsize, float n)
sized_custom =
{
   if (levsize == 1) {
      if (n == 1) return "waltz";
      if (n == 2) return "haunted";
      if (n == 3) return "kjdm11";
      if (n == 4) return "bless";
      if (n == 5) return "pkeg2";
      if (n == 6) return "strafin4";
      if (n == 7) return "qcon1";
      if (n == 8) return "ztndm3";
      if (n == 9) return "ztndm5";
   }
   if (levsize == 2) {
      if (n == 1) return "atlantis";
      if (n == 2) return "nindm2";
      if (n == 3) return "park";
      if (n == 4) return "alkdm04";
      if (n == 5) return "ritual";
   }
   if (levsize == 3) {
      if (n == 1) return "kikdm3";
      if (n == 2) return "rtz";
      if (n == 3) return "jadm1";
      if (n == 4) return "deadzone";
   }
   return string_null;
};


So, if I changed 9 to 5 in the sized_custom_count function, only the first 5 small levels will be played: waltz, haunted, kjdm11, bless, pkeg2.

Hope this makes sense.

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Tue May 12, 2009 9:40 pm 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
Yes, that makes perfect sense. I had been looking at the map-auto.qc file a lot, so I was wondering if there was something there I could do. I was hesitant, however, because it is automatically generated.

When and how is this file automatically generated? I guess what I'm getting at, is if map-auto.qc is automatically generated, where would I add custom maps?


Last edited by desh on Tue May 12, 2009 9:47 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Tue May 12, 2009 9:46 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1205
Location: New Jersey, USA
It's a perl script called map, found in the 'src' folder. If you don't have perl on your system, there is also an online script that can be found here:

http://www.runequake.com/maps/script/

Enter in your levels, remember to include the ones you don't want in the rotation at the end for each size, and then click the generate button.

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Tue May 12, 2009 9:48 pm 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
ok, got it.

sized_map_count is for the original id maps and sized_custom count is for the custom maps, right?


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Tue May 12, 2009 10:12 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1205
Location: New Jersey, USA
Yes, however, I should point out that the level selection code for standard maps differs greatly from the custom maps. It might be more effective to edit the user_allowed_map in settings.qc for standard. Also, anytime you make changes related to the custom maps and you need to recompile, you should completely exit out the server and start up. This will ensure all custom maps are read back into the hunk. Alternatively you can type update-hunkinit from the server, but if you added new maps then you'll need to type update-bindings as well. It's probably easier to just restart the server, but I've never made mention to these commands before so I figured I'd air them our here.

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Wed May 13, 2009 6:43 pm 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
Ok, I ran into another problem. For some reason when starting up the server, the startlevel commands aren't registering. I'm using the following startlevel.cfg:

Code:
alias w1 "wait"
alias w5 "w1;w1;w1;w1;w1"
alias w10 "w5;w5"
alias w15 "w10;w5"
megaon;w5;
suiton;w5;
quadon;w5;
pentoff;w5;
ringon;w5;
classicmegaon;w5;
randomspawnon;w5;
runesoff;w5;
hookoff;w5;
altsoff;w5;
shieldsoff;w5;
armordropoff;w5;
rotateoff;w5;
powerupdropoff;w5;
faststarton;w5;
weaponsstayon;w5;
backpackson;w5;
echo startlevel.cfg is empty
//eof


All of the commands, eg, runesoff, hookoff, altsoff, etc. aren't registering:

Unknown command "runesoff"
Unknown command "altsoff"
Unknown command "shieldsoff"

This was working on one computer, but when i copied the progs.dat over to another computer I got this error. How can I resolve this?

Edit: Also, when going to the server prompt, the "commands" command doesn't work either.


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Wed May 13, 2009 6:51 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1205
Location: New Jersey, USA
Maybe the progs.dat is in the wrong folder? Or you didn't specify the -game directory? Do you see the message "execing startlevel.cfg"?

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Wed May 13, 2009 7:27 pm 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
yes, it execs the startlevel.cfg (that's why it says unknown command for all the commands). The server is still runequake server because if i connect to it, it starts up with the runequake display screen, and all the client side commands work.


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Wed May 13, 2009 7:42 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1205
Location: New Jersey, USA
Add +developer 1 to the command line and start the server again, then paste the entire console out here. Also, what's differen't about the new system (OS, proquake version?)

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Wed May 13, 2009 8:06 pm 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
This is my command line:

Code:
wqpro -game runequake -heapsize 128000 -mep 64 -dedicated 16 +developer 1 +map dm6


I still get the same issue.


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Wed May 13, 2009 8:25 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1205
Location: New Jersey, USA
Check your config.cfg on the new machine and remove any saved1, saved2, saved3, and saved4 values and make them zero. You probably ran the mod in listen mode and then exited the server and those values got saved to config.cfg when you exited. If you don't use config.cfg for anything or rarely modify it, change the attributes to read only.

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Wed May 13, 2009 10:31 pm 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
Yep, that did the trick. Thanks a lot.

Is there a way to set it up so the client can see all the available custom maps? After setting the following in maps-auto.qc:

Code:
float (float levsize)
sized_custom_count =
{
   if (levsize == 1) return 1;
   if (levsize == 2) return 1;
   if (levsize == 3) return 1;
   //if (levsize == 1) return 41;
   //if (levsize == 2) return 78;
   //if (levsize == 3) return 40;
   return FALSE;
};


only the first map from each group (small, medium, and large) can be selected through the random map selection process. However, when typing the "custom" command, it only shows the first map of each group as well. Now the aliasing commands of all the maps is still intact (e.g. using the command "cleaver" or "ztndm3" will still initiate a vote to change the map to cleaver.bsp or ztndm3.bsp, respectively), but all the available maps on the server are not listed when the "custom" command is issued.


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Wed May 13, 2009 10:50 pm 
Offline
Site Admin
User avatar

Joined: Fri Mar 07, 2003 7:41 pm
Posts: 1205
Location: New Jersey, USA
The custom command uses the function sized_custom_count, which you modified. A quick solution would be to duplicate the original function, you can call it sized_custom_count_real for example...

Code:
// this is your modified function
float (float levsize)
sized_custom_count =
{
   if (levsize == 1) return 1;
   if (levsize == 2) return 1;
   if (levsize == 3) return 1;
   return FALSE;
};

// this is a copy of the new original function, but with a new name
float (float levsize)
sized_custom_count_real =
{
   if (levsize == 1) return 41;
   if (levsize == 2) return 78;
   if (levsize == 3) return 40;
   return FALSE;
};


Next, in rjs.qc search for sized_custom_count and change it to sized_custom_count_real, which is located in the function custom_sprint.

_________________
Slot Zero
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Setting up a runequake Server
PostPosted: Thu May 14, 2009 12:20 pm 
Offline

Joined: Thu Sep 23, 2004 5:49 pm
Posts: 49
I think I also need to add

Code:
float (float levsize) sized_custom_count_real;


to the func.qc file as well.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group