Page 1 of 1

[SOLVED] Thing_Deactivate won't work online?

Posted: Wed Nov 05, 2014 5:06 am
by Riclo
I have a light-switch that is supposed to activate and deactivate a dynamic light when turned on and off.

Code: Select all

Script 1 OPEN 
{
Thing_Deactivate(181); //This deactivates the dynamic light upon start, since all the lights are initially turned off.
}

Script 11 (void) 
{
Light_Changetovalue(177,128);
Light_Changetovalue(179,220);
Activatorsound("Lighton",220);
Setlinetexture(178,SIDE_FRONT,TEXTURE_BOTTOM,"liteswib");
Setlinetexture(180,SIDE_FRONT,TEXTURE_MIDDLE,"litebeam");
Setlinetexture(180,SIDE_BACK,TEXTURE_MIDDLE,"litebeam");
Thing_Activate(181);
Delay(10);
Suspend;
Light_Changetovalue(177,64);
Light_Changetovalue(179,64);
Activatorsound("Lightoff",220);
Setlinetexture(178,SIDE_FRONT,TEXTURE_BOTTOM,"liteswia");
Setlinetexture(180,SIDE_FRONT,TEXTURE_MIDDLE,"-");
Setlinetexture(180,SIDE_BACK,TEXTURE_MIDDLE,"-");
Thing_Deactivate(181);
Delay(10);
}
181 is the tag of the Dynamic light. It works perfectly fine offline, but when played online the Dynamic light is already activated upon start and cannot be deactivated. Is there anyway to fix this? Thanks in advance.

Edit:
Adding Clientside to both scripts and having a small delay before the dynamic light seems to have solved the problem.

[spoiler]

Code: Select all

Script 1 OPEN Clientside
{
Delay(1);
Thing_Deactivate(181); 
}

Script 11 (void) Clientside
{
Light_Changetovalue(177,128);
Light_Changetovalue(179,220);
Activatorsound("Lighton",220);
Setlinetexture(178,SIDE_FRONT,TEXTURE_BOTTOM,"liteswib");
Setlinetexture(180,SIDE_FRONT,TEXTURE_MIDDLE,"litebeam");
Setlinetexture(180,SIDE_BACK,TEXTURE_MIDDLE,"litebeam");
Delay(1);
Thing_Activate(181);
Delay(10);
Suspend;
Light_Changetovalue(177,64);
Light_Changetovalue(179,64);
Activatorsound("Lightoff",220);
Setlinetexture(178,SIDE_FRONT,TEXTURE_BOTTOM,"liteswia");
Setlinetexture(180,SIDE_FRONT,TEXTURE_MIDDLE,"-");
Setlinetexture(180,SIDE_BACK,TEXTURE_MIDDLE,"-");
Delay(1);
Thing_Deactivate(181);
Delay(10);
}
[/spoiler]

RE: Thing_Deactivate won't work online?

Posted: Wed Nov 05, 2014 6:32 am
by fr blood
There is a lot of problems that happen online and not offline, maybe you could add Delay in the Script 1, and if it still doesn't work you can turn off the light by using SetActorProperty too, hopping this will help.