Quake3World.com Forums
     Programming Discussion
        [GENERAL] Share your code and questions


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: [GENERAL] Share your code and questions

Warrior
Warrior
Joined: 13 May 2012
Posts: 90
PostPosted: 09-18-2013 02:45 PM           Profile Send private message  E-mail  Edit post Reply with quote


Obviously, we are all a little jelous about the goals we reach with the code, also the small ones.
But i still think that share some random codes will help ourself to improve and also to find some nice clues about how to improve it.
So share a part of your "mods" and get a nice talk in order to improve it.

I will write it, in a raw way, part of my code about forcing bots to use only gauntlet inside a match:

Code:
/*###########################
# BOTS USES ONLY GAUNTLET #
###########################
*/
mod on g_main.c
add
vmCvar_t   bot_onlygauntlet;
add
{ &bot_onlygauntlet, "bot_onlygauntlet", "0", CVAR_SERVERINFO, 0, qtrue  },
   
mod on g_local.h
extern   vmCvar_t   bot_onlygauntlet;

mod on ai_dmq3.c
on "void BotChooseWeapon(bot_state_t *bs) {"
   
   after the line
   "int newweaponnum;"
   
   add the following line
   if (bot_onlygauntlet.integer == 1){   //if the cvar is 1
      bs->weaponnum = 1;   //the selected weaponnum will be 1 = gauntlet you can specify also WP_GAUNTLET instead of 1
      return;   // stop here and don't go on with the other instruction
      }
   
ever on ai_dmq3.c
   check for "float BotAgression" and add // i don't know if is usefull add this stuff
   if (bot_onlygauntlet.integer == 1) {

   return 100;   // we want them aggressive and chasing the player also with gauntlet
   }

and also on "float BotFeelingBad"
change the first lines in order to figure like this
   if (bs->weaponnum == WP_GAUNTLET && bot_onlygauntlet.integer != 1) {
      return 100;
   }

   //the bot will feel bad with gauntlet but only if the bot_onlygauntlet cvar will be != 1 so theorically our bot_onlygauntlet
   //cvar will send back (if the cvar will be 1) a feelingbad == 0


That's what i do, i need to check it again but strangely the teammates bots on a >= GT_TEAM match will get angry with their teammates too and they tries to kill them like a FFA match




Top
                 

Recruit
Recruit
Joined: 03 Jan 2015
Posts: 1
PostPosted: 01-03-2015 03:50 AM           Profile   Send private message  E-mail  Edit post Reply with quote


BOTS USES ONLY GAUNTLET I think it must me changed to something new



_________________
Unlike scam a+ practice test dumps and itil v3 dumps training program, our best security+ questions and network+ certification online training courses provide you quick success in first try of icnd 640-822.


Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44136
PostPosted: 01-03-2015 06:57 AM           Profile   Send private message  E-mail  Edit post Reply with quote





Top
                 

Grunt
Grunt
Joined: 20 Feb 2011
Posts: 57
PostPosted: 01-03-2015 08:23 PM           Profile Send private message  E-mail  Edit post Reply with quote


I've been playing UT99 lately and i'm curious about how to implement some like the double movement key dash. If you quickly double-press any WASD key, the player dashes into that direction. Any ideas? :D




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44136
PostPosted: 01-05-2015 01:03 AM           Profile   Send private message  E-mail  Edit post Reply with quote


Just give a player a temporary speed boost in the correct direction?




Top
                 

Grunt
Grunt
Joined: 20 Feb 2011
Posts: 57
PostPosted: 01-05-2015 03:12 AM           Profile Send private message  E-mail  Edit post Reply with quote


It's not really a speed boost, but more like a half-height horizontal jump. How can i detect a double tap like that?




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.