With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: sparcdr, torhu, Tequila

Adding new game type's

Postby MegaByte » Sat Jul 17, 2010 11:44 am

Heya I would like to know how to add a new game type for Smokin Guns. As I am trying to make more fun modes.

I am attempting to add a "Bank Robbery X" game mode.
More will follow.
Bank Robbery X has respawning when you die and you can buy whenever you like. I have had it working inside the already existing game mode but I wish to seprate it into my new one.

I have added { "Bank Robbery X" 6 } into my gameinfo.txt under join and game.
And defined my game type GT_BRX in bg_public.h under GT_BR

I have added in if statements everywhere concerning GT_BR to include GT_BRX as well. Including loading the map's for br into brx. And my changes I want in the appropriate places. Yes I could just set a flag on the map to switch between the game modes But ide like to be able to add new game mode's and select it from the game creation screen.

I can see my game mode in the server create and join screen's however whenever I try to create a gametype of BRX which translates to 6 it sets it to 5.

Even if i define another game type such as GT_HP afterwards and try to join that. It sets it to 5.

ui_gametype is correct however the g_gametype is not correct. When I try to call a vote to change my game type to GT_BRX which is in the list it says invalid game type. But how can it be invalid? Ive defined it and such.

If any experienced dev/modder could help me out on this one It would be greatly appreciated ive been pulling my hair out for days on it lol. It just won't load the game type I want even though it shows in the menu's. Is there some sort of hard coding to prevent new game mode's? or am I just making a simple error somewhere.
MegaByte
Drifter
 
Posts: 19
Joined: Wed Jul 14, 2010 11:40 am



Postby mLy! » Sat Jul 17, 2010 7:31 pm

Instant respawn is not a good thing, you need either fixed spawntimes (fe every 20 seconds) or either a delay of for example 7 seconds.

And buying whenever you want, I hope you don't mean where ever on the map but still in a 'buy zone'?
My Latest fragmovies:
Winning BB cup
User avatar
mLy!
Gunslinger
 
Posts: 218
Joined: Wed Feb 11, 2009 8:46 pm



Postby MegaByte » Sat Jul 17, 2010 11:37 pm

Yeah of course still in a buy zone :).
And instant respawn works great its fun :) ive tested it on lan with friends.

However I could add a cvar to allow setting the time players have to wait till they can respawn.

I have also had ideas for the Bounty game mode that ive been discussing with friend's and kaiyouw. Going to make info_buy_zone's to add in so we can have certian spots on map's you buy from any time eg a gun shop. Looking at having gun shops in different towns selling different things prehap so you have to travel or kill for better gun's.

Might add a flag if there is not already one set to disable buying at the spawn points.

Who has used a shooter entity's yet? I was thinking of adding a knife shooter and maybe a pistol shooter a possible use for each may be booby trap's in a map.

Any mapper's keen to make pirate ship's following the style of the times in 1800's see the pirates of the carribian movies for reference you can pause the video's for some good shots or watch the making of the movie.
I would love two ship's and several small boats. Think I could use them in a map which you could spawn on two boats one team on an english style law enforcing ship another team on a pirate ship. They could circle each other fireing cannon's with cannon balls which will damage the ship's causing holes in the side or floor to fall through etc. The issue i have here is how do we have a breakable applied to something on a train.. very confusing as they can't have more than 1 class might have to add a secondary class thing in. You could take the small boat's from one boat to another. Might try to add a grapple hook weapon that fires a rope and allows your char to climb a short distance. Or could just use ladder's on the boat etc. http://en.wikipedia.org/wiki/Pirate_ship http://www.google.co.nz/images?um=1&hl= ... =&gs_rfai=

Im also interested in creating func_vehicle_controlls and func_vehicle on smokin gun's so we can have horse's and of course carrige's that move. Im compleatly unceartian on how to code these yet as half life or source engine are not avaliable in source code and im unsure how well i could moun't the player model onto a brush at an origin.. when its used.

Also if somone could model me a cannon ball it would be great, sure its a sphere thats black and has lighting like one... so easy to do. Maybe we can add hand cannon's as a weapon too that would be cool.

I would also like to add a gunpowder barrel that you can pour on the ground or place on the ground. Should be able to throw a moltov or dynamite to light it. It would create fire if you have poured it and would have a rather big explosion if you have just placed a full barrel on the ground. If any modelers are keen to model this it would be greatly apreciated. If I did it would look terrible lol I suck at 3D modeling and rigging etc.

Another thing I would like to create is a "train" entity that rotates as it moves. The reason being is I wish to create bolder's that roll down hill's crushing anything in their path as well as tumble weed's you know the spherical shape of a dried up spikey plant that blows arround alot in western game's / movies. See wikipedia http://en.wikipedia.org/wiki/Tumbleweed

