With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Post feedback & meet new friends. General SG discussion.

Moderators: Pardner, TheDoctor

/dev/random's Mod

Postby ReD NeCKersoN » Wed Apr 01, 2009 3:12 am

For folks who like the new mod & have feedback or ideas, post up!
Nothing to download. Just connect to the "Smokin' CPU Server" at the IP address 81.89.107.13:27961

Personally, I think this mod would be coolest when played on small maps. How about a map rotation discussion? What about the user interface? Should someone go through the trouble to cause non-buyable weapons to be grayed out? What about a name for this modification?
The first name idea that popped into my head was "KDM" for knife, dynamite, molotov. That might also stand for "Killer-Death-Match" lol. Anyway, I tip my hat to you /dev/random. Thanks for your efforts & I hope this might turn into something truly special. 8)
Image
User avatar
ReD NeCKersoN
SG Team
 
Posts: 3245
Joined: Wed Mar 27, 2002 6:22 am
Location: VA, USA



Postby /dev/random » Thu Apr 02, 2009 8:20 pm

Ouch, I almost forgot this thread. Thanks so much for your support! :D
I need some help on the server. Are there any volunteers for administaton via rcon?

Like Red said, a list of small maps would be great. Which do you prefer?

I'm not certain about the interface. If I do modify it, one will have to download a pk3. Since the mod's changes are so small, I'd pefer if it stays serversided.

Last but not least, a name would be great. KDM is a start, but I prefer Gnome :wink: I think these abbreviations are hard to remember. Do you know a better name? I created a similar mod for World of Padman where one can only use punchy, we gave it the name "punchy paradise", or short pp :)
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm



Postby Redwing » Fri Apr 03, 2009 1:19 am

I have a feeling this will be one of my new favorite servers. Whenever I just want to cheer up I go all dynamite in a Deathmatch server.

One question I have is whether you can make it so a thrown knife will cause dynamite to explode. Currently it does not. This would be useful for some fun booby traps, eh?
DeviantArt|Music
Jesus wrote:Blessed are the Peacemakers, for they will be called the sons of God
User avatar
Redwing
Shootist
 
Posts: 99
Joined: Sun Mar 22, 2009 8:50 pm



Postby ReD NeCKersoN » Fri Apr 03, 2009 1:43 am

/dev/random wrote:I'm not certain about the interface. If I do modify it, one will have to download a pk3. Since the mod's changes are so small, I'd pefer if it stays serversided.

Couldn't this be done with code? Instruct the non-buyable weapons to stay grayed out permanently? As it is now, once you earn enough money you are given the false impression that you should be able to buy nonplayable items. (Even though you can't, it still looks like you could atm.)

As for maps, I'd suggest starting with the smallest levels untill more people become aware of the mod. Train, Hang'em High, Dry, etc.
Couldn't hurt to add /bot_minplayers 3 to the server.cfg either
User avatar
ReD NeCKersoN
SG Team
 
Posts: 3245
Joined: Wed Mar 27, 2002 6:22 am
Location: VA, USA



Postby /dev/random » Fri Apr 03, 2009 12:37 pm

Redwing wrote:One question I have is whether you can make it so a thrown knife will cause dynamite to explode. Currently it does not. This would be useful for some fun booby traps, eh?


I'll take a look into that. Should be possible, since pistols can already do that magic :D

ReD NeCKersoN wrote:
/dev/random wrote:I'm not certain about the interface. If I do modify it, one will have to download a pk3.

Couldn't this be done with code? Instruct the non-buyable weapons to stay grayed out permanently? As it is now, once you earn enough money you are given the false impression that you should be able to buy nonplayable items. (Even though you can't, it still looks like you could atm.)


The problem is, that this part of the code is not serverside. The gamecode is divided into game (server), cgame (client game) and ui (user interface). As long as I only modify game, one won't have to download anything. As soon as i modify cgame or ui and the server is running pure, everyone will need the modified parts in a pk3.

ReD NeCKersoN wrote:As for maps, I'd suggest starting with the smallest levels untill more people become aware of the mod. Train, Hang'em High, Dry, etc.
Couldn't hurt to add /bot_minplayers 3 to the server.cfg either


I'll modify the server's maprotation, time- and pointlimits asap. I'll try whether the bots are useful, since they don't use dynamite or molotov as far as I'm aware. Maybe g_spSkill 5 will help :evil:
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm



