Home › Forums › General Discussion › Having a Better Friend
Tagged: Friend follows and attacks enemy
| Author | Posts |
|---|---|
| Author | Posts |
| July 13, 2012 at 3:56 am #2597 | |
| gholmes | How Can I make my character friend not only follow me around, but attach enemies as well? |
| July 13, 2012 at 7:38 pm #2600 | |
| gholmes | Ok so I was able to get a friend to seek and attack me lol but I need him to follow me but attack the enemy…and also for enemies to attack not just me but my friend(s) as well..whats best way to code that AI? |
| July 16, 2012 at 7:44 pm #2610 | |
| Nat Weiss | You’ll need to code a unique subclass of RPGFriend that seeks the player unless an enemy is near. If an enemy is near, then seek and attack it. Check out the RPGAI subclass. You’ll need to override at least the walk method and maybe the update method too. |
| July 24, 2012 at 6:57 am #2638 | |
| gholmes | Hey Nat so i put this code for a character in the friend code and it works..well the friend attacks me and flees from time to time..lol so how do I edit the self getPlayer to make it attack an enemy? I need to change that getPlayer to something else correct -(void) walk // attack the player // move @end |
| July 26, 2012 at 11:37 pm #2651 | |
| Nat Weiss | Yes. |
You must be logged in to reply to this topic.
