PDA

View Full Version : how to mod heatvision without noise



XeonZorro
07-23-2004, 10:55 AM
How to mod heatvision without noise!

XeonZorro
07-23-2004, 10:55 AM
How to mod heatvision without noise!

Noar68
07-23-2004, 11:07 AM
Very simple, I made some minor changes - took out ambientcolor changes.

<pre class="ip-ubbcode-code-pre">
function Mission:Event_HeatVisionOn()
HeatVision.IsActive=1;

-- get all entities near by and set cryvision effect on them
if(_localplayer) then
local tblPlayers = { };

if(_localplayer.type=="Player" and _localplayer:GetPos()) then
local LocalPlayerPos=_localplayer:GetPos();
Game:GetPlayerEntitiesInRadius(LocalPlayerPos, 999999, tblPlayers, 1);
else
-- invalid player position? hack it..
local LocalPlayerPos={ x=0, y=0, z=0};
Game:GetPlayerEntitiesInRadius(LocalPlayerPos, 999999, tblPlayers, 1);
end

if(tblPlayers and type(tblPlayers)=="table") then
for i, player in tblPlayers do
if(tblPlayers[i].pEntity and tblPlayers[i].pEntity.iPlayerEffect) then
tblPlayers[i].pEntity.bPlayerHeatMask=1;
BasicPlayer.ProcessPlayerEffects(tblPlayers[i].pEntity);
end
end
end
end

-- Sound:PlaySound( self.ActivateSnd );
System:SetScreenFx("NightVision", 1);

self.PrevAmbientColor=new(System:GetWorldColor());
local CurrAmbientColor=new(self.PrevAmbientColor);
-- CurrAmbientColor[1]=CurrAmbientColor[1]+1.0;
-- CurrAmbientColor[2]=CurrAmbientColor[2]+1.0;
-- CurrAmbientColor[3]=CurrAmbientColor[3]+1.0;
System:SetWorldColor(CurrAmbientColor);
end

function Mission:Event_HeatVisionOff()
HeatVision.IsActive=0;
-- get all entities near by and reset current effect on them (cryvision)
if(_localplayer) then
local tblPlayers = { };

if(_localplayer.type=="Player" and _localplayer:GetPos()) then
local LocalPlayerPos=_localplayer:GetPos();
Game:GetPlayerEntitiesInRadius(LocalPlayerPos, 999999, tblPlayers, 1);
else
-- invalid player position? hack it..
local LocalPlayerPos={ x=0, y=0, z=0};
Game:GetPlayerEntitiesInRadius(LocalPlayerPos, 999999, tblPlayers, 1);
end

if(tblPlayers and type(tblPlayers)=="table") then
for i, player in tblPlayers do
if(tblPlayers[i].pEntity and tblPlayers[i].pEntity.iPlayerEffect) then
tblPlayers[i].pEntity.bPlayerHeatMask=2;
BasicPlayer.ProcessPlayerEffects(tblPlayers[i].pEntity);
end
end
end
end

System:SetScreenFx("NightVision", 0);
-- Sound:StopSound( self.ActivateSnd );
System:SetWorldColor(self.PrevAmbientColor);
end
</pre>

XeonZorro
07-23-2004, 12:01 PM
Thanks very much!