Ok, i have mod the ai_soldier.lua script
function ai_soldier_init(e)
ai_soldier_combatshoot.init(e,ai_combattype_regular)
disp_killtext = 999999
end
function ai_soldier_main(e)
ai_soldier_combatshoot.main(e,ai_combattype_regular,ai_movetype_usespeed,ai_attacktype_canfire)
------pcs mod----
newhelth= g_Entity[e].health
if newhelth < 100 and PlayerLooking(e,7000,2) == 1 then
PromptLocal( e, g_Entity[ e ].health )
end
-------------
end
function ai_soldier_exit(e)
module_combatcore.releasecover(e)
disp_killtext = 1
end
with this mod it works fine i can get Npc health after a hit and prompt it ( even if i am outside the ai view range. see pic below
the problem i have with this mod is when there is an entity between me and the Npc then you still see the
heath prompt, witch i don't want. see pic below
if i add something like this ( if g_Entity[e]['plrvisible'] == 1 ) in the script to stop it from displaying the health prompt when Npc is behind an entity
function ai_soldier_main(e)
ai_soldier_combatshoot.main(e,ai_combattype_regular,ai_movetype_usespeed,ai_attacktype_canfire)
------pcs mod----
newhelth= g_Entity[e].health
if newhelth < 100 and PlayerLooking(e,7000,2) == 1 then
if g_Entity[e]['plrvisible'] == 1 then
PromptLocal( e, g_Entity[ e ].health )
end
end
-------------
end
It works fine, but then it does not display the the health prompt if i am outside the Npc view range meaning then it only display the health prompt if the npc is looking at me not me looking at the Npc
Is there any other command i can use except these two because they don't work
g_Entity[e]['plrvisible'] == 1
GetEntityPlayerVisibility(e) == 1
Thanks for any help.
Pcs
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11