Nice! I hadn't thought about that! I guess it would be a commonly used persona situation.
I tried other persona situations with this code, but only
voice - death scream seems to work. I wonder if there's a flag or something somewhere that allows it to play while a character's dead which the other persona situations don't have.
I just went and got shot a lot. This actually resulted in the cops arresting me, which I've never seen before. I assumed it was broken. I didn't hear the
special - player arrested by cop persona play, but that would be even more difficult to do through lua, since there's barely anything related to being arrested/busted in
nclok1405's lua functions list.
I didn't know about difficulty_levels.xtbl. Thanks for that! That would probably be a better way of doing
OHKO...
There is voice_distances.xtbl, which is referenced by persona_situations.xtbl. Modifying that might fix low NPC volumes.
I don't think just calling an NPC by it's name would work. For mission scripts, the character variable (eg: "CHARACTER_GAT") refers to the human in that mission's .cts file (eg: "tss03_$gat"), which uses the NPC model (eg: "npc_gat"). Either way, it would be a lot for the game to process for every NPC.
I've replaced the 10 second delay with a "repeat until" loop (which is how the
delay() function works in system_lib.lua):
Code:
local function player_death_scream_play(player)
while (character_is_dead(player)) do
audio_play_persona_line(player, persona_situation)
repeat
thread_yield()
until (not character_is_dead(player))
end
end
I've made versions which merge with GotR, Sandbox+ and Sandbox++.
I'll upload everything now... Uploaded!