Bots, NPC Taunts and precached sounds Created 6 years ago2017-06-23 16:56:01 UTC by abbadon abbadon

Created 6 years ago2017-06-23 16:56:01 UTC by abbadon abbadon

Posted 6 years ago2017-06-23 22:11:34 UTC Post #335707
I swear I did not want to rhyme.

Well my question is about the taunts of the npc barney and the sounds that this npc makes in certain situations. More precisely, I have one doubt. I have discovered that the Bots in my mod are able to "speak" certain sentences in certain situations, but I don´t see anywere where those sounds are precached, the only related code is related to the TAUNT sounds that barney can play, so this is saying to me that if I want to play those sounds I have to have the barney´s code precaching all those sounds?. Then if I am not using the barney.cpp code anymore, I mean, deleted from the source, where should I precache those sounds again?, there are several bot source files, like Bot.h, Bot.cpp and Bot_combat.cpp, so I am not sure on where to put the (if needed) code. :/ It is not that I did not want to try it, because I did add the code that plays those sounds where it originally was (bot_combat.cpp) nand all compiled fine , is more that I want to be sure about where should I put the precache part for those sounds based on your experience without the need of trial-error sessions. Thanks in anticipation.

EDIT: tested and the bots don´t emit sounds...and all the sounds are in the proper place/folder ;)
Posted 6 years ago2017-06-24 10:44:46 UTC Post #335721
HPB Bot does the precaching in DispatchSpawn (it only precaches if the entity whose spawn it is dispatching is worldspawn).
Half-Life itself does global precaching in CWorld::Precache in world.cpp which is probably more performant as there's no check each time DispatchSpawn is called.
Posted 6 years ago2017-06-24 14:04:54 UTC Post #335723
Ok. I will try to precache those sounds in world.cpp. I'll tell you what happen ;)
Posted 6 years ago2017-06-25 20:23:12 UTC Post #335749
Aaaand, no, it creates some errors saying undeclared stuff, etc. BUT I precached them in client.cpp and all worked ok after some changes in bot.cpp and bot_combat.cpp, major changes related to the fact that sounds are only made as taunts when another player enemy is at a certain distance or it is dead. You know, trial-error forever!, haha :walter: Thanks anyway for your help!
You must be logged in to post a response.