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[] = {0.800000,0.800000,1.000000,1.000000};
ambient[] = {0.070000,0.070000,0.070000,1.000000};
position = "L svetlo";
direction = "konec L svetla";
hitpoint = "L svetlo";
selection = "L svetlo";
size = 0.500000;
brightness = 1.000000;
};
};
[/QUOTE]<span id='postcolor'>
And now for the things I don'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?
Lights CANNOT go on weapons.
der bastler
Oct 18 2002, 22:30
So'n Scheiß!
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'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'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's HK MP5A3 has got a tactical flashlight, but it doesn't work. I'm trying someting with proxies now...
GAMEER_77
Oct 19 2002, 09:48
Right...well, that'll be it then. Good luck with it! 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's muzzle.
3.) This proxy is registered in CfgNonAIVehicles according to Suma's instructions (seems to work: no error message is presented, OFP doesn't crash)
4.) There'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: Car
{
side = 1;
model = "\m41apr\taclight_proxy.p3d";
hasdriver = 1;
crew = "logic";
maxSpeed = 1;
fuelCapacity = 0;
transportSolider = 0;
transportAmmo = 0;
weapons[] = {};
magazines[] = {};
typicalCargo[] = {};
transportMaxMagazines = 0;
transportMaxWeapons = 0;
class reflectors
{
class Reflector
{
color[] = {0.900000,0.800000,0.800000,1.000000};
ambient[] = {0.100000,0.100000,0.100000,1.000000};
position = "svetlo L";
direction = "konec svetla L";
hitpoint = "svetlo L";
selection = "svetlo L";
size = 0.12500000;
brightness = 0.250000;
};
};
};
[/QUOTE]<span id='postcolor'>
The Idea: The flashlight behaves like a car with a logic driver. It's behaviour is my status variable and trigger ("Safe" = light; "STEALTH" = darkness).
5.) In my weapon's class I'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 = "flashlight on";
position = "konec hlavne";
radius = 0.5;
condition = "(behaviour nearestObject [this, ""tacticalflashlight""]) != ""SAFE""";
statement = "(nearestObject[this,""tacticalflashlight""]) setBehaviour ""SAFE""";
};
class myaction2
{
displayName = "flashlight off";
position = "konec hlavne";
radius = 0.5;
condition = "(behaviour nearestObject [this, ""tacticalflashlight""]) == ""SAFE""";
statement = "(nearestObject[this,""tacticalflashlight""]) setBehaviour ""STEALTH""";
};
};
[/QUOTE]<span id='postcolor'>
But these actions don't appear ingame! Why?
If it'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'm supporting you all the way on this one as i'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've successfully created a garage with working doors using this UserActions. Perhaps it'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
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.