Scripts / trigger on npc death

Author
Message
Elmachtige
9
Years of Service
User Offline
Joined: 10th Jul 2015
Location:
Posted: 12th Jul 2015 12:16
hello,

i am looking for a trigger on npc death and tried to make it.
i am not a script wizard but here is what i got.

function ai_soldier_exit(e)
PlayCharacterSound(e,"onDeath")
ActivateIfUsed(e)
end

some help would be great!
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Jul 2015 19:55
trigger for what? you're going to need to be a lot more specific
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Elmachtige
9
Years of Service
User Offline
Joined: 10th Jul 2015
Location:
Posted: 13th Jul 2015 00:03
shoot badguy, badguy dies, something gets triggered, eg:door opens
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Jul 2015 13:50
that's the issue, there is no general trigger right now...
you can Spawn something like a key from his corpse using spawn at start = no on the entity to get spawned when he dies and just copy it's name into the ifused field of the bad guy


but to open a door automatically requires specific code.
you could use

something like this in the exit(e) part of the ai script


then use a script on the door like this




life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Elmachtige
9
Years of Service
User Offline
Joined: 10th Jul 2015
Location:
Posted: 14th Jul 2015 12:55
thank you, ill give it a try

Login to post a reply

Server time is: 2024-12-21 18:56:20
Your offset time is: 2024-12-21 18:56:20