Author Topic: server command  (Read 7026 times)

swamp-cecil

  • Posts: 774
  • Turrets: +80/-163
    • Tremulous
server command
« 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.
these are stupid suggestions, don't even waste our time.
I don't like your negative attitude.

Aelita

  • Posts: 742
  • Turrets: +147/-34
Re: server command
« Reply #1 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.

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: server command
« Reply #2 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;
    }
  }
}

swamp-cecil

  • Posts: 774
  • Turrets: +80/-163
    • Tremulous
Re: server command
« Reply #3 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?
these are stupid suggestions, don't even waste our time.
I don't like your negative attitude.

SlackerLinux

  • Spam Killer
  • *
  • Posts: 555
  • Turrets: +41/-62
Re: server command
« Reply #4 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
« Last Edit: September 05, 2010, 02:33:40 pm by SlackerLinux »
Slackware64 13.1
SlackersQVM/

your face

  • Community Moderators
  • *
  • Posts: 3843
  • Turrets: +116/-420
Re: server command
« Reply #5 on: September 05, 2010, 10:23:15 pm »
linsuxxor
spam spam spam, waste waste waste!

Aelita

  • Posts: 742
  • Turrets: +147/-34
Re: server command
« Reply #6 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.

swamp-cecil

  • Posts: 774
  • Turrets: +80/-163
    • Tremulous
Re: server command
« Reply #7 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
is that the code?
« Last Edit: September 06, 2010, 02:33:56 pm by swamp-cecil »
these are stupid suggestions, don't even waste our time.
I don't like your negative attitude.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: server command
« Reply #8 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.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

jez

  • Posts: 130
  • Turrets: +4/-2
Re: server command
« Reply #9 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.

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: server command
« Reply #10 on: September 06, 2010, 05:01:20 pm »
They all have it bundled, but it's way out of date.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

SlackerLinux

  • Spam Killer
  • *
  • Posts: 555
  • Turrets: +41/-62
Re: server command
« Reply #11 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
Slackware64 13.1
SlackersQVM/