Author Topic: vignette and droping problems (SOLVED)  (Read 1909 times)

im having trouble with getting the vignette to reset back to the environment settings after changing it, could someone tell me what im doing wrong here:
Code: [Select]
//scope
function Armor::onTrigger(%this,%obj,%slot,%val)
{
%CurrentlymountedImage = %obj.getMountedImage(0);

if(%slot == 4 && %val && $UseScope != 1 && isObject(%obj.getMountedImage(0)) && %obj.getMountedImage(0).item.ScopedFOV > 0)
{
if(%obj.getMountedImage(0) == %CurrentlymountedImage.item.ImagemainState.getID())
{
%obj.updateArm(%obj.getMountedImage(0).item.ImageScopeState,0);
%obj.mountImage(%obj.getMountedImage(0).item.ImageScopeState,0);
%obj.client.setControlCameraFOV(%obj.getMountedImage(0).item.ScopedFOV);
if($SetVignette != 1)
{
commandToClient(%obj.client, 'SetVignette', false,"0 0 0 1");
}
}
else if(%obj.getMountedImage(0) == %CurrentlymountedImage.item.ImageScopeState.getID())
{
%obj.updateArm(%obj.getMountedImage(0).item.ImageMainState,0);
%obj.mountImage(%obj.getMountedImage(0).item.ImageMainState,0);
%obj.client.setControlCameraFOV(90);
if($SetVignette != 1)
{
commandToClient( %obj.client, 'SetVignette', $EnvGuiServer::VignetteMultiply, $EnvGuiServer::VignetteColor );
}
}
return;
}
Parent::onTrigger(%this,%obj,%slot,%val);
}

specifically this line:

Code: [Select]
commandToClient( %obj.client, 'SetVignette', $EnvGuiServer::VignetteMultiply, $EnvGuiServer::VignetteColor );
the console returns something like (, ) is not a color...


ALSO:

when i drop my weapons they don't disappear from your hand, (it will is your close and reopen your inventory) this happens when the weapon is in its out of ammo state... (perhaps others too, still need to test that)


ALL ISSUES FIXED NOW!, SOLUTIONS:

vignette:
Code: [Select]
//scope
function Armor::onTrigger(%this,%obj,%slot,%val)
{
%CurrentlymountedImage = %obj.getMountedImage(0);

if($Sky::VignetteColor !$= "")
{
%obj.vignetteColor = $Sky::VignetteColor;
}
else
{
%obj.vignetteColor = "0 0 0 0";
}

if(%slot == 4 && %val && $UseScope != 1 && isObject(%obj.getMountedImage(0)) && %obj.getMountedImage(0).item.ScopedFOV > 0)
{
if(%obj.getMountedImage(0) == %CurrentlymountedImage.item.ImagemainState.getID())
{
%obj.updateArm(%obj.getMountedImage(0).item.ImageScopeState,0);
%obj.mountImage(%obj.getMountedImage(0).item.ImageScopeState,0);
%obj.client.setControlCameraFOV(%obj.getMountedImage(0).item.ScopedFOV);
if($SetVignette != 1)
{
commandToClient(%obj.client, 'SetVignette', false,"0 0 0 1");
}
}
else if(%obj.getMountedImage(0) == %CurrentlymountedImage.item.ImageScopeState.getID())
{
%obj.updateArm(%obj.getMountedImage(0).item.ImageMainState,0);
%obj.mountImage(%obj.getMountedImage(0).item.ImageMainState,0);
%obj.client.setControlCameraFOV(90);
if($SetVignette != 1)
{
commandToClient( %obj.client, 'SetVignette', $EnvGuiServer::VignetteMultiply, %obj.VignetteColor );
}
}
return;
}
Parent::onTrigger(%this,%obj,%slot,%val);
}

(btw, im using %obj.vignetteColor now so i don't need to redefine %vignetteColor for every weapon's unmount debug scripts)

droping issues:
Code: [Select]
//drop debug
function serverCmddropTool(%client, %slot)
{
%player = %client.player;
if(isObject(%player))
{
%client.player.unMountImage(0);
parent::serverCmddropTool(%client, %Slot);
}
}


