AI Deathregions

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

AI Deathregions

Post by jangoisbaddest »

Alright, I set up these regions on my map where I want AI dead if they stray into them. They don't seem to be working at all. I double-checked that the regions were in the correct layer, etc. My code in the LUA:

ActivateRegion("ai1")

OnEnterRegion(
function(regIn, character)
if not IsCharacterHuman(character) then
KillObject(character)
end
end,
"ai1"
)

Why isn't this working? Everything looks to be without errors and typos to me. Or...is there a simpler way to set up a region that only kills AI and not humans?
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: AI Deathregions

Post by Fiodis »

Not sure if it would do anything, but try moving the ActivateRegion line after the rest of the code. If I remember correctly, that was how you activated the regions for a teleporter. Might be the same here.
Post Reply