Game Development Community

Adding more and different bots and characters

by Sventhors · in Technical Issues · 10/11/2005 (2:08 pm) · 14 replies

I was looking at the 3d programming book. How do you add two characters to the game. Like he has one Avtar(human) and monster(kork) in the game. I look at cs code for it and tried to find any exec blocks that would activiate differebt folders and could not find any. Is there any tutorials or threads that talk about adding different characters? ThanX.

#1
11/06/2005 (7:23 am)
Can this be done or can someone lead me to a thread that talks about this or a Tutorial.
#2
11/06/2005 (9:10 am)
Which book are you refering to? The Advanced 3D Game Programming by Ken Finney covers AI and much more. Also check Mark Holcomb's excellent ressources (enter ' Mark Holcomb' in the search function to the left).
#3
11/06/2005 (9:19 am)
Thanks for the response. Advanced 3D Game Programming is the on Im refereing to. In his chapter seven and six he has Kork the monster and Avtar(human running around) in his sample. I dont think he covers how to put to different characters in the game. I know how to mutiple bots but not different looking ones. I have tried Mark Holcomb tutorial but that is the same character.

For example how do I out the geen dude from the tutorial.base as a path finding bot and have Kork be the avtar.
#4
11/07/2005 (1:14 am)
Each character will run from a "PlayerBody", the playerbody stuff is located in the player.cs file, there you can change the shapeName ect. In Mark's tutorials they use the default player body, if you want the badguys to use a different body then create a new playerbody (just copy the code from player.cs) and change the name to something like botbody. Change the shapefile to your bot shape and boom, your ready to rock (of course it will take some wrenching, but you will get it eventualy).
#5
11/07/2005 (12:20 pm)
This is one way to do it:

- copy \tutorial.base\data\shapes\player folder to \starter.fps\data\shapes\greeny
- copy all dsq files from the player folder into the greeny folder


- now
in server/scripts/player.cs copy the
datablock PlayerData(PlayerBody)
and turn the copy into
datablock PlayerData(GreenyBody)

in this copy change this line
shapeFile = "~/data/shapes/player/player.dts";
to
shapeFile = "~/data/shapes/greeny/player.dts";


- now copy player.cs from the player folder to the greeny folder

in greeny/player.cs change
datablock TSShapeConstructor(PlayerDts)
to
datablock TSShapeConstructor(GreenyDts)



- now in server/scripts/player.cs add
exec("~/data/shapes/greeny/player.cs");
under
exec("~/data/shapes/player/player.cs");

- now go to server/scripts/aiPlayer.cs
and change the line
datablock PlayerData(DemoPlayer : PlayerBody)
to
datablock PlayerData(DemoPlayer : GreenyBody)


Now Kork becomes a Greeny, while the player still is an Orc.
#6
11/07/2005 (1:59 pm)
Thanks you rock. It work. I have been trying this for month and I understand it know. Thanks. I will try know to add different path running bots. Probably be back in month and ask another question or post it here if I fiqure it out. Thanks. You Rock and Skoal(swedish for cheers):)
#7
04/21/2006 (9:13 pm)
Perfect resource, just what i was looking for! thanks for posting
#8
08/25/2006 (5:26 pm)
I have done everything like in the post above and it worked fine.

Can anyone tell me how to carry this one step further? I want to make several different npc's that walk on different paths. Im staring with a rabbit first.I copied the a.i script and changed the

datablock PlayerData(DemoPlayer : GreenyBody)


datablock PlayerData(DemoPlayer1 : rabbitBody)

I tried PlayerData(DemoPlayer : rabbitBody) but that did not work either.


I have both scripts in the aiplayer.cs

But now when I run I don't see either greeny or rabbit. But at least it does not crash.
#9
08/25/2006 (7:49 pm)
Cheers Gordon,
Im still workig on this still as Im learning torque scripting. hehe.
(Bruno Grieco on garagegames) have given me some ideas how to do it(Im still trying:(). Trying searching for his post. He has a lot of AI posts and looks like he knows how to do it.

Heres link from him.
http://www.garagegames.com/mg/forums/result.thread.php?qt=41082
#10
08/25/2006 (10:38 pm)
You need to do the datablock like this in player.cs in sever/scripts. This will copy the datablock PlayerData(DemoPlayer : PlayerBody).

datablock PlayerData (GreenyPlayer : PlayerBody)
{
shapeFile = "~/data/shapes/players/greeny/greeny.dts";
};

After these lines (around 670 line)
maxInv[Rifle] = 1;
};

Now open Aiplayer.cs in server/scripts

Change this line
datablock PlayerData(DemoPlayer : PlayerBody)

to

datablock PlayerData(GreenyPlayer : PlayerBody)

Now the greeny guy from tutorial base should be the aiPlayer, dont forget to create a folder name greeny and copy the files from tutorial base.
#11
08/26/2006 (9:50 am)
Ok thanks Sventhors Ill check out that link.

Thanks for the reply Michael.
#12
08/30/2006 (9:41 pm)
Thanks for the info. This really helped.
#13
11/21/2006 (11:53 pm)
I posted an update to my super compressed solution.

www.garagegames.com/mg/forums/result.thread.php?qt=53717
#14
02/20/2007 (3:54 pm)
I have followed the directions. The only problem I am having is that there are no animations. He just scoots across the terrain. My player character has all its animations. Any thoughts?

***I posted to quickly. I was at a stopping point and for some reason it did not click with me to exec the player.cs inside the player.cs. I thought it was referring to the game.cs. Anywho.....It clicked when I read the link posted above for some advanced options. I got it working now. Thanks.