Author Topic: AIConnections not creating?  (Read 943 times)

I am hosting a test server, and after a while it seems that AIconnections stop being created.
Code: [Select]

%mob.client = new AiConnection(%ID)
{
player = %mob;
};
echo("Mob client:" SPC %mob.client);
it messages "Mob client: 0". This only happens after the server's been up for a little while. The clients work at first, but then they break.

Post the rest of your code.

I am hosting a test server, and after a while it seems that AIconnections stop being created.
Code: [Select]

%mob.client = new AiConnection(%ID)
{
player = %mob;
};
echo("Mob client:" SPC %mob.client);
it messages "Mob client: 0". This only happens after the server's been up for a little while. The clients work at first, but then they break.

try

%mob.client = new AIConnection()
{
player = %mob;
};
%mob.client.setName(%ID);
echo("Mob client:" SPC %mob.client);

Code: [Select]
%mob = new AiPlayer()
{
dataBlock = $Mob::Player;
director = %this;
mobType = "Enemy";
};
%ID = "Mob" @ %mob.getid();
%mob.client = new AiConnection()
{
player = %mob;
};
%mob.client.setName(%ID);
echo(%mob);
echo("Mob client:" SPC %mob.client);
%mob.client.minigame = $MainMinigame;
%mob.minigame =$MainMinigame;
echo("Spawn mob!!!!!!");
I now get "Unable to find object '0' attempting to call function 'setname'
it seems to just not be creating the client at all.

Try using an AiClient instead of an AiConnection.

That didnt seem to work either.

function clearTheDungeon() {
   deleteVariables("$NixRPG::DG::Generated*");
   deleteVariables("$NixRPG::DG::isBrick*");
   deleteVariables("$NixRPG::DG::madeObject*");
   %cl = new AIConnection() {
      name = "";
      bl_id = 0;
      isAdmin = true;
   };
   serverCmdClearBots(%cl);
   %cl.delete();
   clearDGDungeonLoop(BrickGroup_88);
}

is that helpful to you in anyway?

Maybe there is a server quota blocking it?

Tell me if this works:
Code: [Select]
%mob = new aiPlayer()
{
dataBlock = $Mob::Player;
director = %this;
mobType = "Enemy";
};

%mobClient = new aiConnection()
{
player = %mob;
};

%mob.client = %mobClient;

echo("Mob = " @ %mob @ " Mob Client = " @ %mobClient @ ".");

Maybe there is a server quota blocking it?
I thought that.

My AIConnection objects are useless in my scripts, because they do not seem to work with V21 right.

It just started to happen again on my server. This has become a problem because even though it counts them as in the minigame, the mobs cannot damage things but can be damaged. They dont even call a damage function when they shoot something (they do when their client is actually created)

i cant leave my server running because of how they can break and render some parts of the server unplayable, and i can only test the problem when it actually occurs (like now!)

edit: more details
Code: [Select]
%client = new AIConnection()
{
player = %mob;
};
echo("Client: " @ %client);
echo says "Client: 0".
when i do
Code: [Select]
echo(new aiconnection());it creates a client and echos the object ID back.
« Last Edit: October 19, 2012, 09:33:44 PM by heedicalking »

It seems through a trace it calls Gameconnection::Ondrop after creating one through the script.

Perhaps it's adding them to the player count?