Data Realms Fan Forums
http://45.55.195.193/

Actor.AIMODE_BRAINDEAD
http://45.55.195.193/viewtopic.php?f=73&t=15291
Page 1 of 1

Author:  AgentBaron [ Wed Jun 10, 2009 3:31 am ]
Post subject:  Actor.AIMODE_BRAINDEAD

I've been trying to spawn enemies with the brainhunt AIMode, but the command itself seems unresponsive. I know there's something I'm missing because I've made it work once before. The problem is that to my eyes, I've copied the code exactly as it was in the working example and it stubbornly insists on the enemies standing around in sentry mode. Here's an example of my code when I'm creating the enemy:

Code:
example = CreateAHuman("Ima Example", "Example.rte");
chip = CreateHeldDevice("Control Chip","Base.rte");
example:AddInventoryItem(chip);
example.Team = 1;
example.Pos = Vector(2885, 710);
MovableMan:AddActor(example);
example.AIMode = Actor.AIMODE_BRAINHUNT;


I have no instances that send his AIMode back to sentry because every single instance of the enemy in the mission is sent to brainhunt. Other lesser enemies are sharing his curse, too.

Author:  Grif [ Wed Jun 10, 2009 3:34 am ]
Post subject:  Re: Actor.AIMODE_BRAINDEAD

Code:
         local zombie1 = CreateAHuman(zlist[math.random(#zlist)]);
         zombie1:AddAISceneWaypoint(Vector(3000,playerActor.Pos.Y));
         zombie1.Pos = Vector(400,850);
         zombie1.Team = 0;
         zombie1.AIMode = Actor.AIMODE_GOTO;
         zombie1:AddInventoryItem(CreateHDFirearm(wlist[math.random(#wlist)]));
         zombie1:AddInventoryItem(CreateTDExplosive(blist[math.random(#blist)]));
         MovableMan:AddActor(zombie1);


I got nothin', cause the above works fine.

Author:  mail2345 [ Wed Jun 10, 2009 3:55 am ]
Post subject:  Re: Actor.AIMODE_BRAINDEAD

AgentBaron wrote:
I've been trying to spawn enemies with the brainhunt AIMode, but the command itself seems unresponsive. I know there's something I'm missing because I've made it work once before. The problem is that to my eyes, I've copied the code exactly as it was in the working example and it stubbornly insists on the enemies standing around in sentry mode. Here's an example of my code when I'm creating the enemy:

Code:
example = CreateAHuman("Ima Example", "Example.rte");
chip = CreateHeldDevice("Control Chip","Base.rte");
example:AddInventoryItem(chip);
example.Team = 1;
example.Pos = Vector(2885, 710);
MovableMan:AddActor(example);
example.AIMode = Actor.AIMODE_BRAINHUNT;


I have no instances that send his AIMode back to sentry because every single instance of the enemy in the mission is sent to brainhunt. Other lesser enemies are sharing his curse, too.


Just have goto and set the brain as the waypoint.

Author:  AgentBaron [ Wed Jun 10, 2009 4:03 am ]
Post subject:  Re: Actor.AIMODE_BRAINDEAD

I was thinking of that, and I may do it as a last resort. The only problem is that the "brain" in this case is Dafred, and if the enemies (particularly the major one) reach him, they'll stop and revert to sentry behavior. Though I suppose that wouldn't be too much of an issue... I'll check that out, thanks.

EDIT: Ah ha! I figured it out. Brainhunt mode must automatically set waypoints for units in the Brains group. But since I set the brain to a non-Brain unit... they had nothing to waypoint. So I set the waypoints for them along with a timer that auto-updates every second to to Dafred's position.

Thanks, guys! I'm quite close to having a working scene ready to release.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/