How do I make an enemy?
by Matt Vitelli · in Torque Game Engine · 11/05/2004 (7:44 pm) · 18 replies
#2
*Quoted from a post by Pascal Retting that I found useful when I first dabbled with AI in TGE:
Load up the demo and the fps example.
Some things to try at one line at a time on the console: (BTW: bring it up with ~)
11/05/2004 (8:06 pm)
I posted this over here but it seems relevant in this thread also:*Quoted from a post by Pascal Retting that I found useful when I first dabbled with AI in TGE:
Load up the demo and the fps example.
Some things to try at one line at a time on the console: (BTW: bring it up with ~)
// press F8 to drop the camera at the player, then fly around somewhere above the ter
rain
// and put the following command all on one line to drop in a player
new AIPlayer(bob) { datablock="LightMaleHumanArmor"; position=localclientconnection.c
amera.getPosition(); };
// fly a little distance away and do the following:
bob.setMoveDestination(localclientconnection.camera.getTransform());
// repeat the above a couple time to give bob a workout
// make bob temporarily invisible:
bob.setCloaked(1);
// bring him back:
bob.setCloaked(0);
// fly around to get a goood look at bob and give then give him a crossbow:
bob.mountImage(CrossBowImage,0);
// load him up with some ammo
bob.incInventory(CrossbowAmmo,5);
// now fly around to another location near bob and create dirk:
new AIPlayer(dirk) { datablock="LightMaleHumanArmor"; position=localclientconnection.
camera.getPosition(); };
// aim bob at dirk
bob.setAimObject(dirk);
// fire away!
bob.setImageTrigger(0,1);
// if you want bob to aim higher (he's probably shooting at dirk's feet) try this:
bob.setAimLocation(VectorAdd(dirk.getPosition(),"0 0 1"));
// you may need to give him more ammo:
// (his trigger image is still 1 so he should fire right away)
bob.incInventory(CrossbowAmmo,5);
// bob's done enough harm, take him out
bob.kill();
#3
bob.setMoveDestination(localclientconnection.camera.getTransform());
doesn't work, but doesn't throw an error either. Any ideas why Bob won't move?
11/07/2004 (6:41 am)
Since my name is Dirk I thought I'd try this out. I found out that the commandbob.setMoveDestination(localclientconnection.camera.getTransform());
doesn't work, but doesn't throw an error either. Any ideas why Bob won't move?
#5
11/07/2004 (7:49 am)
Anyway, why would u do that? isnt this a server script?
#6
11/07/2004 (8:04 am)
Well, I don't know - I am just following the instructions above. I was expecting that Bob would move into the players direction, but everytime I give the command above, Bob just turns into opposite directions, no matter where the player stands.
#7
11/07/2004 (8:39 am)
Hehehehe Matt if this is hard then I don't know :) You can write a script, and paste the contents from above into the scripts and execute it. If you're running the server locally, then you might be able to do it with the command line as well, yeah.
#8
11/07/2004 (9:32 am)
Matt, then maybe you should reconsider what you're doing :)
#9
11/07/2004 (9:33 am)
Well, this is as good of time as any to start learning.
#10
11/07/2004 (10:07 am)
Honestly, one of the best computer related topics to start learning at a young age is programming. Just take small steps and don't overwhelm yourself.
#11
I hope someone can help me, thanks.
12/08/2004 (7:39 pm)
Hi, I was trying the code and I couldn't get it to work, am using the latest sdk(the one with the installer) on the starter.fps and I get an error on new AIPlayer(bob) { datablock="LightMaleHumanArmor"; position=localclientconnection.camera.getPosition(); }; saying that Object 'LightMaleHumanArmor' is not a member of the 'GameBaseData' data block class.I hope someone can help me, thanks.
#12
12/09/2004 (1:11 am)
Wow! he's 13 and starting Im 43 and just starting. It would be intresting to see which way things turn out.
#13
I think he is well ahead of the game.. at that age the brain is still growing and is basicly a sponge absorbing any and everything it can. After the teens and early twenties learning becomes more combuersome and more of a challenege.
-Ron
12/09/2004 (2:49 am)
Bryan,I think he is well ahead of the game.. at that age the brain is still growing and is basicly a sponge absorbing any and everything it can. After the teens and early twenties learning becomes more combuersome and more of a challenege.
-Ron
#14
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5162
12/09/2004 (12:37 pm)
I wish I could help, but we're the same age and I got torque a few months ago.http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5162
#15
He will no doubt excell,but it will take more than youth to stick to the demands that go along with this field of intrest.There is truly a need for young people with the capability to stick to it.
Stick to it Matt, make it work.
Thanks Ron.
Bryan
12/10/2004 (12:31 pm)
True Ron,He will no doubt excell,but it will take more than youth to stick to the demands that go along with this field of intrest.There is truly a need for young people with the capability to stick to it.
Stick to it Matt, make it work.
Thanks Ron.
Bryan
#16
"3D Game Programming All in One" by Kenneth C. Finney
It's the closest thing you're going to find to a comprehensive tutorial and guide to using Torque. Read it, play with the examples and I'll quarantee that you'll have a much easier time getting anything done in Torque.
I've got 15+ years of C/C++ behind me ( I code for a living ) and Torque is so HUGE (and cool), I bought the book! I'm sure some of the more experienced Torque users in these forums bought it as well.
If you're looking for some simpler, ('cause building an FPS is not so simple), try GameMaker: http://www.cs.uu.nl/people/markov/gmaker/index.html
It'll do 2D platform and isometric style games. I've actually got a registered copy and it's fun to use.
12/10/2004 (12:47 pm)
Yo, Matt, pony up some $$$ and buy this book:"3D Game Programming All in One" by Kenneth C. Finney
It's the closest thing you're going to find to a comprehensive tutorial and guide to using Torque. Read it, play with the examples and I'll quarantee that you'll have a much easier time getting anything done in Torque.
I've got 15+ years of C/C++ behind me ( I code for a living ) and Torque is so HUGE (and cool), I bought the book! I'm sure some of the more experienced Torque users in these forums bought it as well.
If you're looking for some simpler, ('cause building an FPS is not so simple), try GameMaker: http://www.cs.uu.nl/people/markov/gmaker/index.html
It'll do 2D platform and isometric style games. I've actually got a registered copy and it's fun to use.
#17
12/10/2004 (1:25 pm)
Try just making weapons thats fun and easy (and gets you used to torque) right now I'm waiting for those ai packs I've tried AI but it didn't work to well
#18
12/10/2004 (1:58 pm)
Try just making weapons thats fun and easy (and gets you used to torque) right now I'm waiting for those ai packs I've tried AI but it didn't work to well
Torque 3D Owner Tom Feni
naah look for ai resources.. :)