OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Smoshy on 27 Jul 2004, 06:01:38

Title: Lights off
Post by: Smoshy on 27 Jul 2004, 06:01:38
I have an empty anti tank gun crewed by a gunner and commander. I want my mission to take place in the dark but the gun light is always on. I've tried to turn it off by having

gun1 switchlight "off"  in the init field but this just gives me a CTD.

Am I on the right track? Is there a better way to do this?

Thanks in advance.
Title: Re:Lights off
Post by: j-man on 27 Jul 2004, 08:31:27
use something like:

Code: [Select]
gun1 setBehaviour "STEALTH"
Title: Re:Lights off
Post by: Smoshy on 27 Jul 2004, 09:50:51
No dice I'm afraid  ???
Title: Re:Lights off
Post by: macguba on 27 Jul 2004, 09:57:00
It took the community years how to figure out how to turn off the light on the M2 machine gun:   the answer was a fast loop commanding

gun1 action ["lightoff"]

or something.    Search the forum.   It might be in the action thread sticky at the top of this board, check the last couple of posts.
Title: Re:Lights off
Post by: Captain Courageous on 27 Jul 2004, 11:28:09
What AT Gun is it (I'm guessing it's an addon)? And doesn't it work if you put it on 'Aware', 'Combat' or 'Stealth' modes?
Title: Re:Lights off
Post by: DBR_ONIX on 27 Jul 2004, 14:10:25
Make a sript, lightoff.sqs
Code: [Select]
_unit = driver this select 0
_veh = this select 0
#loop
_unit action ["light off",_veh]
~0.1
GOTO "loop"

And call it with this in it's INIT field ::
[this] exec "lightoff.sqs"

That should work..
If it strobes, lower the ~0.1 to something like ) 0.01
Don't remove it or it crashes the game ::)
- Ben
Title: Re:Lights off
Post by: Tomb on 27 Jul 2004, 17:09:18
I know this might blow yer top if you're not into O2 stuff but the best way is to
leave out the "svetlo" crap (the projector/headlights of vehicles) when tweaking/creating an addon. :)

 :D or try the following little trick, matey :thumbsup:

goto the config.cpp of the weapon and look for stuff like this:


class Reflectors
{
       class Reflector
       {
        color[]={0.900000,0.800000,0.800000,1.000000};
        ambient[]={0.100000,0.100000,0.100000,1.000000};
        position="svetlo";
        direction="konec svetla";
        hitpoint="svetlo";
        selection="svetlo";
        size=0.200000;
        brightness=0.001000;
        };
};


======================

 ;) now, I cant remember what num code is black/dark grey but fiddle with it, m8
ya need to alter the color & the brightness.... you can see color codes by using MS PAINT.
there ya can use a color & then see its code (in numbers)  :-*

hope it solves yer probby there, m8
Title: Re:Lights off
Post by: Smoshy on 28 Jul 2004, 02:34:49
Just a quick question. Is the name to replace "_veh" in the script the name of the addon itself?