.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Cyborg Factory > HPB_bot
HPB_bot The trusty good ole mechs by botman HLDMTFCOpposing ForceDMCFront Line Force

Reply
 
Thread Tools
Resurrected bots
Old
  (#1)
ukfreethinker
Member
 
Status: Offline
Posts: 6
Join Date: May 2004
Default Resurrected bots - 12-05-2004

I want my bots to have a lower health when they enter the world. If I put

pBot->pEdict->v.health = 8;

into the BotSpawnInit() function they are very easy to kill in their first incarnation. But when they respawn they have full health. I tried putting the same line into BotThink() where the bot clicks "Fire" to respawn but somewhere this is getting overridden. Can anyone suggest where this initialisation code should go?

Thanks very much

Paul
  
Reply With Quote
Re: Resurrected bots
Old
  (#2)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Resurrected bots - 12-05-2004

Just check to see if the bot's health is greater than the max amount you want them to have at the top of the BotThink() function. If it's 100 (or higher), set it to the value you want it to be.

botman
  
Reply With Quote
Re: Resurrected bots
Old
  (#3)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Resurrected bots - 12-05-2004

This is yet another example of how unsafe it is to write arbitrary stuff in the entvars when the engine doesn't expect it.

By setting this, you are overwriting what the engine already writes at the same location. The question is whether you write it before the engine passed here or after it.

And there's also a problem with the clients. All your clients' DLL (including your listen server client) are programmed to know that when a player respawns, his health starts at 100. You change this by the engine side. But then, all the clients' predictions get out of sync. If you make a change to a player's health arbitrarily, send an update network message to all your clients.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Resurrected bots
Old
  (#4)
ukfreethinker
Member
 
Status: Offline
Posts: 6
Join Date: May 2004
Default Re: Resurrected bots - 12-05-2004

Seems like BotSpawnInit is only called once when a bot is first added. The health is reset by CBasePlayer::Spawn in the game DLL when a dead bot comes back to life. For what I am doing I don't mind changing the game DLL as well but it would be neater to do it in the Bot DLL. Is there anything which is called after CBasePlayer::Spawn in the Bot DLL where I can do it?

I want the bots to start with a health of 50 and then be more motivated to increase their health as well as suffer damage during fighting.

Paul

PS. Respect to botman for reverse engineering all this stuff! Must have been a big effort.
  
Reply With Quote
Re: Resurrected bots
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Resurrected bots - 12-05-2004

Which MOD is this for ?

If this is HLDM, all a bot needs to do to respawn is to press the FIRE key. Pressing this key to respawn will also make the bot trigger a call in CBasePlayer::Spawn in the game DLL. Hence if you want the bots to reset their structure AFTER pressing the fire key and not BEFORE it, call BotSpawnInit() one frame after the bot has set his pEdict->v.button to IN_ATTACK.

The code that makes the bot press IN_ATTACK when dead is in BotThink(), if I remember well.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com