Postby Redwing » Fri Apr 03, 2009 10:47 pm

/dev/random wrote:I'll try whether the bots are useful, since they don't use dynamite or molotov as far as I'm aware. Maybe g_spSkill 5 will help :evil:

Nah, the bots are pitiful. In Hangem' High, I stood on top of a building and just threw dynamite at them running around in the center, knives out. I won the round in minutes... Although it was kind of amusing. Later I tried fighting them with a knife and it proved much harder though :roll:
DeviantArt|Music
Jesus wrote:Blessed are the Peacemakers, for they will be called the sons of God
User avatar
Redwing
Shootist
 
Posts: 99
Joined: Sun Mar 22, 2009 8:50 pm



Postby ReD NeCKersoN » Sat Apr 04, 2009 1:20 am

The only reason I suggested bots is to give a single player something to do while he's waiting for other players. :wink:
User avatar
ReD NeCKersoN
SG Team
 
Posts: 3245
Joined: Wed Mar 27, 2002 6:22 am
Location: VA, USA



Postby Redwing » Sat Apr 04, 2009 2:15 am

ReD NeCKersoN wrote:The only reason I suggested bots is to give a single player something to do while he's waiting for other players. :wink:

It didn't entertain me for long :lol: Generally I don't like servers with a minimum bot level; I set my browser up to view only servers with people in them, but I still have to check the players before I enter because chances are that server with a lot of people is really just 6 bots :|
DeviantArt|Music
Jesus wrote:Blessed are the Peacemakers, for they will be called the sons of God
User avatar
Redwing
Shootist
 
Posts: 99
Joined: Sun Mar 22, 2009 8:50 pm



Availability?

Postby zed » Sat May 08, 2010 11:11 am

Hi,

apologies for reviving this old topic. Nonetheless: is this mod (still) available somewhere? Is it in use somewhere?
zed
Drifter
 
Posts: 9
Joined: Wed Dec 02, 2009 3:54 pm



Postby /dev/random » Sat May 08, 2010 10:13 pm

I do not have the code anymore, but if you like to, I could re-write it.
As far as I'm aware, the mod is not used anymore, even my own server is offline currently.
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm



Postby zed » Sat May 08, 2010 11:10 pm

You sound like it wouldn't be much work (for you), so go ahead :D

However, it suffices if you shortly describe what you had changed/disabled in which file of the source code (assuming this is less work for you).
zed
Drifter
 
Posts: 9
Joined: Wed Dec 02, 2009 3:54 pm



Postby /dev/random » Mon May 10, 2010 5:30 pm

I'll roughly describe what you'd need to change.

First of all, you need to disable all the items you don't want in the buy command Cmd_BuyItem_f() in g_cmds.c (preferrably after all the checks. Be nice and send a centerprint or similar to the client ;) ). If you want to keep it serversided, this is all I'd do. Otherwise you could additionally disable or remove the now defunctional menu items.

Everything else is mandatory. Some maps include items like a Remington, which might unbalance the game. In case you don't want this, you'd need to prevent them from spawning, either in G_CallSpawn() (need to check for classnames) in g_spawn.c or in G_SpawnItem() (item->giType and giTag. Beware, PW_SCOPE and WP_KNIFE have the same value!) in g_items.c.

If you like to, you can also adjust prizes in bg_itemlist[] in bg_misc.c. Damage and the like are above in bg_weaponlist[].

You could also add some default weapons in ClientSpawn() in g_client.c.

To blow up people who carry dynamite using knive, alter G_LocationDamage() in g_combat.c, also take a look at G_MissileImpact() in g_missile.c


If this summary is too rough, let me now and I'll put up some real code :)
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm



Postby zed » Wed May 12, 2010 6:52 pm

/dev/random wrote:If this summary is too rough, let me now ...

Actually, it is quite detailed and was very helpful, thank you. I checked out svn r531 and was quickly able to recreate the functionality by introducing a cvariable g_removedItems and implementing a function qboolean IsItemAvailable( int giTag, int giType ). At least I think, because I ran into trouble testing this mod. I was able to compile .qvm files without error, however when I tried to start smokinguns, I got the following error message. Does anyone have an idea how to interpret this message? :roll:

