I am in a pickle- Invisibility

Author Topic: I am in a pickle- Invisibility  (Read 3933 times)

That would not work. You'd need to do this:

Quote
function forceCloakImage::onFire(%this,%obj,%slot)
{
   %obj.hideNode(ALL);
 Â               schedule($cloaktime,0,"applyCharacterPrefs",%obj.client);
}

And you'll need to do:

Quote
$cloaktime = 10000;
somewhere in the file, too. Outside of any functions. 10000 will make them cloak for 10 seconds, by the way.

I knew about schedule thing, I just didn't know where to put it. Thanks for the clarification Ephi. I noticed you have been helping alot of people lately,  :cookie: for you =D


EDIT: I think I just learned something, (Going to be called a noob, but no one ever told me this...) $ defines variables?

Global variables, yes.

%var is a local variable.
$var is a global variable.

Heh, funny bug, when I become uncloaked, my head stays cloaked... I'm trying to find out why, but if anyone knows please drop a reply by.

New Info: I changed cloaktime from global to local, and now only the head is invisible... Something is wrong with certain variables and getting rid of the head...
« Last Edit: February 07, 2008, 04:18:03 PM by Dr Bling »

I was working of fooly cooly commands, here is a working code. (unhisallnodes was a funtion used in it)
Code: [Select]
function forceCloakImage::onFire(%this,%obj,%slot)
{
%obj.hideNode(ALL);
schedule($cloaktime,0,UnCloak,%Obj.Client);
};
function UnCloak(%Client)
{
%Player = %Client.player;
if (isObject(%Player))
{
%Player.unHideNode("headSkin");
%Player.setNodeColor("headSkin", %client.headColor);
%Player.unHideNode($hat[%client.hat]);
%Player.setNodeColor($hat[%client.hat], %client.hatColor);
if(%Client.hat == 1 && %Client.accent != 0)
{
%Player.unHideNode(visor);
}
else if(%Client.hat == 4 || %Client.hat == 6 || %Client.hat == 7 && %Client.accent != 0)
{
%Player.unHideNode($accent[%client.accent]);
}
%Player.setNodeColor($accent[%client.accent], %client.accentColor);
%Player.unHideNode($chest[%client.chest]);
%Player.setNodeColor($chest[%client.chest], %client.chestColor);
%Player.unHideNode($hip[%client.hip]);
%Player.setNodeColor($hip[%client.hip], %client.hipColor);
%Player.unHideNode($larm[%client.larm]);
%Player.setNodeColor($larm[%client.larm], %client.larmColor);
%Player.unHideNode($lhand[%client.lhand]);
%Player.setNodeColor($lhand[%client.lhand], %client.lhandColor);
%Player.unHideNode($lleg[%client.lleg]);
%Player.setNodeColor($lleg[%client.lleg], %client.llegColor);
%Player.unHideNode($pack[%client.pack]);
%Player.setNodeColor($pack[%client.pack], %client.packColor);
%Player.unHideNode($rarm[%client.rarm]);
%Player.setNodeColor($rarm[%client.rarm], %client.rarmColor);
%Player.unHideNode($rhand[%client.rhand]);
%Player.setNodeColor($rhand[%client.rhand], %client.rhandColor);
%Player.unHideNode($rleg[%client.rleg]);
%Player.setNodeColor($rleg[%client.rleg], %client.rlegColor);
%Player.unHideNode($secondpack[%client.secondpack]);
%Player.setNodeColor($secondpack[%client.secondpack], %client.secondpackColor);
%Player.setFaceName(%client.faceName);
}
}
I was working of fooly cooly commands, here is a working code. (unhidallnodes was a function defined in it, so here is the working code)

Heh, funny bug, when I become uncloaked, my head stays cloaked... I'm trying to find out why, but if anyone knows please drop a reply by.

New Info: I changed cloaktime from global to local, and now only the head is invisible... Something is wrong with certain variables and getting rid of the head...

That's not a bug, you didn't define the local variable.

Also, when you updatePrefs apparently it doesn't unhide the headSkin node.

Thank you laremare for trying, but it ruined the whole weapon =/... I doubt anyone can find a solution.

My solution would have worked fine. Provided you set the variable correctly.

Thank you laremare for trying, but it ruined the whole weapon =/... I doubt anyone can find a solution.
Is the $ variable still a %?


That would be a problem.

Also I know you think its blasphemy but try exec()ing it and see if an error comes up.

The fatal type of error came up, the one with buffer and it shuts down blockland :cookieMonster:

Something tells me that Ephi is right, I just screwed it up

Is this right?
Code: [Select]
function forceCloakImage::onFire(%this,%obj,%slot)
{
   %obj.hideNode(ALL);
                schedule($cloaktime,0,"applyCharacterPrefs",%obj.client);
}

$cloaktime = 10000;

That would work I think.

The head stays invisible when I uncloak though. Surely theres a reason...

Would it be possible to just do an unHideNode("headSkin");?

Thats what Larmere's is supposed to do, but his doesn't  unhide anything