IPB WARNING [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead (Line: 558 of /sources/classes/bbcode/class_bbcode.php)
IPB WARNING [2] preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead (Line: 558 of /sources/classes/bbcode/class_bbcode.php)
combat - RCBot Forums
IPB

Welcome Guest ( Log In | Register )

> combat
BigBadWoLf
post Feb 7 2004, 10:19 PM
Post #1


Member
**

Group: Members
Posts: 27
Joined: 31-January 04
Member No.: 213



The marine bots don't seem to upgade weapons and armor, but the wierd thing is, i saw one upgrade into HA(ns 3.0 beta1) tongue.gif and never again after that. The aliens seem to evolve into gorges(beta2) but doesnt upgrade armor and stuff. I hope the next version will support these and hope they could climb better.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
Chichou
post Jun 5 2004, 08:43 PM
Post #2


Member
**

Group: Members
Posts: 23
Joined: 29-May 04
From: france
Member No.: 305



I tried to code something for combat with your source code, but i am a noob C++ coder, so all i do is crap :

So I added this in the middle of the Think function

CODE

if ( gBotGlobals.m_iCurrentMod == MOD_NS && IsMarine())
{
 char name[31];
 // is it a combat map ?
 strncpy(name, STRING(gpGlobals->mapname), 31);
 int level = m_iLevel;
/*buggy*/ int points = *NS_GET_PLAYER_POINTS(m_pEdict);
 DebugMessage(BOT_DEBUG_THINK_LEVEL,NULL,0,"%s has currently : %i levels and %i points",m_szBotName,level,points);
 if ( (level > points + 1)  && (name[0] == 'c') )
 {
  AddPriorityTask(CBotTask(BOT_TASK_MARINE_UPGRADE,0,NULL,level - points - 1 ) );
 }
}

if ( bLookForNewTasks ) [etc...]




and this with the other sections with deal with tasks... The bots choose upgrades in this order, using impulses (anyone know which thing indicates whether the bot has taken resuppply ?) the PointsFree may be used to choose upgrades...

CODE
 case BOT_TASK_MARINE_UPGRADE:
  {
   int PointsFree = m_CurrentTask->TaskInt();
   DebugMessage(BOT_DEBUG_THINK_LEVEL,NULL,0,"Bot is choosing upgrades");
   if ( !(pev->iuser4 & MASK_UPGRADE_1) )
   {
    Impulse(23); // Damage lvl1
   }
   else if ( !(pev->iuser4 & MASK_UPGRADE_4) )
   {
    Impulse(20); // Armor lvl1
   }
   else if ( !(HasWeapon(NS_WEAPON_SONIC)) && !(HasWeapon(NS_WEAPON_HMG)) )
   {
    Impulse(64); // Shotgun
   }
   else if ( (HasWeapon(NS_WEAPON_SONIC)) && !(HasWeapon(NS_WEAPON_HMG)) )
   {
    Impulse(65); // HMG
   }
   else if ( !(pev->iuser4 & MASK_UPGRADE_5) )
   {
    Impulse(21); // armor lvl2
   }
   else if ( !(HasWeapon(NS_WEAPON_WELDER)) )
   {
    Impulse(62); //welder
   }
   else if ( !(pev->iuser4 & (MASK_UPGRADE_7 | MASK_UPGRADE_13)) )
   {
    Impulse(RANDOM_LONG((int)BUILD_HEAVY,(int)BUILD_JETPACK));
   }
   else // if !(pev->iuser4 & MASK_UPGRADE_12)   ??? what is the code for resupply ?
   {
    Impulse(31); // Resupply
   }
   bDone = TRUE;
  }
  break;


The result is that marines take upgrades, but as I don't know how to get points, the comparison between level and points become useless, and the bots get stuck in the "marine upgrade task" (which i added with the other tasks)

Actually the offset for getting points may be wrong, or i take it with the wrong edict, i tried with the one which can be found in the 'NS coding FAQ', and also with the one for beta 4a which i found on the modns.org forum.

Oh, and i forgot to tell you, you forgot a star here :
CODE

#define NS_GET_PLAYER_POINTS(player) (int*)((char*)(player)+NS_PLAYER_POINTS_OFFSET)


because the value returned should a pointer.
And in the code which returns level there is a '/100' missing, so it always think the bot has lvl10... But it is the old source code, and you may have fixed all this...

and the impulse codes which are in the ui.txt (already set as constants in your code) :

QUOTE


UpgradeDamage1/23
Shotgun/64
UpgradeDamage2/24
UpgradeDamage3/25
HMG/65
GL/66

Catalyst/27
Resupply/31

Scan/53
MotionTracking/33

Mines/61
Grenade/37
Welder/62

UpgradeArmor1/20
UpgradeArmor2/21
Jetpack/39
HeavyArmor/38
UpgradeArmor3/22

User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic
BigBadWoLf   combat   Feb 7 2004, 10:19 PM
Cheeseh   word taken, I've already said they dont suppor...   Feb 7 2004, 10:28 PM
Scikar   Hasn't Clamatius got his Whichbots buying upgr...   Feb 7 2004, 11:54 PM
Cheeseh   I dunno, i didnt think they did.   Feb 8 2004, 12:43 AM
Scikar   In the latest Whichbot build, 0.9h, they all get c...   Feb 8 2004, 02:30 AM
BigBadWoLf   Yes they do. And they really like evolving to onos...   Feb 8 2004, 04:08 AM
Cheeseh   I think my alien bots upgrade to all that stuff al...   Feb 8 2004, 01:00 PM
Scikar   Can you not apply that to the marines then?   Feb 8 2004, 01:46 PM
Cheeseh   yea, but the marine stuff is different, first I do...   Feb 8 2004, 02:04 PM
Scikar   Well I can give you a list. Everything costs one ...   Feb 8 2004, 06:45 PM
BigBadWoLf   Yes they do, but only into gorges though. And th...   Feb 8 2004, 08:17 PM
Cheeseh   yea I know they can upgrade each level, but how do...   Feb 8 2004, 08:23 PM
CheesyPeteza   From the NS Coding FAQ: You can find out the up...   Feb 8 2004, 09:32 PM
Cheeseh   thanks but the level thing is confusing me here, ...   Feb 8 2004, 10:39 PM
Scikar   Negate what? /Me is confused. :P   Feb 8 2004, 11:58 PM
Cheeseh   :unsure: its not very well explained either.....   Feb 9 2004, 12:05 AM
Scikar   I think I get it. If you are level 1 you have 0 po...   Feb 9 2004, 12:17 AM
CheesyPeteza   Now I'm confused. :unsure:   Feb 9 2004, 11:19 AM
Scikar   OK, I don't really know what I'm talking a...   Feb 9 2004, 02:00 PM
Cheeseh   the player experience function there, which is act...   Feb 9 2004, 06:58 PM
Scikar   Here ya go: Experience : Level 0 : 1 100 ...   Feb 9 2004, 11:56 PM
Cheeseh   thats good info thanks :D!!!   Feb 10 2004, 05:18 PM
[-UDS-] Azrael   hi, im running a NS 3.0b3 server on steam with rc...   Feb 16 2004, 02:00 PM
Cheeseh   'cos marine updates haven't been done, s...   Feb 16 2004, 06:34 PM
CheesyPeteza   NS tells from the map name, try renaming an ns map...   Feb 16 2004, 07:27 PM
Cheeseh   damn that was quick :P hmm alright.. I guess this...   Feb 16 2004, 07:42 PM
BigBadWoLf   Any updates on the combat issue? <_<   Feb 24 2004, 06:03 AM
Scikar   Alien Evolution Costs: All chamber upgrades cost ...   Feb 25 2004, 09:23 PM
PetitMorte   Marine Upgrade Tree:       ...   Mar 4 2004, 05:49 PM
Meat_Popsicle   hows the combat code coming along then   Mar 18 2004, 10:44 AM
Cheeseh   done nothing so far, all the latest stuff is in th...   Mar 18 2004, 10:31 PM
Meat_Popsicle   is there a compiled version in the source download...   Mar 19 2004, 07:50 PM
Cheeseh   RE: combat   Jun 5 2004, 07:25 PM
CheesyPeteza   RE: combat   Jun 5 2004, 08:08 PM
Chichou   I tried to code something for combat with your sou...   Jun 5 2004, 08:43 PM
Cheeseh   Well that was easy, never even HAD to worry about ...   Jun 5 2004, 11:49 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 14th September 2025 - 04:54 PM