Loading vm file vm/qagame.qvm...
----- Client Shutdown (Client fatal crashed: vm/qagame.qvm does not have a recognisable magic number in its header) -----
RE_Shutdown( 1 )
-----------------------
----- Server Shutdown (Server fatal crashed: vm/qagame.qvm does not have a recognisable magic number in its header) -----
---------------------------
vm/qagame.qvm does not have a recognisable magic number in its header


Anyway, here is the code:
Code: Select all
diff -crB smokinguns-svn-1.1_pre531/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_cmds.c smokinguns-svn-1.1_pre531.removedItems/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_cmds.c
*** smokinguns-svn-1.1_pre531/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_cmds.c   2010-05-13 00:56:59.000000000 +0200
--- smokinguns-svn-1.1_pre531.removedItems/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_cmds.c   2010-05-13 00:04:56.000000000 +0200
***************
*** 2366,2371 ****
--- 2366,2377 ----
     if(item->prize <= 0)
        return;
 
+    if (IsItemAvailable(item->giTag, item->giType) == qfalse) {
+       if(!cgame)
+          trap_SendServerCommand( ent-g_entities, va("print "Not available!\n""));
+       return;
+    }
+
     if(ent->client->ps.stats[STAT_MONEY] < item->prize){
        if(!cgame)
           trap_SendServerCommand( ent-g_entities, va("print "Not Enough Money!\n""));
diff -crB smokinguns-svn-1.1_pre531/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_items.c smokinguns-svn-1.1_pre531.removedItems/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_items.c
*** smokinguns-svn-1.1_pre531/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_items.c   2010-05-13 00:56:59.000000000 +0200
--- smokinguns-svn-1.1_pre531.removedItems/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_items.c   2010-05-13 00:05:11.000000000 +0200
***************
*** 1238,1244 ****
     G_SpawnFloat( "wait", "0", &ent->wait );
 
     RegisterItem( item );
!    if ( G_ItemDisabled(item) )
        return;
 
     ent->item = item;
--- 1238,1244 ----
     G_SpawnFloat( "wait", "0", &ent->wait );
 
     RegisterItem( item );
!    if ( G_ItemDisabled(item) || IsItemAvailable(item->giTag, item->giType) == qfalse )
        return;
 
     ent->item = item;
diff -crB smokinguns-svn-1.1_pre531/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_local.h smokinguns-svn-1.1_pre531.removedItems/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_local.h
*** smokinguns-svn-1.1_pre531/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_local.h   2010-05-13 00:56:59.000000000 +0200
--- smokinguns-svn-1.1_pre531.removedItems/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_local.h   2010-05-12 23:49:33.000000000 +0200
***************
*** 922,927 ****
--- 922,930 ----
  #else
  void FindIntermissionPoint( int mappart );
  #endif
+ #ifdef SMOKINGUNS
+ qboolean IsItemAvailable( int giTag, int giType );
+ #endif
  void SetLeader(int team, int client);
  void CheckTeamLeader( int team );
  void G_RunThink (gentity_t *ent);
***************
*** 1026,1031 ****
--- 1029,1035 ----
 
  #define   FOFS(x) ((size_t)&(((gentity_t *)0)->x))
 
+ extern   vmCvar_t   g_removedItems;
  extern   vmCvar_t   g_gametype;
  extern   vmCvar_t   g_dedicated;
  extern   vmCvar_t   g_cheats;
diff -crB smokinguns-svn-1.1_pre531/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_main.c smokinguns-svn-1.1_pre531.removedItems/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_main.c
*** smokinguns-svn-1.1_pre531/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_main.c   2010-05-13 00:56:59.000000000 +0200
--- smokinguns-svn-1.1_pre531.removedItems/work/smokinguns-svn-1.1_pre531/1.1/code/game/g_main.c   2010-05-13 00:54:46.000000000 +0200
***************
*** 40,45 ****
--- 40,46 ----
  gentity_t      g_entities[MAX_GENTITIES];
  gclient_t      g_clients[MAX_CLIENTS];
 
+ vmCvar_t   g_removedItems;
  vmCvar_t   g_gametype;
 
  #ifdef SMOKINGUNS
***************
*** 227,232 ****
--- 228,264 ----
     { NULL, "sv_mapname", "", CVAR_SERVERINFO | CVAR_ROM, 0, qfalse  },
 
     // latched vars
+    /*
+    syntax: g_removedItems <integer>
+    usage: add the following numbers of the items to be removed.
+
+    REM58 pistol:                 1
+    SCHOFIELD pistol:             2
+    PEACEMAKER pistol:            4
+    WP_WINCHESTER66 rifle:        8
+    WP_LIGHTNING rifle:          16
+    WP_SHARPS rifle              32
+    WP_REMINGTON_GAUGE shotgun:  64
+    WP_SAWEDOFF shotgun:        128
+    WP_WINCH97 shotgun:         256
+    WP_GATLING:                 512
+    PW_SCOPE:                  2048
+    PW_BELT:                   4096
+    WP_DYNAMITE:               8192
+    WP_MOLOTOV:               16384
+    WP_KNIFE:                 32768
+    
+
+    Examples:
+    g_removedItems 0  -- everything is available (default)
+    g_removedItems 4  -- no colt peacemaker
+    g_removedItems 7  -- no pistols
+    :
+    g_removedItems 32767  -- no additional knifes
+
+    The start weapon (set by g_startingweapon in SG1.1) remains unaffected.
+    */
+    { &g_removedItems, "g_removedItems", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse  },
     { &g_gametype, "g_gametype", "0", CVAR_SERVERINFO | CVAR_USERINFO | CVAR_LATCH, 0, qfalse  },
 
     { &g_maxclients, "sv_maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse  },
***************
*** 444,449 ****
--- 475,535 ----
     return -1;
  }
 
+ /*
+ ================
+ IsItemAvailable
+
+ Checks whether an item is available or removed from game as defined by g_removedItems
+ ================
+ */
+ qboolean IsItemAvailable( int giTag, int giType ) {
+    int digit = 0;
+
+    if (g_removedItems.integer == 0) {return qtrue;}
+
+    switch(giType){
+    case IT_WEAPON:
+       switch(giTag){
+          //pistols
+          case WP_REM58:           digit = 1; break;
+          case WP_SCHOFIELD:       digit = 2; break;
+          case WP_PEACEMAKER:      digit = 4; break;
+          //rifles
+          case WP_WINCHESTER66:    digit = 8; break;
+          case WP_LIGHTNING:       digit = 16; break;
+          case WP_SHARPS:          digit = 32; break;
+          //shotguns
+          case WP_REMINGTON_GAUGE: digit = 64; break;
+          case WP_SAWEDOFF:        digit = 128; break;
+          case WP_WINCH97:         digit = 256; break;
+          //automatics
+          case WP_GATLING:         digit = 512; break;
+          //explosives
+          case WP_DYNAMITE:        digit = 8192; break;
+          case WP_MOLOTOV:         digit = 16384; break;
+          // melee
+          case WP_KNIFE:           digit = 32768; break;
+          default:                 return qtrue;
+       }
+       break;
+    case IT_AMMO:
+       return qtrue;
+    case IT_ARMOR:
+       digit = 1024; break;
+    case IT_POWERUP:
+       switch(giTag){
+          case PW_SCOPE: digit = 2048; break;
+          case PW_BELT:  digit = 4096; break;
+          default:       return qtrue;
+       }
+       break;
+    default:
+       return qtrue;
+    }
+
+    if ((g_removedItems.integer & digit) == 0) {return qtrue;}
+    else                                       {return qfalse;}
+ }
 
  void QDECL G_Printf( const char *fmt, ... ) {
     va_list      argptr;
Last edited by zed on Thu May 13, 2010 1:00 am, edited 1 time in total.
zed
Drifter
 
Posts: 9
Joined: Wed Dec 02, 2009 3:54 pm



Postby /dev/random » Wed May 12, 2010 7:50 pm

On what system did you try to compile? Iirc PowerPC had some troubles with this.
Apart from that; congrats :D
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm



Postby zed » Wed May 12, 2010 8:02 pm

I solved the problem by deleting my cfg directory. In retrospective, I guess I had wrong values for the vm_* cvars (they should be 2; they were probably 1).
zed
Drifter
 
Posts: 9
Joined: Wed Dec 02, 2009 3:54 pm



Next

Return to Saloon

Show Sidebar
Show Sidebar

User Control Panel

cron