Scripts / AI_FANTASY_CHARACTER variation with self defense behavior

Author
Message
Hagermann91
9
Years of Service
User Offline
Joined: 3rd Jun 2015
Location:
Posted: 22nd Aug 2015 11:10
Hello
I wanted my fantasy character to attack only in self defense situation.
So I added a initialAiHealth variable which is initalized with the initial ai health.
The Fantasy Character will attack only if his health is modified down.

if GetPlayerDistance(e)<100 and g_Entity[e]['health'] < initialAIHealth then

PM
Kesstryl
9
Years of Service
User Offline
Joined: 29th Jul 2015
Playing:
Posted: 23rd Aug 2015 00:16
This is really cool for making neutral NPCs that won't hurt the player unless attacked. Nice for populating medieval or fantasy towns. Thank you!
PM
Peri
Game Guru Backer
14
Years of Service
User Offline
Joined: 6th Jan 2010
Location:
Posted: 2nd Sep 2015 19:28
Great!

thanks

Login to post a reply

Server time is: 2024-12-22 05:47:00
Your offset time is: 2024-12-22 05:47:00