both of witch are packaged accordingly of course...
« Last Edit: August 13, 2014, 01:27:08 AM by zombekillz »

I'm guessing $EnvGuiServer::VignetteColor is blank.

I'm guessing $EnvGuiServer::VignetteColor is blank.

is it blank by default?

even so, it still has the same error when i do enable a different vignette...

The error was only coming up for me when the values were blank.

I've also want to know how to get the servers vignette other than packaging it if needed.

that's odd, how exactly did you get the values to fill in? did you just change the vignette color in the gui or am i making some stupid mistake?

that's odd, how exactly did you get the values to fill in? did you just change the vignette color in the gui or am i making some stupid mistake?
I was just typing my own values. I imagine multiply is a single int, and color is a R G B A value.

I've also want to know how to get the servers vignette other than packaging it if needed.

$Sky::VignetteColor = "0.000000 0.000000 0.000000 0.392157";
$Sky::VignetteMultiply = "0";

Almost as I expected. Color is R G B A, but multiply is a bool (1 or 0)

oops, i re-tested that...

it appears that the error will not repeat if the values are present, but the vignette wont change back to default either.
« Last Edit: August 11, 2014, 11:08:24 PM by zombekillz »

What does VignetteMultiply actually do?

What does VignetteMultiply actually do?

i think it makes it so the entire screen changes color along with the vignette, someone correct me if im wrong.

Fixed the vignette thing :D

Code: [Select]
//scope
function Armor::onTrigger(%this,%obj,%slot,%val)
{
%CurrentlymountedImage = %obj.getMountedImage(0);
%VignetteColor = $EnvGuiServer::VignetteColor;

if(%slot == 4 && %val && $UseScope != 1 && isObject(%obj.getMountedImage(0)) && %obj.getMountedImage(0).item.ScopedFOV > 0)
{
if(%obj.getMountedImage(0) == %CurrentlymountedImage.item.ImagemainState.getID())
{
%obj.updateArm(%obj.getMountedImage(0).item.ImageScopeState,0);
%obj.mountImage(%obj.getMountedImage(0).item.ImageScopeState,0);
%obj.client.setControlCameraFOV(%obj.getMountedImage(0).item.ScopedFOV);
if($SetVignette != 1)
{
commandToClient(%obj.client, 'SetVignette', false,"0 0 0 1");
}
}
else if(%obj.getMountedImage(0) == %CurrentlymountedImage.item.ImageScopeState.getID())
{
%obj.updateArm(%obj.getMountedImage(0).item.ImageMainState,0);
%obj.mountImage(%obj.getMountedImage(0).item.ImageMainState,0);
%obj.client.setControlCameraFOV(90);
if($SetVignette != 1)
{
commandToClient( %obj.client, 'SetVignette', $EnvGuiServer::VignetteMultiply, %VignetteColor );
}
}
return;
}
Parent::onTrigger(%this,%obj,%slot,%val);
}

had to use a weird workaround, but hey, it works...

EDIT: is there any way to workaround the console spam?
« Last Edit: August 12, 2014, 08:30:46 AM by zombekillz »

What console spam are you getting?

oh, just the same (, ) is not a color when the vignette color variable is not present

Edit: fixed it kinda...

Code: [Select]
if($EnvGuiServer::VignetteColor != "")
{
%VignetteColor = $EnvGuiServer::VignetteColor;
}
if($EnvGuiServer::VignetteColor == "")
{
%VignetteColor = "0 0 0 0";
}

although it cant recognize the A value of RGBA so if the vignette is set to "0 0 0 25" (or whatever) it will still default to "0 0 0 0"
« Last Edit: August 12, 2014, 09:47:10 AM by zombekillz »

Just do this:
Code: [Select]
if($Sky::VignetteColor !$= "")
%vignetteColor = $Sky::VignetteColor;
else
%vignetteColor = "0 0 0 0";


Pretty sure you should be using $Sky:: and not $EnvGuiServer::