Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bots

Development::Bots Forum for bots.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-12-2015, 03:26 PM
skyy's Avatar
skyy
Fire Beetle
 
Join Date: Sep 2015
Posts: 15
Default BotOwner by AccountID instead of CharacterID

I am currently looking for a way to get bots to spawn if the accountID matches instead of the characterID and came to a bit of a pit regarding my meager knowledge of the source.

What i tried was looking into bots.cpp:

1) at the spawn command I disabled the check for owned bot:
Code:
if(!strcasecmp(sep->arg[1], "spawn") ) {
		if (RuleB(Bots, BotCharacterLevelEnabled)) {
			if (c->GetLevel() < RuleI(Bots, BotCharacterLevel)) {
				c->Message(0, "You are only level %d, you must be level %d to spawn a bot!", c->GetLevel(), RuleI(Bots, BotCharacterLevel));
				return;
			}
		}

		uint32 botId = GetBotIDByBotName(std::string(sep->arg[2]));
		int xy = c->AccountID();
		int yz = GetBotOwnerCharacterID(botId, &TempErrorMessage);
		int yzz = database.GetAccountIDByChar(yz);
			if (xy != yzz)//(GetBotOwnerCharacterID(botId, &TempErrorMessage) != c->CharacterID()) godrage
			{
				c->Message(0, "You can't spawn a bot that you don't own.");

			}
2) disabling the same check at the Bot::Spawn
Code:
void Bot::Spawn(Client* botCharacterOwner, std::string* errorMessage) {
	if(GetBotID() > 0 && _botOwnerCharacterID > 0 && botCharacterOwner )//&& botCharacterOwner->CharacterID() == _botOwnerCharacterID)
3) redoing the casttoclient to the actual client
Code:
if(this->Save())
			botCharacterOwner->CastToClient()->Message(0, "%s saved.", this->GetCleanName());
			//this->GetBotOwner()->CastToClient()->Message(0, "%s saved.", this->GetCleanName());
		else
			botCharacterOwner->CastToClient()->Message(13, "%s save failed!", this->GetCleanName());
			//this->GetBotOwner()->CastToClient()->Message(13, "%s save failed!", this->GetCleanName());
4) now the bot spawns and immediately despawns and I am stuck as to where the despawn is triggered


can anyone see this endeavour as totally fruitless ?

The main idea for my solo server project is to not have to create bots for every character you create over and over again.

thanks in advance!
Reply With Quote
  #2  
Old 10-12-2015, 03:49 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

This one is a little more involved than the other and I'm in the middle of an implementation review.


My guess on the despawn is that something is askew with the instantiated bot..probably not having an owner id..and the it is being marked
and processed for de-pop.


If I get time, I'll come back to this.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #3  
Old 10-12-2015, 03:52 PM
skyy's Avatar
skyy
Fire Beetle
 
Join Date: Sep 2015
Posts: 15
Default

would be great, thanks

in the long run i could see this as a candidate for rule_values
Reply With Quote
  #4  
Old 10-12-2015, 05:21 PM
Noport
Opcode Ninja
 
Join Date: Mar 2009
Location: San francisco
Posts: 426
Default

Code:
if (xy.equals(yz) && yz.equals(yzz)); True
else if
yzz.equals(null); False You can't spawn a bot that you don't own.
Reply With Quote
  #5  
Old 10-14-2015, 01:32 PM
skyy's Avatar
skyy
Fire Beetle
 
Join Date: Sep 2015
Posts: 15
Default

Quote:
Originally Posted by Uleat View Post
This one is a little more involved than the other and I'm in the middle of an implementation review.


My guess on the despawn is that something is askew with the instantiated bot..probably not having an owner id..and the it is being marked
and processed for de-pop.


If I get time, I'll come back to this.
id love to look into it, just dont know where to start looking for the being marked/process for depop - any pointers ?
Reply With Quote
Reply


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

   

All times are GMT -4. The time now is 09:47 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3