PDA

View Full Version : Flashlight



der bastler
Oct 16 2002, 18:33
I want to define a flashlight. I know I need:

- two vertices defining base and direction of the light with proper names ("L svetlo", "konec L svetla")

- a class reflectors in my config:
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">
class Reflectors
{
  class Reflector
  {
     color&#91;&#93; = {0.800000,0.800000,1.000000,1.000000};
     ambient&#91;&#93; = {0.070000,0.070000,0.070000,1.000000};
     position = &#34;L svetlo&#34;;
     direction = &#34;konec L svetla&#34;;
     hitpoint = &#34;L svetlo&#34;;
     selection = &#34;L svetlo&#34;;
     size = 0.500000;
     brightness = 1.000000;
 };
};
[/QUOTE]<span id='postcolor'>



And now for the things I don&#39;t know:

- What means "selection"?
- Do I need to define something else in my model?

PicVert
Oct 18 2002, 07:08
In the game it work or not?

Cause I would make one too.

der bastler
Oct 18 2002, 08:39
I tried to build a search light => OFP crashed.

Perhaps the light cannot be mounted on a turret?

der bastler
Oct 18 2002, 18:42
Ok, I mounted a flashlight to my new weapon, but I cannot activate it.

Weapon + light = not possible?

SFG
Oct 18 2002, 22:18
Lights CANNOT go on weapons.

der bastler
Oct 18 2002, 22:30
So&#39;n Scheiß&#33;
http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/mad.gif

No chance? No work-around-thingy possible? Something like the laserpointer? http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/sad.gif

GAMEER_77
Oct 19 2002, 09:10
Didn&#39;t someone make a gun that hand a flashlight on the front of it? http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/confused.gif Or was that some fraud fake?

I&#39;m sure there was...

http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/wow.gif PEACE

der bastler
Oct 19 2002, 09:37
Vipersheart&#39;s HK MP5A3 has got a tactical flashlight, but it doesn&#39;t work. I&#39;m trying someting with proxies now...

GAMEER_77
Oct 19 2002, 09:48
Right...well, that&#39;ll be it then. Good luck with it&#33; http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/smile.gif

http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/wow.gif PEACE

der bastler
Oct 19 2002, 13:53
1.) Ok, I defined a proxy consisting of...
...a resolution lod with a flashlight texture and...
...a memory lod with vertices "svetlo L" and "konec svetla L"

2.) I placed the proxy at the end of the weapon&#39;s muzzle.

3.) This proxy is registered in CfgNonAIVehicles according to Suma&#39;s instructions (seems to work: no error message is presented, OFP doesn&#39;t crash)

4.) There&#39;s a class tacticalflashlight in CfgVehicles:
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">
class tacticalflashlight&#58; Car
{
    side = 1;
    model = &#34;&#92;m41apr&#92;taclight_proxy.p3d&#34;;
    hasdriver = 1;
    crew = &#34;logic&#34;;
    maxSpeed = 1;
    fuelCapacity = 0;
    transportSolider = 0;
    transportAmmo = 0;
    weapons&#91;&#93; = {};
    magazines&#91;&#93; = {};
    typicalCargo&#91;&#93; = {};
    transportMaxMagazines = 0;
    transportMaxWeapons = 0;

    class reflectors
    {
         class Reflector
         {
              color&#91;&#93; = {0.900000,0.800000,0.800000,1.000000};
              ambient&#91;&#93; = {0.100000,0.100000,0.100000,1.000000};
              position = &#34;svetlo L&#34;;
              direction = &#34;konec svetla L&#34;;
              hitpoint = &#34;svetlo L&#34;;
              selection = &#34;svetlo L&#34;;
              size = 0.12500000;
              brightness = 0.250000;
         };
    };
};
[/QUOTE]<span id='postcolor'>
The Idea: The flashlight behaves like a car with a logic driver. It&#39;s behaviour is my status variable and trigger ("Safe" = light; "STEALTH" = darkness).

5.) In my weapon&#39;s class I&#39;ve defined two UserActions:
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">
class UserActions
{
     class myaction1
     {
          displayName = &#34;flashlight on&#34;;
          position = &#34;konec hlavne&#34;;
          radius = 0.5;
          condition = &#34;&#40;behaviour nearestObject &#91;this, &#34;&#34;tacticalflashlight&#34;&#34;&#93;&#41; &#33;= &#34;&#34;SAFE&#34;&#34;&#34;;
          statement = &#34;&#40;nearestObject&#91;this,&#34;&#34;tacticalflashlight&#34;&#34;&#93;&#41; setBehaviour &#34;&#34;SAFE&#34;&#34;&#34;;
     };
     class myaction2
     {
          displayName = &#34;flashlight off&#34;;
          position = &#34;konec hlavne&#34;;
          radius = 0.5;
          condition = &#34;&#40;behaviour nearestObject &#91;this, &#34;&#34;tacticalflashlight&#34;&#34;&#93;&#41; == &#34;&#34;SAFE&#34;&#34;&#34;;
         statement = &#34;&#40;nearestObject&#91;this,&#34;&#34;tacticalflashlight&#34;&#34;&#93;&#41; setBehaviour &#34;&#34;STEALTH&#34;&#34;&#34;;
    };
};
[/QUOTE]<span id='postcolor'>

But these actions don&#39;t appear ingame&#33; Why?

If it&#39;s not possible, I want to try a "streetlamp"-proxy and the switchLight/Lightison-Commands. Any comments before I start the work again?

GAMEER_77
Oct 19 2002, 15:04
You can add actions to your weapons? http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/wow.gif

Be right back, hehehe.... http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/tounge.gif

I know this is totally unrelated to your question bastler, but do you know where i could get all the config.cpp commands? Feel free to bad mouth me for intruding, but i&#39;m supporting you all the way on this one as i&#39;d love to see swat type weapons with flashlights on the front.

Besides, if i knew all the commands i could help you http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/wink.gif

http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/tounge.gif PEACE

der bastler
Oct 19 2002, 16:29
Read this (http://www.flashpoint1985.com/cgi-bin/ikonboard301/ikonboard.cgi?act=ST;f=38;t=20030). I&#39;ve successfully created a garage with working doors using this UserActions. Perhaps it&#39;s not possible at guns? Hm, perhaps I should add this action to the tacticalflashlight itself...

GAMEER_77
Oct 19 2002, 16:46
Thanks Der Bastler, but i actually meant the .cpp comands like "maxSpeed = 1" and "fuelCapacity = 0" and things like that. Ill check out OFPEC and see if they have any...

http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/wow.gif PEACE