[Release]My source...

05/27/2010 18:57 -impulse-#151
public void DuelistTest()
{
Game.Entity duelist = new Game.Entity(Game.EntityFlag.Bot);
duelist.MapObjType = Game.MapObjectType.Bot;
this.BotOwner = Entity.Owner;
duelist.Name = Entity.Name + "[BOT]";
for (int counter = 4; counter < 130; counter++)
duelist.SpawnPacket[counter] = Entity.SpawnPacket[counter];
duelist.UID = (uint)ServerBase.Kernel.Random.Next(1000000, 2000000);
lock (ServerBase.Kernel.Bots)
ServerBase.Kernel.Bots.Add(duelist.UID, this);
duelist.X = (ushort)(Entity.X + 1);
duelist.Y = (ushort)(Entity.Y + 1);
duelist.SendSpawn(this, false);
}

Tested and working.
05/27/2010 20:26 MonstersAbroad#152
+K, but howcome it will dissapear on ANY movment I make ???

P.S: Item commands wont work :( can somone give me an example ? I am trying
@item BuriedBlade Super 12 7 255 13 13 but no luck ?
05/27/2010 21:30 -impulse-#153
1st: That's because you didn't add anything in Screen.cs to be spawned from ServerBase.Kernel.Bots dictionary.

2nd: Use what VC#(VS actually) gives. Besides that you need a brain.

Some thing that might help ya a bit: 'breakpoints'
05/27/2010 22:18 pro4never#154
Quote:
Originally Posted by MonstersAbroad View Post
+K, but howcome it will dissapear on ANY movment I make ???

P.S: Item commands wont work :( can somone give me an example ? I am trying
@item BuriedBlade Super 12 7 255 13 13 but no luck ?
because on movement it checks for things to spawn... if you don't change that spawn code to include a dictionary of bots loaded on the server then it won't show them.

Think about it like this..

Sending the spawn packet to show the client the bot works... but that doesn't mean there is actually a bot on the server. It just means the client gets told "hey, there's something that looks like this on your screen!" and so it displays it. For any sort of permanence you need a dictionary to hold the entity on the server and then whenever you are updating the clients surroundings (mobs, players, npcs, items and whatever else) you will need to run through the local bots and spawn those as well.

Same with bot actions. You need to send the action to the client to display the change.

The bot itself needs no packets sent because there is no client to be updated. Packets are ONLY used to A: Update client from server and B: Update server from client.

Bots are all Server-Server meaning no packets are needed. You just change the bot variables and everything is perfect. it's the clients that need to be updated.

Again: Sorry if I got anything a bit off but that's the way I think about it. The actual method of going about it is most likely different in this source as I've done very little mucking about in the finer aspects of it as of yet.
05/29/2010 19:04 kid2nice#155
i got it too work too and i cant w8 till yah have completed this project because i want to make a quest where you have to fight your [DARK] self in order 2 unlock skills i am not a very good coder but i am trying really hard to learn
05/29/2010 21:31 MonstersAbroad#156
Ok to make it all abit neater I removed the code and remade it in Game->Features->Bot->Bot.cs and inside the .cs is
Code:
using System;
using Conquer_Online_Server.Network.GamePackets;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace Conquer_Online_Server.Game.Features.Bot
{
    class Bot
    {
        public static void Spawn(Client.GameState client)
        {
            Game.Entity duelist = new Game.Entity(Game.EntityFlag.Duelist);
            duelist.MapObjType = Game.MapObjectType.Duelist;
            duelist.BotOwner = client.Entity.Owner;
            duelist.Name = client.Entity.Name + "[Bot]";
            for (int counter = 4; counter < 130; counter++)
                duelist.SpawnPacket[counter] = client.Entity.SpawnPacket[counter];
            duelist.UID = (uint)ServerBase.Kernel.Random.Next(1000000, 2000000);
            lock (ServerBase.Kernel.Duelists)
                ServerBase.Kernel.Duelists.Add(duelist.UID, true);
            duelist.X = (ushort)(client.Entity.X + 1);
            duelist.Y = (ushort)(client.Entity.Y + 1);
            [B][COLOR="Red"]duelist.SendSpawn(duelist, true);[/COLOR][/B]
        }
    }
}
Error marked in red is as follows
Code:
The best overload method match for 'Conquer_Online_Server.Entity.SendSpawn(Conquer_Online_Server.Client.GameState, bool)' has some invalid arguments
Any idea how to fix that becuase thats the code to actually spawn it ???
05/29/2010 23:04 -impulse-#157
Quote:
Originally Posted by MonstersAbroad View Post
Ok to make it all abit neater I removed the code and remade it in Game->Features->Bot->Bot.cs and inside the .cs is
Code:
using System;
using Conquer_Online_Server.Network.GamePackets;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace Conquer_Online_Server.Game.Features.Bot
{
    class Bot
    {
        public static void Spawn(Client.GameState client)
        {
            Game.Entity duelist = new Game.Entity(Game.EntityFlag.Duelist);
            duelist.MapObjType = Game.MapObjectType.Duelist;
            duelist.BotOwner = client.Entity.Owner;
            duelist.Name = client.Entity.Name + "[Bot]";
            for (int counter = 4; counter < 130; counter++)
                duelist.SpawnPacket[counter] = client.Entity.SpawnPacket[counter];
            duelist.UID = (uint)ServerBase.Kernel.Random.Next(1000000, 2000000);
            lock (ServerBase.Kernel.Duelists)
                ServerBase.Kernel.Duelists.Add(duelist.UID, true);
            duelist.X = (ushort)(client.Entity.X + 1);
            duelist.Y = (ushort)(client.Entity.Y + 1);
            [B][COLOR="Red"]duelist.SendSpawn(duelist, true);[/COLOR][/B]
        }
    }
}
Error marked in red is as follows
Code:
The best overload method match for 'Conquer_Online_Server.Entity.SendSpawn(Conquer_Online_Server.Client.GameState, bool)' has some invalid arguments
Any idea how to fix that becuase thats the code to actually spawn it ???
Change it into duelist.SendSpawn(client, true);
05/29/2010 23:32 MonstersAbroad#158
Brings an extra error :(
Here a pic:
[Only registered and activated users can see links. Click Here To Register...]

If you cant see it [Only registered and activated users can see links. Click Here To Register...].
05/30/2010 10:35 MonstersAbroad#159
Well excuse me! #Reported for calling me an idiot, I am dumb that's all.
05/30/2010 16:45 -impulse-#160
Quote:
Originally Posted by MonstersAbroad View Post
Well excuse me! #Reported for calling me an idiot, I am dumb that's all.
Ah, well, probably I'm the one who should apologize because meh, lately if you don't read the errors which are VERY, VERY CLEAR you would be cooler.

Ah, and I'm pretty sure that you once said that someone should just read the errors before posting.

So, more likely I was just right.
05/31/2010 05:37 kid2nice#161
Quote:
Originally Posted by MonstersAbroad View Post
Ok to make it all abit neater I removed the code and remade it in Game->Features->Bot->Bot.cs and inside the .cs is
Code:
using System;
using Conquer_Online_Server.Network.GamePackets;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace Conquer_Online_Server.Game.Features.Bot
{
    class Bot
    {
        public static void Spawn(Client.GameState client)
        {
            Game.Entity duelist = new Game.Entity(Game.EntityFlag.Duelist);
            duelist.MapObjType = Game.MapObjectType.Duelist;
            duelist.BotOwner = client.Entity.Owner;
            duelist.Name = client.Entity.Name + "[Bot]";
            for (int counter = 4; counter < 130; counter++)
                duelist.SpawnPacket[counter] = client.Entity.SpawnPacket[counter];
            duelist.UID = (uint)ServerBase.Kernel.Random.Next(1000000, 2000000);
            lock (ServerBase.Kernel.Duelists)
                ServerBase.Kernel.Duelists.Add(duelist.UID, true);
            duelist.X = (ushort)(client.Entity.X + 1);
            duelist.Y = (ushort)(client.Entity.Y + 1);
            [B][COLOR="Red"]duelist.SendSpawn(duelist, true);[/COLOR][/B]
        }
    }
}
Error marked in red is as follows
Code:
The best overload method match for 'Conquer_Online_Server.Entity.SendSpawn(Conquer_Online_Server.Client.GameState, bool)' has some invalid arguments
Any idea how to fix that becuase thats the code to actually spawn it ???
are you gonnah release how u made it neater or how u fixed the bot ?
because i really cant w8 for this bot its gonna be really cool :)
05/31/2010 10:45 MonstersAbroad#162
Meh, I have cleaned the whole thing up so there a bot.cs walking/jumping.cs skill.cs and thats it :) I don't know weather I'm gonna release it yet tho
05/31/2010 16:10 kid2nice#163
Quote:
Originally Posted by MonstersAbroad View Post
Meh, I have cleaned the whole thing up so there a bot.cs walking/jumping.cs skill.cs and thats it :) I don't know weather I'm gonna release it yet tho
ahh man. oh well
05/31/2010 21:27 MonstersAbroad#164
I said im not sure ;)
06/01/2010 00:27 chickmagnet#165
Quote:
Originally Posted by MonstersAbroad View Post
I said im not sure ;)
lol maybe u should