Home   Help Search Login Register  

Author Topic: Scripting lights into a model  (Read 2240 times)

0 Members and 1 Guest are viewing this topic.

Offline Absolution

  • Members
  • *
Scripting lights into a model
« on: 23 Jun 2010, 04:44:24 »
Another day... another feature I need help on. I am currently trying to script in some lights into my ship model and my research hasn't born any fruit. Hoping someone here can offer me some insight on how to get them to work.

I have a memory point named "svet1" in my model and the follow script. I don't care what color it is or anything else I just want to get it to show up at this point which it does not. I am attempting to create a volumetric light from a point source... not unlike the lights on an aircraft's wingtip.

Snippet from config:
Code: [Select]
...
class LPD_SEC_AFT : LPD_SEC_BOW { //In this case it inherits from the first object I installed
displayName ="LPD-17 Aft Section"; //name of the object
model = "\MEU_LPD17\LPD_SEC_AFT.p3d"; //path to the binarized model

  class MarkerLights
   {
     class Redblinking
     {
       name="svet1";
       color[]={1.000000, 0.100000, 0.100000, 1};
       ambient[]={1.000000, 0.100000, 0.100000, 1};
       brightness=0.00500;
       blinking=0;
};
};
...

Any ideas?

Offline Gnat

  • Addons Depot
  • Former Staff
  • ****
  • I Bite!
    • Gnats
Re: Scripting lights into a model
« Reply #1 on: 24 Jun 2010, 16:20:27 »
Hi
Markers and lights no longer work on ships in ArmA2
I've reported the bug in the Bug Tracker. You could also add your vote to get it fixed.

Offline Absolution

  • Members
  • *
Re: Scripting lights into a model
« Reply #2 on: 21 Jul 2010, 01:41:25 »
I'm going to assume the bug hasn't been fixed yet. Do the lights still work on static objects such as buildings? My ship is the same as the LHD in that its just that, static.

Assuming, for a moment, that the game engine wasn't bugged am I at least on the right track with my config file above?

Offline Gnat

  • Addons Depot
  • Former Staff
  • ****
  • I Bite!
    • Gnats
Re: Scripting lights into a model
« Reply #3 on: 31 Jul 2010, 05:17:58 »
Static model is ok.
Open the Kuznetsov config to see examples of it working.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Scripting lights into a model
« Reply #4 on: 31 Jul 2010, 20:29:43 »


Quote
My ship is the same as the LHD in that its just that, static.
you have inherited from just Static or exactly like the LHD
Code: [Select]
class Land_LHD_1 : StaticShip ?

 Static class does not inherit any lights so they wont work , Staticship should do though.

Quote
Assuming, for a moment, that the game engine wasn't bugged am I at least on the right track with my config file above?

 Hard to tell without all the config but your markerlight section seems ok

 



I love ofp

Offline Absolution

  • Members
  • *
Re: Scripting lights into a model
« Reply #5 on: 01 Aug 2010, 18:48:39 »
Whole script start to finish:

Code: [Select]
class CfgPatches {
class MEU_LPD { //name of the addon
units[] = { //units which will get added
"LPD Aft Section",
"LPD Mid Section",
"LPD Bow Section"
};
weapons[] = {};
requiredVersion = 1.07;
requiredAddons[] = {}; //addons which are required when using your addon.
};
};

class CfgVehicleClasses {
class MEU_LPD { //Creates a new group under which it will be visible in the editor
displayName = "MEU LPD-17";
};
};

class CfgVehicles {
class StaticShip; //loading old class for inheritance
class LPD_SEC_MID : StaticShip { // inheriter to : inherit from
scope = 2; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
accuracy = 1; // never recognize
vehicleClass ="MEU_LPD"; // same as CfgVehicleClasses
displayName ="LPD-17 Mid Section"; // name of the object
destrType = DestructNo;
model = "\MEU_LPD17\LPD_SEC_MID.p3d"; //path to the binarized model
                armor = 500;// strength of wall also effected by weight amount in geo lod
                mapsize = 100;// size of icon when placed in editor
icon = "\MEU_LPD17\LPD_icon3.paa"; //icon used in editor
};

class LPD_SEC_BOW : LPD_SEC_MID { //In this case it inherits from the first object I installed
displayName ="LPD-17 Bow Section"; //name of the object
model = "\MEU_LPD17\LPD_SEC_BOW.p3d"; //path to the binarized model

};

class LPD_SEC_AFT : LPD_SEC_MID { //In this case it inherits from the first object I installed
displayName ="LPD-17 Aft Section"; //name of the object
model = "\MEU_LPD17\LPD_SEC_AFT.p3d"; //path to the binarized model

  class MarkerLights
   {
     class Redblinking
     {
       name="svet1";
       color[]={1.000000, 0.100000, 0.100000, 1};
       ambient[]={1.000000, 0.100000, 0.100000, 1};
       brightness=0.00500;
       blinking=0;
};
};

  };
};

I inherit from staticship. I am expecting to see a small red light at the memory point I named "svet1" but I do not when I load into ARMA.

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Scripting lights into a model
« Reply #6 on: 01 Aug 2010, 19:37:21 »

 hmm,
 try adding the
class MarkerLights
      {};

