Tremulous Forum

Community => Servers => Topic started by: swamp-cecil on September 05, 2010, 01:09:56 am

Title: server command
Post by: swamp-cecil on September 05, 2010, 01:09:56 am
so i want to set up a server, and my only idea for it is when an alien dies, humans get more BP, and when a human dies, aliens get mor BP depending on what the aien wat/ what the human had equiped. but, i do know code format, but dont know where ill put the code file and how to type it. ( i think its c, right?)
this is going to be way off...

if level0.Death == true
{
g_humanbuildpoints + 2;
}

if human.death == true
{
if human.equiped == rifle
{
g_alienbuildpoints + 2;
}
if human.equiped == light_armour
{
g_alienbuildpoints + 2;
}
}
if g_alienbuildpoints == 999 || g_humanbuildpoints == 999
{
sv_suddendeath = 1;
}

and alieta, i know you're goingto say something like this:
oh no, its all terrible. it seems like c# more than c! its hopless, just give up.
Title: Re: server command
Post by: Aelita on September 05, 2010, 07:34:04 am
Actually, it's a shitty idea because the game will never end. You'll have masses of teslas and hives and other useless bullshit.
Title: Re: server command
Post by: gimhael on September 05, 2010, 08:00:31 am
Well, he wants to start SD after the first team reaches 999 points...

You should look at function player_die in src/game/g_combat.c, this function is called whenever a players dies (note there's a difference between "dies" and "is killed"). You can put your code in there. Should be something like:

Code: [Select]
if( G_TimeTilSuddenDeath() > 0 ) {
  if( player->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) {
    if( g_alienbuildpoints.integer < 999-2 ) {
      trap_Cvar_Set( "g_alienbuildpoints", va( "%d", g_alienbuildpoints.integer + 2 ) );
    } else {
      trap_Cvar_Set( "g_alienbuildpoints", "999" );
      level.suddenDeathBeginTime = level.time - level.startTime;
    }
  } else if ( player->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) {
    if( g_humanbuildpoints.integer < 999-2 ) {
      trap_Cvar_Set( "g_humanbuildpoints", va( "%d", g_humanbuildpoints.integer + 2 ) );
    } else {
      trap_Cvar_Set( "g_humanbuildpoints", "999" );
      level.suddenDeathBeginTime = level.time - level.startTime;
    }
  }
}
Title: Re: server command
Post by: swamp-cecil on September 05, 2010, 01:24:33 pm
i was never able to find the:
Well, he wants to start SD after the first team reaches 999 points...

You should look at function player_die in src/game/g_combat.c, this function is called whenever a players dies (note there's a difference between "dies" and "is killed"). You can put your code in there. Should be something like:

more specifacaly, what folder is it in? a hidden folder?
Title: Re: server command
Post by: SlackerLinux on September 05, 2010, 01:53:41 pm
i was never able to find the:
Well, he wants to start SD after the first team reaches 999 points...

You should look at function player_die in src/game/g_combat.c, this function is called whenever a players dies (note there's a difference between "dies" and "is killed"). You can put your code in there. Should be something like:

more specifacaly, what folder is it in? a hidden folder?

http://svn.icculus.org/tremulous/trunk/

jeez winblows users
http://tremulous.net/forum/index.php?topic=3408.0
Title: Re: server command
Post by: your face on September 05, 2010, 10:23:15 pm
linsuxxor
Title: Re: server command
Post by: Aelita on September 05, 2010, 11:08:12 pm
more specifacaly, what folder is it in? a hidden folder?

10 bucks says he's not even got the source checked out.
Title: Re: server command
Post by: swamp-cecil on September 06, 2010, 02:26:32 pm
more specifacaly, what folder is it in? a hidden folder?

10 bucks says he's not even got the source checked out.

i decline the bet. how i do downoad the src whole? not one file by one file?

EDIT: when i click download, it gives me this: http://svn.icculus.org/*checkout*/tremulous/trunk/src/game/g_combat.c?revision=2051 (http://svn.icculus.org/*checkout*/tremulous/trunk/src/game/g_combat.c?revision=2051)
is that the code?
Title: Re: server command
Post by: David on September 06, 2010, 04:46:39 pm
That's one very small part of it.

Go to the thread Slacker linked (http://tremulous.net/forum/index.php?topic=3408.0), get it all working, and then try changing stuff.
Title: Re: server command
Post by: jez on September 06, 2010, 04:50:36 pm
i decline the bet.

Horses aren't allowed to bet in horse races. That would be match fixing.

An easy way to get the source would just be to just download the whole game again. IIRC, the mac build of the gpp client had the source bundled with it.
Title: Re: server command
Post by: David on September 06, 2010, 05:01:20 pm
They all have it bundled, but it's way out of date.
Title: Re: server command
Post by: SlackerLinux on September 07, 2010, 12:43:57 am
also if your coding for 1.1 your better off using latiku7qvm as a base

http://projects.mercenariesguild.net/projects/lakitu7-qvm/repository