Author Topic: Instantiating a hole bot independent of a hole brick?  (Read 930 times)

I'm making a weapon that requires creating an AIPlayer and having that AIPlayer attack players. This isn't necessarily the hardest thing in the world, I've written some AI code that does the job it's supposed to, but obviously it would be more efficient to just re-use Bot_Hole functionality because most people already have Bot_Hole installed and not to mention that the AI for Bot_Hole would probably be much better than whatever arbitrary code that I produce.

The problem is that Bot_Hole has so many checks and information dependent on the existence of a hole brick that it's becoming borderline impossible to re-use Bot_Hole functionality. I'm willing to copy Bot_Hole functions and remove these checks and try to write in arbitrary information where it's missing. Has anyone actually done this successfully before, or would know how to pull it off/what to look for? Any insight on this would be appreciated.

normally you could use new AiPlayer() { datablock = PlayerStandardArmor; }; but hole bots have their own class/datablock i think so i'm sure you could just either do new HoleBot() { }; or d/at/abl/ock =/ BotHoleArmor; or something like that

try dumping a hole bot in the console and/or checking its class

(sorry i had to put a bunch of / on datablock, for some reason cloudfare would block me if i even tried to finish that sentence, dunno why)
« Last Edit: June 06, 2017, 08:13:21 AM by PhantOS »

I think I explained this wrong, I'm not having trouble instantiating an AIPlayer with a hole bot datablock, I'm actually trying to get an AIPlayer to run through the bot hole AI loop without deleting itself or breaking. Like wandering, following targets, and hMelee and things of that nature.

but hole bots have their own class/datablock i think so i'm sure you could just either do new HoleBot() { };

Are you sure it's HoleBot()? I gave it a shot and it said it was unable to instantiate. Seems to recognize the term 'holeBot' though
EDIT: Used /getID on a zombie hole bot and it said it's classname was AIPlayer

i remember trying to do that and it was loving hell. what i ended up doing was tracking down the hole bot aim and movement methods and just copy/pasting those into my own implementation

Could just create a brick for it in the farlands or something

gonna be honest with you you're far better off coding your own ai using the two functions setmovey and setaimobject since hole bots contains a bunch of extra grock that can screw with your bot's ai

basically dive into bot hole code, find functions that you can use to set the bot's look direction, and then use those to write your own ai

source: me needing to recode dog ai from scratch for prison break since bot holes forgeted with it so much making it an unreliable enemy