Anyway back to what I need to do first before I can do much of this :P
I am still unable to add new game types trying everything I can think of. Can someone more experienced help me out here please :). Might go ask in ioquake3 forums and irc too. Thanks in advance :D
MegaByte
Drifter
 
Posts: 19
Joined: Wed Jul 14, 2010 11:40 am



Postby Twig » Sun Jul 18, 2010 11:27 am

If i'm not mistaken, somebody modeled a cannonball not too long ago. I vaguely remember seeing a picture of it as well.
SG name: mS//Twig
User avatar
Twig
Pistolero
 
Posts: 34
Joined: Fri Oct 23, 2009 11:52 am



Postby RailedRobin » Sun Jul 18, 2010 2:14 pm

The cannonball can be found here: Cannonball
As for the powder barrel; the barrel itself wouldn't be too hard to make in a 3d-program, but I think we would have to change all the existing player models, so that they appear to be carrying it and pouring and the like. I'm not sure though, maybe a more experienced modeller can shed some light on this.

But here's a barrel I made, it's kinda crude but I just wanted to show it ain't that hard, hardly took me 5 minutes to make this. [thumb=http://forum.smokin-guns.org/userpix/672_Barrel_1.jpg][timg]672_Barrel_1.jpg[/timg][/thumb]

With a little tweaking and a more proper texture, it would function very well as a tnt barrel. It would also have to be scaled to fit the player models.

The idea with having a gunshop where you buy weapon sounds really interesting, one problem would be if players would be allowed to kill other players who are buying, since it could be a lot of camping around the gunshop...
A bullet may have your name on it, but dynamite is addressed "to whom it may concern."
User avatar
RailedRobin
Quick Draw
 
Posts: 54
Joined: Tue Jul 18, 2006 9:57 pm
Location: The frozen north



Postby !NuB!Donut » Sun Jul 18, 2010 3:22 pm

Im also interested in creating func_vehicle_controlls and func_vehicle on smokin gun's so we can have horse's and of course carrige's that move. Im compleatly unceartian on how to code these yet as half life or source engine are not avaliable in source code and im unsure how well i could moun't the player model onto a brush at an origin.. when its used.


A long time ago i had the same idea so i made a test map. It works quit easey the cars are a func_rotating. But the problem is you cant play this with bots and the cars stuck if a dead body is laying anywhere on the map. Furthermore you can see your own legs :lol: .

But look yourself

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/xvoMHdenwso&hl=de&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/xvoMHdenwso&hl=de&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
User avatar
!NuB!Donut
SG Team
 
Posts: 150
Joined: Wed Mar 10, 2010 8:57 pm
Location: Germany



Postby RailedRobin » Sun Jul 18, 2010 8:01 pm

Concerning your problem with adding the new gameplay, you might be able to find something helpful here: Code3Arena
A bullet may have your name on it, but dynamite is addressed "to whom it may concern."
User avatar
RailedRobin
Quick Draw
 
Posts: 54
Joined: Tue Jul 18, 2006 9:57 pm
Location: The frozen north



Postby MegaByte » Mon Jul 19, 2010 9:34 am

Thanks for the reply's and the rotating car thing looks interesting despite the glitch's of course :). I thought of a way to do the boat idea without a func_train just using func_rotate and having a bar deep under the map connecting the boat's with an origin in the center.

The idea with having a gunshop where you buy weapon sounds really interesting, one problem would be if players would be allowed to kill other players who are buying, since it could be a lot of camping around the gunshop...

I could just make certian areas where you can't shoot or people could be wise and scope out the area first to see if anyone is camping :D thats kinda the idea though but since its a big map it will be hard to find the others as theres multiple places they could go.
MegaByte
Drifter
 
Posts: 19
Joined: Wed Jul 14, 2010 11:40 am



Postby /dev/random » Mon Jul 26, 2010 4:18 am

Callvote is flawed in that concern, I don't remember whether there are any other traps you need to be aware of.

Code: Select all
void Cmd_CallVote_f( gentity_t *ent ){
/// ...

   // special case for g_gametype, check for bad values
   if ( !Q_stricmp( arg1, "g_gametype" ) ) {
      i = atoi( arg2 );
#ifndef SMOKINGUNS
      if( i == GT_SINGLE_PLAYER || i < GT_FFA || i >= GT_MAX_GAME_TYPE) {
#else
      if( i == GT_SINGLE_PLAYER || i < GT_FFA || i > GT_RTP) {
#endif
         trap_SendServerCommand( ent-g_entities, "print \"Invalid gametype.\n\"" );
         return;
      }

// ...


As you see, even in the original code you can't vote for BR, since it's after RTP in gametype_t. You can still set it via rcon or directly in server console.
]\callvote g_gametype 5
Invalid gametype.
]\g_gametype
"g_gametype" is:"5^7" default:"0^7"
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm




Return to Code

Show Sidebar
Show Sidebar

User Control Panel

cron