Quote:
Originally Posted by kid2nice
well i have been trying to fix the code but im not such a good coder and the bot spawns but dont move and when i move he leaves and its evan harder t o code this source since is new
|
As said in my original post and I'm fairly sure in monster's also... You need
A: a dictionary to store bots on the server (in coemu that would go something like
Dictionary<int, Bot> Bots = new Dictionary<int, Bot>();
under nano.cs (world.cs if using elitecoemu) where 'Bot' is your structure that holds the bots stats (in my example source I posted with fully working bots and in my original code I had it under Entities>Bots.cs. His guide is most likely different as he coded/recoded it himself)
Then you need to change your spawn all (coemu term) or spawn screen (generic term) code to include the bots on the server. Something along the lines of..
foreach(KeyValuePair(int, Bot) Bots in World.Bots)
{
CSocket.Send(SpawnBot(Bots.Value));
}
Or something along those lines (again using alot of coemu terms cause that's what I wrote my system for).
For actions you need a thread handling the bots. Refer to my fully functioning source that has bots already working in it for some info on how to do that. Basically I just used a very basic system of datetime checks run through all bots on the server and then sent the jump packets to all local clients dependent on where the bot moved to.
The basics of the system are actually quite simple. There's just alot of stuff to break down....
if you had a hard time with his code then take a peek at the original thread... it has my initial work/codes as well as links to a source with it already working in it for testing purposes. That way you have a bit less guess work when trying to convert it.
Best of luck.