OUTDATED!
I still see people trying to use the old X-Ray vision script and bursting into confusion when the game CTD's so I decided to post this
I TAKE NO CREDIT FOR THIS SCRIPT!!!
I can't get colors to work so everything will be marked red. Be patient as the X-ray script coming with Pirate Perfection v13 will at least have colored civilians when it releases.
For people who don't know what to do with this, copy/paste into a text document or Notepad++ if you have it then save it as a .lua and replace it with your old X-Ray .lua
Code:
-- X-RAY VISION v2.0 (post infamy edition)
-- MARKS ENEMIES ONLY
function mark_enemies()
for u_key,u_data in pairs(managers.enemy:all_civilians()) do
--u_data.unit:contour():add( "mark_enemy" )
end
for u_key,u_data in pairs(managers.enemy:all_enemies()) do
u_data.unit:contour():add( "mark_enemy" )
end
for u_key, unit in pairs( managers.groupai:state()._security_cameras ) do
--unit:contour():add( "mark_enemy" )
end
end
function UnitNetworkHandler:mark_enemy( unit, marking_strength, sender )
end
if not _markingToggle then _marktoggle = nil _markingToggle = true
else _markingToggle = nil
end
if not _gameUpdate then _gameUpdate = GameSetup.update
end
do
local _gameUpdateLastMark
function GameSetup:update( t, dt )
_gameUpdate(self, t, dt)
_gameUpdateLastMark = t
if _markingToggle then
mark_enemies()
else
if not _marktoggle then
_marktoggle = true
for u_key,u_data in pairs(managers.enemy:all_enemies()) do
u_data.unit:contour():remove( "mark_enemy" )
end
end
end
end
end