Home   Help Search Login Register  

Author Topic: #lightpoint createVehicle broken?  (Read 3654 times)

0 Members and 1 Guest are viewing this topic.

Offline cheesus

  • Members
  • *
#lightpoint createVehicle broken?
« on: 04 Apr 2010, 00:42:44 »
So your creating some lighting to set the mood with arma2's lovely lights of many colours - looks great and runs great, really atmospheric. Lets say your running this purloined script from a suitably placed units init:

Quote
//////////////////////////////////////////////////////////////////
// Function file for Armed Assault
// Created by: 1ID-CPL. Venori
//////////////////////////////////////////////////////////////////

_target = _this select 0;

// Create a small local light and attach it to the object.
_light = "#lightpoint" createVehicle [0,0,0];
_light setLightBrightness 0.3;
_light setLightAmbient[0.6, .07, .05];
_light setLightColor[0.6, .07, .05];
_light lightAttachObject [_target, [0,-0.1,0]];

Now, for example, you start fighting some bad guys and things get a little dicey and you get killed. Luckily you saved the game before hand so you load up the savegame and...doink! its lights out sucker. Those lights you created are gone - ruining your girlfriends mood completely.

This does not happen on units with lights already attached (vehicles, roadcones etc) so what gives? More importantly is there a way round arma2 killing my lights?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: #lightpoint createVehicle broken?
« Reply #1 on: 10 Apr 2010, 09:17:05 »
Sounds like the lightpoints are not saved in the savegame (there are a few things that share that problem) so they disappear after you load a save game.

I'm not sure if this still works in Arma2 but in OFP/A1 you can "abuse" another savegame bug/feature to check if a saved game was loaded. The command time resets to 0 (zero) when ever a savegame is loaded so if you save the initial time to a variable and then loop a check to see whether the current time is less than the initial time, and if so it means a saved game was loaded and you can then re-create those lights.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline cheesus

  • Members
  • *
Re: #lightpoint createVehicle broken?
« Reply #2 on: 12 Apr 2010, 16:01:59 »
Thanks for the reply man, yeah i can keep the lights burning by sticking them in a loop. It works but it adds a layer of unnecessary complexity thats ...inelegant. Ho hum i guess light entities are not that important to those crazy Czechs - i hear most of the country is lit by whale blubber.
« Last Edit: 12 Apr 2010, 16:22:00 by cheesus »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: #lightpoint createVehicle broken?
« Reply #3 on: 12 Apr 2010, 17:14:43 »
Of course you could always make a ticket at the Community Issue Tracker if it's not mentioned there already, they might even fix this problem since it shouldn't be a biggy for them to do :dunno:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline cheesus

  • Members
  • *
Re: #lightpoint createVehicle broken?
« Reply #4 on: 12 Apr 2010, 22:38:07 »
The bug tracker seems like a place for people who know what they're doing, but sure, i'll fill out a form :)

On a similar note are the #lightpoint style lights the only type of lights accesable through scripting? They act like omni style lights with attributes like brightness, colour etc - while vehicles seem to have a single headlight with directional attributes that i havent found in the scripting commands ref (http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2).

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: #lightpoint createVehicle broken?
« Reply #5 on: 13 Apr 2010, 10:02:32 »
I don't think there's any other kind of lightsources available.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.