Game Development Community

Realm Wars AI

by Henry Phuong · in Technical Issues · 03/17/2008 (3:30 pm) · 3 replies

Hi, ive been modifying realm wars quite a bit and i just want to add some AI. Ive been trying to use the functions in the aiPlayer.cs such as AIPlayer::spawnOrc(), but i keep getting the error

/scripts/aiPlayer.cs (89): Unable to instantiate non-conobject class AIPlayer.
Set::add: Object "0" doesn't exist

has anyone got any solutions to this? or if anyone has a way to create some AI im all ears. cheers

#1
03/17/2008 (6:28 pm)
I am trying to remember what this is... it is St patricks day so I may not remember too well right now, but make sure that under game.cs that you have the ork loading prior to the aiplayer.cs. This is the first step, but it might be how the aiplayer is being called that is causing the issue within the aiplayer.cs script.
#2
03/18/2008 (4:52 am)
Ive just found out realm wars doesnt actually have an ai player class which would cause the problem

is there anyway to recreate the effect of there being AI? even if it looks obviously fake, unfortunately time is not on my side, and i dont have the source code to recompile the game :(
#3
03/29/2008 (2:30 am)
Well, you could place a static shape in the world, and then make a schedule-repeating function that uses a ContainerSearch to find the closest target. Then, if you want the "AI Player" to face the target, you need to apply some vectoring code to rotate it (no vertical aiming, though), and create a projectile manually that sails off toward the target.