Game Development Community

AI Players

by Image College of Art & Tech (#00 · in General Discussion · 05/19/2008 (3:10 am) · 3 replies

In the default game "Starter.fps" , AI Player is not shooting .
How can i make the AI Player to shoot at player ?

#1
05/19/2008 (5:31 am)
Although this doesn't specifically answer your question, here's a little something that should get you started in the right direction.

%client.player.setname("dirk");  // SA - sets the name of the client player to 'dirk' for fun and aiming
 %bobpos = "399.412 299.768 320.391";  // SA - assigns a starting position for the new AI unit 'bob'
 bob.kill();  // SA - kills any old instance of bob that might still exist in world
 new AIPlayer(Bob) { datablock = "PlayerBody"; position = %bobpos; };  // SA - creates a new AI Player 'bob'
 bob.mountImage(crossbowImage, 0);  // SA - mounts the crossbow weapon image on node 0 of bob
 bob.incInventory(crossbowAmmo, 5);  // SA - increases bob's crossbow ammo by adding five bolts
 bob.setAimObject("dirk", "0 0 1");  // SA - instructs bob to constantly aim at Dirk
 bob.setImageTrigger(0,1);  // SA - instructs bob to keep firing the weapon that is mounted on node 0

Good luck. Have fun.
#2
12/11/2010 (2:01 am)
What file is that in? It might help me out in my project! Thanks in advance.
#3
12/11/2010 (2:35 am)
Look at the info in TDN, that's support/documentation/find the TDN link, then login. Look under the TGE section. Also search for ai or aiplayer.