How Do I Get Ai To Work In Realm Wars?
by Jacque Perin · in Technical Issues · 07/07/2007 (9:58 pm) · 16 replies
I need help! can someone help me get the ai player to even spawn in the game realm wars. It says it doesnt have a AI player class?
#2
07/08/2007 (11:22 am)
I am using realm wars. I get a error report if I execute that kork file. You can get a version of what I use at praxinok.blogspot.com
#3
07/08/2007 (6:32 pm)
Very strange. I know it has to work because one of the RW mod servers ("Planet Bang", I think) had AI guarding the flag in a capture the flag type game. Post the contents of that error report and I may be able to help.
#4
<<<<<< ******* onServerCreated in example.rw.server.scripts.dmgame.cs called
Loading compiled script rw/server/scripts/gameTypes/baseGame.cs.
Loading compiled script rw/server/scripts/audioProfiles.cs.
Loading compiled script rw/server/scripts/camera.cs.
Loading compiled script rw/server/scripts/markers.cs.
... Shape with old version.
Loading compiled script rw/server/scripts/triggers.cs.
Missing file: rw/server/scripts/inventory.cs!
Loading compiled script rw/server/scripts/shapeBase.cs.
Loading compiled script rw/server/scripts/fxEffects.cs.
Loading compiled script rw/server/scripts/staticShape.cs.
Loading compiled script rw/server/scripts/aiPlayer.cs.
====================================================================
=============================== AI Player ==========================
====================================================================
Loading compiled script rw/server/scripts/aiSensObj.cs.
Loading compiled script rw/server/scripts/aiAlgo1.cs.
Loading compiled script rw/server/scripts/consoleFunctions.cs.
Thats as far as it goes I used th kork files for it
07/08/2007 (6:58 pm)
Loading compiled script rw/server/scripts/gameTypes/dmGame.cs.<<<<<< ******* onServerCreated in example.rw.server.scripts.dmgame.cs called
Loading compiled script rw/server/scripts/gameTypes/baseGame.cs.
Loading compiled script rw/server/scripts/audioProfiles.cs.
Loading compiled script rw/server/scripts/camera.cs.
Loading compiled script rw/server/scripts/markers.cs.
... Shape with old version.
Loading compiled script rw/server/scripts/triggers.cs.
Missing file: rw/server/scripts/inventory.cs!
Loading compiled script rw/server/scripts/shapeBase.cs.
Loading compiled script rw/server/scripts/fxEffects.cs.
Loading compiled script rw/server/scripts/staticShape.cs.
Loading compiled script rw/server/scripts/aiPlayer.cs.
====================================================================
=============================== AI Player ==========================
====================================================================
Loading compiled script rw/server/scripts/aiSensObj.cs.
Loading compiled script rw/server/scripts/aiAlgo1.cs.
Loading compiled script rw/server/scripts/consoleFunctions.cs.
Thats as far as it goes I used th kork files for it
#5
Another thing; check the name of the PlayerData datablock in player.cs. If the name isnt DemoPlayer or PlayerBody, that's a problem that needs a quick fix. That is the datablock name Killer Kork uses when it spawns AI, and if it doesn't exist, it will crash your game. What version of TGE are you using?
07/08/2007 (7:38 pm)
Delete consoleFunctions.cs. It's pretty much useless unless you want to run tests on the AI. Maybe that could be crashing it ?Another thing; check the name of the PlayerData datablock in player.cs. If the name isnt DemoPlayer or PlayerBody, that's a problem that needs a quick fix. That is the datablock name Killer Kork uses when it spawns AI, and if it doesn't exist, it will crash your game. What version of TGE are you using?
#6
07/08/2007 (9:35 pm)
Praxinok.blogspot.com get my version there
#7
07/09/2007 (2:59 am)
You made Praxinox? Haha, hours of fun back in '05 :-D
#8
07/09/2007 (7:17 am)
Theres a new super mod on the horizion. We have come up with a AI partical system but I just wanted to see if we could get the AI player in that version.
#9
In AIPlayer.cs, look at AIPlayer::spawn(). It looks like this:
07/09/2007 (8:24 am)
Aha! Think I've got it.In AIPlayer.cs, look at AIPlayer::spawn(). It looks like this:
function AIPlayer::spawn(%name, %spawnPoint, %path)
{
// Create the demo player object
%player = new AIPlayer() {
dataBlock = DemoPlayer;
shootingDelay = 2000;
path = %path;
algo = 0;
team = 0;
};
MissionCleanup.add(%player);
%player.setShapeName(%name);
%player.setTransform(%spawnPoint);
return %player;
}Now, change it to this (changes in bold):function AIPlayer::spawn(%name, %spawnPoint, %path)
{
// Create the demo player object
%player = new AIPlayer() {
dataBlock = [b]LightMaleHumanArmor[/b];
shootingDelay = 2000;
path = %path;
algo = 0;
team = 0;
};
MissionCleanup.add(%player);
%player.setShapeName(%name);
%player.setTransform(%spawnPoint);
return %player;
}
#10
07/09/2007 (11:53 am)
Still error
#11
Well, I don't know what to tell you. Try the CodeSampler Tutorials. Hope it helps.
07/09/2007 (12:09 pm)
Wow, first Jacque Perin and now a Jacque Preen. Confused, but not curious...Well, I don't know what to tell you. Try the CodeSampler Tutorials. Hope it helps.
#12
07/10/2007 (5:50 am)
I have been trying to do this for 4 years!!!! I have only seen two others do it, and they wont tell anyone! Linker and [!!!]bit! damn them!
#13
07/15/2007 (6:51 am)
I kinda stopped playing realm wars like 3 years ago, but if i recall correctly the aiplayer stuff doesn't actually work in realm wars. me and bit basically rotated static shapes around to look like it aims at player. used impulses to push it along towards the player, and manually created projectiles that shoot towards the player
#14
07/15/2007 (8:09 pm)
I see. Thats what soupy has done with his AI. we will just have to see! check out creatureconvention.com
#15
08/05/2007 (1:06 am)
Retrospectively, ai is indeed in realmwars, i just came over from t2 at the time so i didn't know how the torque version differed, and deemed it broken =)
#16
03/05/2008 (10:41 pm)
Just wondering if anyone has actually figured his out yet, his is exactly what i need to do :/
Torque Owner Bryce
Toy Story 2 was O.K.
Before installing this resource, check to see that there is already an aiplayer.cs in your server/scripts directory. If there isn't, add
exec("./aiplayer.cs");In game.cs with all those other exec() statements. Create a new SimGroup in your mission called Paths, add a new path called Path1, and throw some nodes somewhere. Save the mission, install Killer Kork.Let's see if you get out alive. Open your console and type in AIManager::think(). Run up to the AI and you will shortly realize he doesn't like your presence.