GoldenEye: Source Forums

Debriefing => Questions, Help, & How To's => Topic started by: markpeterjameslegg on August 19, 2012, 12:35:13 pm

Title: Change Bots Target Priorities
Post by: markpeterjameslegg on August 19, 2012, 12:35:13 pm
This question is really aimed at KM, as he is probably the only one that can answer me, though correct me if I'm wrong of course. I was wondering if there is any console command to make myself the only target for bots in deathmatch, so essentially all bots against me. This would be really fun, it would be like when you let the KF7 rip in Facility and all the guards would come running.
Title: Re: Change Bots Target Priorities
Post by: TriDefiance on August 19, 2012, 12:41:16 pm
As KM stated before, he will be adding more features to the AI system. A command that let's all the bots go after you is currently not in 4.2, put I'm pretty sure he'll but it eventually. As for now, just play free for all! :)
Title: Re: Change Bots Target Priorities
Post by: killermonkey on August 19, 2012, 01:56:11 pm
You will need to edit the bot's script, which is not hard at all.

Open up "gesource/scripts/python/Ai/bot_deathmatch.py"

Scroll down to line 55, you'll see a function called "IsValidEnemy( self, enemy ):"

Change the contents of that function to:

Code: [Select]
	def IsValidEnemy( self, enemy ):
myteam = self.GetTeamNumber()
if myteam != Glb.TEAM_NONE and enemy.GetTeamNumber() == self.GetTeamNumber():
return False
if enemy.IsNPC():
return False

return True

The problem with this, however, is the bots will still target other NPC's as enemies through the "Seek Enemy" routine. But we can fix that too.

Open up "gesource/scripts/python/Ai/Tasks/CommonTasks.py"

Go to line 15, add this right below the part that says "for contact in contacts:"

Code: [Select]
			if contact["ent_handle"].Get().IsNPC():
continue

Remember in Python, indentation MATTERS.
Title: Re: Change Bots Target Priorities
Post by: markpeterjameslegg on August 19, 2012, 02:07:37 pm
Thanks a lot KM, really nice of you to do that. Can't wait to try this, I reckon it'll be great fun. :)
Title: Re: Change Bots Target Priorities
Post by: killermonkey on August 19, 2012, 02:10:54 pm
I made a small typo in the second part. It should be contact["ent_handle"], not c["ent_handle"]
Title: Re: Change Bots Target Priorities
Post by: markpeterjameslegg on August 19, 2012, 02:19:40 pm
Thanks. :)
Title: Re: Change Bots Target Priorities
Post by: markpeterjameslegg on August 19, 2012, 02:28:41 pm
Can't tell if it works, it says that the bots are joining the game, but they don't, it's just me myself and I.

Don't want to cause you any hassle KM, you have enough work with this mod, I thought there might be a quick method through console for this, but it's not important. ;)
Title: Re: Change Bots Target Priorities
Post by: killermonkey on August 19, 2012, 02:45:27 pm
I didn't test my code so there may be errors. Lemme try it out myself

I have attached the modified scripts to this post. Just unzip them to your sourcemods directory (folder structure is preserved).

I tested this and it works, pretty neat actually. I can make this a mode eventually! Thanks for the suggestion.
Title: Re: Change Bots Target Priorities
Post by: markpeterjameslegg on August 19, 2012, 03:10:50 pm
Your a star, and your welcome. :)
Title: Re: Change Bots Target Priorities
Post by: markpeterjameslegg on August 19, 2012, 03:32:57 pm
OMG! This is flipping awesome. I've just been hunted like a dog, at one point at least 2 or 3 of the bots were using Rocket Launchers against me, my heart was actually racing trying to survive the onslaught of Rockets flying at me, and the buzz I felt when I managed to take a couple of them down with just a pistol was immense. This mod should definitely have a survival mode. Great job KM. ;D