[SOLVED] Thing_Deactivate won't work online?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Riclo
 
Posts: 26
Joined: Sun Mar 09, 2014 2:14 am

[SOLVED] Thing_Deactivate won't work online?

#1

Post by Riclo » Wed Nov 05, 2014 5:06 am

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]
Last edited by Riclo on Wed Nov 05, 2014 5:38 pm, edited 1 time in total.

User avatar
fr blood
Frequent Poster Miles card holder
Posts: 995
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

RE: Thing_Deactivate won't work online?

#2

Post by fr blood » Wed Nov 05, 2014 6:32 am

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.
Last edited by fr blood on Wed Nov 05, 2014 6:33 am, edited 1 time in total.

Post Reply