View Single Post
Old 05-25-2008, 10:14 AM   #2
DeeperThought

DeeperThought's Avatar
Re: Best way to do friendly AIs?
For targetting you could use findnearactor directed at the target tile number, but there are two problems with that: 1) It will find dead bodies, which you don't want to be shooting at, 2) it only finds a specific tile number, which is bad if there are several different units on each side. So what you do is you make everyone spawn a special invisible target sprite. The special sprite sticks to the actor which spawned it like glue, and it dies when its owner dies. Then other actors look for the target sprite to set a target (and they can get its owner if they need to know about who spawned it). You can make different picnums of target sprites for the different sides in the war, so depending on which side an actor is on it only looks for a certain type of target sprite.
__________________
DUKE PLUS
New map effects and various optional extras for Duke 3D.

DUKE NUKEM: ATTRITION
XP based weapon upgrades, progressive difficulty, and more.
DeeperThought is offline