 to your LPD_SEC_MID , i am thinking that because your  LPD_SEC_MID inherits from staticship and then does not use Marker lights , when you get to your last inherit  which is LPD_SEC_AFT : LPD_SEC_MID
 it isnt inheritng any lights .

 if that dont work try

Code: [Select]
  class MarkerLights
      {
        class RedStill
        {
          color[] = {
            0.2,
            0.02,
            0.02,
            1
          };
          ambient[] = {
            0.3,
            0.03,
            0.03,
            1
          };
          name = "svet1";
          brightness = 0.01;
          blinking = 0;
        };

 and last resort maybe light needs czechname or something like  "cerveny pozicni" ;

 
I love ofp

Offline Absolution

  • Members
  • *
Re: Scripting lights into a model
« Reply #7 on: 06 Aug 2010, 04:40:53 »
Woohoo! Let there be light points! Looks like your first suggestion fixed it.

Now on to the next topic... Ambiance. I noticed that my light wasn't lighting up the room it was sitting in. Can I do that with these types of lights? I increased the brightness of the light 1000 fold and all it did was increase the brightness of the point and did not cast any light to nearby surfaces.

Code: [Select]
     
 name="SolidRed1";
       color[]={1.0, 0.0, 0.0, 1};
       ambient[]={1.000000, 0.0, 0.0, 1};
       brightness=0.10000;
       blinking=0;


Let me ask in another way. How do I script in a volumetric light?

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Scripting lights into a model
« Reply #8 on: 08 Aug 2010, 09:42:41 »


 Try turning up the values in your ambient config, however if your model has always in shadow it may influence just how much the light takes efect ( unsure).
 Buildings themselves have different  kind of internal lights

Code: [Select]
selectionWhiteLight = "light-white";
      selectionRedLight = "light-red";
      selectionOffLight = "light-off";

as do vehicles

Code: [Select]
   
memoryPointCargoLight = "cargo light";
class CargoLight
      {
        color[] = {
          0,
          0,
          0,
          0
        };
        ambient[] = {
          0.6,
          0,
          0.15,
          1
        };
        brightness = 0.007;
      };

 To answer your question about scripting , then simply create a memory point in your room/cargohold and   in a seperate pbo create your own light and then in your ships INIT attach that light to your ship using attachto.

 
I love ofp

Offline Absolution

  • Members
  • *
Re: Scripting lights into a model
« Reply #9 on: 08 Aug 2010, 23:33:08 »
When I scripted in the #lightpoint it was absurdly bright. I set its brightness value to -3e38 and night was still turned into day.

All I am looking to do is introduce a gentle blue or red light into the interior spaces of my ship such that when you play at night you are not forced to wear NVG to get around inside.

I tried the cargo light but either you have to be IN the cargo or I used it wrong; thoughts?
Code: [Select]
class CfgVehicles {
class StaticShip; //loading old class for inheritance
class LPD_SEC_MID : StaticShip { // inheriter to : inherit from
scope = 2; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
accuracy = 1; // never recognize
vehicleClass ="MEU_LPD"; // same as CfgVehicleClasses
displayName ="LPD-17 Mid Section"; // name of the object
destrType = DestructNo;
model = "\MEU_LPD17\LPD_SEC_MID.p3d"; //path to the binarized model
                armor = 500;// strength of wall also effected by weight amount in geo lod
                mapsize = 200;// size of icon when placed in editor
icon = "\MEU_LPD17\LPD_icon3.paa"; //icon used in editor

class MarkerLights
{
     class SolidGreenMid
    {
    name="SGrM1";
    color[]={0, 1, 0, 1};
    ambient[]={0, 1, 0, 0};
brightness=0.00500;
blinking=0;
};
};

class Cargolight
{
class SolidGreenCMid
{
    name="SGrCM1";
    color[]={0, 0, 0, 0};
    ambient[]={0, 1, 0, 0};
    brightness=0.10000;
    blinking=0;
};
};
};


I also tried the whitelight as follows:
Code: [Select]
class CfgVehicles {
class StaticShip; //loading old class for inheritance
class LPD_SEC_MID : StaticShip { // inheriter to : inherit from
scope = 2; //2: Visible in the editor | 1: Not visible in the editor | 0: Not visible, can't be used for inheritance
accuracy = 1; // never recognize
vehicleClass ="MEU_LPD"; // same as CfgVehicleClasses
displayName ="LPD-17 Mid Section"; // name of the object
destrType = DestructNo;
model = "\MEU_LPD17\LPD_SEC_MID.p3d"; //path to the binarized model
                armor = 500;// strength of wall also effected by weight amount in geo lod
                mapsize = 200;// size of icon when placed in editor
icon = "\MEU_LPD17\LPD_icon3.paa"; //icon used in editor

class MarkerLights
{
     class SolidGreenMid
    {
    name="SGrM1";
    color[]={0, 1, 0, 1};
    ambient[]={0, 1, 0, 0};
brightness=0.00500;
blinking=0;
};
};

class selectionWhiteLight
{
class SolidGreenCMid
{
name="SGrCM1";
    color[]={0, 0, 0, 0};
    ambient[]={0, 1, 0, 0};
brightness=0.10000;
blinking=0;
};
};
};


Neither resulted in any kind of light. What am I doing wrong?