News:

Come Chat with us live! Learn how HERE!

Main Menu

server command

Started by swamp-cecil, September 05, 2010, 01:09:56 AM

swamp-cecil

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.
Quote from: DraZiLoX on December 28, 2010, 11:31:28 AM
Quote from: Repatition on December 28, 2010, 02:30:30 AM
these are stupid suggestions, don't even waste our time.
I don't like your negative attitude.

Aelita

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

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:

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

i was never able to find the:
Quote from: 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:

more specifacaly, what folder is it in? a hidden folder?
Quote from: DraZiLoX on December 28, 2010, 11:31:28 AM
Quote from: Repatition on December 28, 2010, 02:30:30 AM
these are stupid suggestions, don't even waste our time.
I don't like your negative attitude.

SlackerLinux

#4
Quote from: swamp-cecil on September 05, 2010, 01:24:33 PM
i was never able to find the:
Quote from: 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:

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
Slackware64 13.1
SlackersQVM/

your face

Quote from: dolby on February 19, 2003, 06:44:44 PM
spam spam spam, waste waste waste!

Aelita

Quote from: swamp-cecil on September 05, 2010, 01:24:33 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

#7
Quote from: Aelita on September 05, 2010, 11:08:12 PM
Quote from: swamp-cecil on September 05, 2010, 01:24:33 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?
Quote from: DraZiLoX on December 28, 2010, 11:31:28 AM
Quote from: Repatition on December 28, 2010, 02:30:30 AM
these are stupid suggestions, don't even waste our time.
I don't like your negative attitude.

David

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

Quote from: swamp-cecil on September 06, 2010, 02:26:32 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

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

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/