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

Development::Bots Forum for bots.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-08-2014, 04:24 PM
DrakePhoenix
Fire Beetle
 
Join Date: Jan 2014
Posts: 22
Question Expanded race options for bots?

Hi everyone,

I'm trying to make it so that I can use some additional races for bots on my server, and also so that any bot can use any standard class regardless of race.

I've gotten all the changes in place to allow the #bot create command to not fail when using one of the additional races (such as race 439 for example for cats), and to allow any class for any race. I've also set it up for proper race to race_string values, and to use standard human base stats for the non-standard races. All of that works, and I can spawn bots of any of the additional races that I've added.

The problem I'm running into is that the bots refuse to display the actual appearance of the non-standard race when they are spawned. Some of them are global races, but I've also edited my GlobalLoad.txt file on my client to make sure that the additional races are explicitly made global. Nevertheless, they always show up as a generic human as though the race was not global.

I did a #showstats on a couple of them and noticed that the texture and helmtexture values were set to 255. This makes sense for standard playable races, as that setting basically means "show appearance based on worn equipment". So I looked through the code and found that the code does, in fact, automatically set the texture and helmtexture values to 255 precisely so that bots will display their equipped items. I tried using #texture on the spawned bots, and viola, they display correct race and skin when texture and helmtexture are set to the same as their face entry value. So, for example, for a cat using race 439 with texture and helmtexture of 0 you get a puma, with value of 3 you get a black panther, etc.


Now, the basic code process when you use the #bot spawn command is this (skipping over much of the details, and stuff that doesn't relate to bot appearance when spawned):

1 - Checks against multiple reasons that would cause bot spawn to fail.
2 - Makes a call to the LoadBot function.
3 - The LoadBot function creates an NPCTypeStruct, fills it with values from the database, and creates a Bot object based on the NPCTypeStruct.
4 - If we have successfully loaded a Bot object with the LoadBot function, then call the Spawn function.
5 - The Spawn function gets some basic information like bot name, and sets up for an entity spawn, then sets the helmtexture and texture values to 255, saves the bot object, generates position and orientation for the bot, adds the bot to the entity list, loads the bot's pet (if it has one), and then sends a position packet to create the actual bot spawn at the generated position. At this point the bot exists in the zone and should be visible.
6 - The spawn command processing then makes the bot state that it is ready for battle, and the command is finished processing.

So to try and get the system to automatically use the correct texture and helmtexture values for the bots, I modified the code for the Spawn function so that after texture and helmtexture were defined as 255, it would then check for non-standard race, and if the bot is non-standard race, then reset texture and helmtexture to be equal to the face entry value (a value that is actually saved in the bots table, unlike texture and helmtexture, and can be changed as desired with the #bot face command). This should make it so that when the bot is spawned, it will have a texture and helmtexture appropriate to the race.

I then tried a bot spawn again, and the bot still looked like a generic human. I used #showstats again and found that the texture and helmtexture were correct. They were no longer set to 255, but were identical to the face entry value for the bot. So that doesn't work, but I have no idea why.

Now then, the #texture command actually sends an illusion packet to the targeted MOB to change their appearance. So I thought, why not try and send an illusion packet to the bot after the Spawn function has finished, and before we exit out of the #bot spawn command processing. So I added in code to send an illusion packet that would reset texture and helmtexture to be equal to the face entry value. I set up this code after the "I am ready for battle." message, and then checked everything out again. I found that now the spawned bot model would change size immediately after spawning, but that it would still be a generic human model.


I really do not understand why the #texture command works in-game to make the non-standard races appear correctly after they have been spawned, but that I cannot make the bots spawn with a correct appearance.

Anyone have any ideas or suggestions? I'd really appreciate some help. While I could make it so that players can simply use #texture on their bots, they would have to do this every time they zone, and that really isn't what I want.

Thanks,
Drake Phoenix
Reply With Quote
 


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 07:56 AM.


 

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