Scripts / Hurt zone that hurts AI instead of player

Author
Message
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 21st Oct 2019 19:46
I was looking at the hurt.lua script and was wondering if it could be used against the AI instead of the player. The healing zone script looked like it was zone based so I thought I could change it around a bit to be an "ai_hurt_zone". Looked at global.lua for help but I am not really sure how to put these things in a script.
I did not expect it to work of course but I wanted to try. After wracking my brain for a few days I thought I would present it to the forum for help. This is what I did. Any help would be appreciated!



PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Oct 2019 20:06 Edited at: 21st Oct 2019 20:10
So the simplest way of doing this would be to use one of the functions from utillib:



This will remove 1 health every second from any AI with 2000 unit radius of the attached entity (or centre of zone).

Unfortunately there is no function to tell when an AI enters a zone though.
Been there, done that, got all the T-Shirts!
PM
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 21st Oct 2019 23:43
Thanks AmenMoses! That is exactly what I wanted! It works perfectly!
PM

Login to post a reply

Server time is: 2024-12-22 09:15:10
Your offset time is: 2024-12-22 09:15:10