Jump to content

Recommended Posts

Hi.

I'm trying to make a light selection for my driver on my new UGV.
I would like to have an option to turn on/off a spotlight and turn on/off the driving light.

But it ain't working, I can only turn off/on the drive light? 
 

 

        class AnimationSources: AnimationSources
        {

            class DriveLight
            {
                source="light";
                animPeriod=1;
                initPhase=0;
                selection="left";
                useSource=1;
            };    

            class SpotLight
            {
                source="light";
                animPeriod=1;
                initPhase=0;
                selection="Right";
                useSource=1;
            };  

        };

 


       class UserActions
        {
 

            class drive_LightOn
            {
            
                displayName             = "Drive Light On";
                displayNameDefault         = "";
                radius=2;
                position="PiP1_pos";
                onlyForplayer            = false;
                condition            = "alive this && (!(isLightOn this))";
                statement            = "this setPilotLight true;";            };
    

            class drive_LightOff: drive_LightOn
            {
                
                displayName             = "Drive Light";
                position="";
                radius=2;
                condition            = "alive this &&  isLightOn this";
                statement            = "this setPilotLight false;";   
            };

 

            class spot_LightOn
            {
            
                displayName             = "Drive Light On";
                displayNameDefault         = "";
                radius=2;
                position="PiP1_pos";
                onlyForplayer            = false;
                condition            = "alive this && (!(isLightOn this))";
                statement            = "this animate [""SpotLight"", 1];";
    

            class spot_LightOff: drive_LightOn
            {
                
                displayName             = "Drive Light";
                position="";
                radius=2;
                condition            = "alive this &&  isLightOn this";
                statement            = "this animate [""SpotLight"", 0];"; 
            };


};

 

 

 

        class Reflectors {


            class Left {
                color[] = {1900, 1800, 1700};
                ambient[] = {5, 5, 5};
                position = "Light_L";
                direction = "Light_L_end";
                hitpoint = "Light_L";
                selection = "Light_L";
                size = 1;
                innerAngle = 100;
                outerAngle = 179;
                coneFadeCoef = 10;
                intensity = 1;
                useFlare = 1;
                dayLight = 1;
                flareSize = 1.000000;

                class Attenuation {
                    start = 1.000000;
                    constant = 0;
                    linear = 0;
                    quadratic = 0.250000;
                    hardLimitStart = 30;
                    hardLimitEnd = 60;
                };
            };

            class Right: Left {
                color[] = {1900, 1800, 1700};
                ambient[] = {5, 5, 5};
                position = "Light_R";
                direction = "Light_R_end";
                hitpoint = "Light_R";
                selection = "Light_R";
                size = 1;
                innerAngle = 100;
                outerAngle = 179;
                coneFadeCoef = 10;
                intensity = 1;
                useFlare = 1;
                dayLight = 1;
                flareSize = 1.000000;

                class Attenuation {
                    start = 1.000000;
                    constant = 0;
                    linear = 0;
                    quadratic = 0.250000;
                    hardLimitStart = 30;
                    hardLimitEnd = 60;
                };
            };
        };
        aggregateReflectors[] = {"DriveLight", "SpotLight"};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×