Game Development Community

dev|Pro Game Development Curriculum

Friendly AI Marker

by Maximillian Brewer · 01/11/2009 (9:47 pm) · 33 comments

Download Code File

** Works with TGE 1.5.2 and TGEA 1.7.1 **

To implement the Friendly AI Marker just follow the simple steps below:

1. Make backups of you dev folder and game.cs file

2. Download the code file - aiMarker.cs

3. Copy aiMarker.cs into yourGame/server/scripts (make sure the file is still called aiMarker.cs)

4. Open up game.cs in the server/scripts folder and do the following...

Find:
exec("./aiPlayer.cs");

and place the following beneath it:
exec("./aiMarker.cs");

In startGame function

Replace this:
// Start the AIManager
   new ScriptObject(AIManager) {};
   MissionCleanup.add(AIManager);
   AIManager.think();

with the following:
AIPlayer::LoadEntities();
AIPlayer::LoadFriendlyEntities();

5. Now run you deleteDSOs.bat file, and launch your game mision...in the World Creator, you should see FriendlyAIMarker under Shapes/AiMarker.

Just drag this marker to were you wish to spawn you AI from. Then, save and play!

----------------------------------------------------------------------------------------------------------------------------------------

For any help with this, just post a comment, and I will help ASAP!
Page«First 1 2 Next»
#21
02/20/2009 (9:48 am)
Ill check out your resource for sure. Our Modeler guy is making a midival wagon or something like that.

dang youre pretty damn smart for 13. Im going to Devry University, been going for about 3 years now. I just turned 22, i wish i would of started when i was young.

Im also working on an iphone game with a friend of mine. We are building it TGB, and then if its good enough we will get itorque.
#22
02/20/2009 (7:38 pm)
I am also looking at iPhone dev, but not games, instead a set of utility apps :)
#23
02/25/2009 (8:30 pm)
heh, im going to DeVry University as well, for the game and simulation programming bachelor right now (i just started). I'm so bad at this.

I'm guessing this doesn't work in 1.8.1? i couldn't get the FriendlyAiMarker to show up in my editor.
#24
02/25/2009 (11:31 pm)
@ Kyle: Well i haven't tried it in TGEA 1.8.1, but make sure you have double checked the script, because if it works in 1.7.1 i don't know why it wouldn't in 1.8.1.

Also, did you use the new version (i posted the new file in the comments)

From Max

Ps. it's quite funny that i am 13 and am helping poeple in Uni ;)
#25
03/06/2009 (2:45 am)
Max
Have you got your AI marker working with the Yack Pack? I am not even see the text bubble pop up on kork.
#26
03/06/2009 (5:28 pm)
@Verin

I got this to work with my Yack Pack straight away :)

I suggest you:

1. double check all of the edits and changes you have to make

2. make sure you run delDSO.bat and delPREFS.bat and then restart

3. make sure that in the aimarker script file, you have put the yack pack things into the marker's player datablock...eg:

datablock PlayerData(FriendlyAI1 : PlayerBody)
{
   shootingDelay = 100;
   //START YACK

   canTalk = true;


   dialogScriptName = "Stanley_Sunshine_Dialogue";
   dialogScriptFile = "./dialogue/Stanley_Sunshine.dls";
   dialogImg = "starter.fps/data/shapes/player/Kork_Portrait.png";
   name = "Guide";
   //END YACK
};

From Max

PS. also be aware that for every talking NPC you want, you will need a new aimarker.cs file...eg:

if you want 2 talking NPC's, in the 2nd aimarker.cs you would change
function AIPlayer::LoadFriendlyEntities()
to
function AIPlayer::LoadFriendlyEntities[b]2[/b]()
#27
05/31/2009 (6:58 am)
Hi, your download code link no longer works.

Thanks
#28
06/01/2009 (12:36 am)
Thankyou for telling me. I will have a look at it and tell you when it is working :D

from max
#29
06/26/2009 (9:30 am)
To get this to work in 1.8.1 you need to copy the files in the octahedron folder in common/data/shapes/octahedron to scriptsAndAssets/data/shapes/octahedron
#30
06/26/2009 (8:21 pm)
Hi all,

For anyone wanting to use this, i am aware that the download link isn't working, so just go through the comments, where you will find a new version i posted, and just copy that into a new file called aimarker.cs and continue with the instructions.

From Max
#31
08/23/2009 (6:56 am)
Is it possible to integrate this resource with Improved AI Guard so that friendly units can attack enemy units?

Thanks.
#32
08/23/2009 (7:08 am)
@Justin: Well because this resource is actually an edit of the Improved AI Guard, they will definatly work together.

To get the friendly units to attack the enemy units is definatly possible, however I don't have time at the mometn to work on it. If you don't need it immediatly, I can have a look at such a system.

If you want to have a go yourself, I can give an idea so as to what you will need to add/change.

From Max
#33
08/26/2009 (1:46 am)
@Justin maybe your wants is the teams implementation, works very well and then you can change the AI code to have to check the teamid before attack.
Page«First 1 2 Next»