OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: [seven] on 04 Oct 2007, 18:50:48

Title: seven's Runway Lights (updated to version 1.7 beta) (ACCEPTED)
Post by: [seven] on 04 Oct 2007, 18:50:48
Dynamically detects or creates runway edgelights for any airport on any map and lights them up brightly.

(http://www.realimagehost.com/uploads/757e9ce56e.jpg) (http://www.realimagehost.com)

Version 1.7 beta uploaded.

Whats new?

Strobes replaced with static lighting for constant visibility.

Now added script for placing PAPI lights in addition to edgelights.

Possible to customize which parts of the runway you want to light up.

Limitations: Arma can only have so many lightsources in a particular area.

OFPEC DOWNLOAD (http://www.ofpec.com/ed_depot/index.php?action=details&id=633)
Title: Re: seven's Runway Lights
Post by: LeeHunt on 05 Oct 2007, 16:49:40
hey Seven,

Looks interesting,

1) Can you put all the files into the same folder?  The readme and function are separate from the mission and init.sqs and i had to put them together.

2) Are you using a new top notch PC?  Mine is sadly 4 years old, and the game froze about 5 seconds into the mission as i approached the landing lights. I'm wondering if these functions eat up a lot of horsepower?

3) but its a cool idea thanks (could be just old PC's like mine that have issues)
Title: Re: seven's Runway Lights
Post by: Spooner on 05 Oct 2007, 17:43:03
You could vastly shorten the script file (to about 5% of current length) and improve maintainability by doing this (I didn't use the correct IDs in this example, or actually run a test):
Code: (runwayLights.sqf) [Select]
// Get the input parameters here...

// List of IDs for all the lights.
_lightIDs = [
    [471455, 471633],
    [471451, 471628],
    [471499, 471695],
    // Rest of values here...
];

while {true} do
{
    {
        _ids = _x; // Pair of object ids.

        _lights = []; // List of light objects created.

        // Create the light objects.
        {
            _lightpos = _lightmark nearestObject _x;
            _light = "#lightpoint" createVehiclelocal _lightmark;
            _light setLightBrightness _brightness;
            _light setLightAmbient[_ar,_ag,_ab];
            _light setLightColor[_r,_g,_b];
            _light lightAttachObject [_lightpos, [_x,_y,_z]];
            _lights = _lights + [_light];
       } forEach _ids;

        sleep _timer;

        // Delete the light objects.
        {
            deletevehicle _x;
        } forEach _lights;
    } foreach _lightIDs;
};

To reduce lag, allow the mission-maker to configure the maximum range that the lights can be seen from. Check the range from player to airstrip every loop and if the player is outside that range, then just sleep for a few seconds instead. This won't help LeeHunt, but I'm not sure why he should be having problems (the script really doesn't do much at all so shouldn't slow anyone up noticeably ).

Hmm, in a part of the script that is never reached, it runs the script "runwaylightsx.sqf" (not included in the download). Not sure why that is done, but I assume it isn't supposed to still be there.
Title: Re: seven's Runway Lights
Post by: Mandoble on 05 Oct 2007, 18:04:31
Why to create and then delete and then create ....
why not just create the lights, and then simply play with setLightBrightness?

BTW, for MP the script must be run on every client.
Title: Re: seven's Runway Lights
Post by: Pergite on 05 Oct 2007, 23:30:21
This would be a nice addon for a airfield raid I am working on.

BTW, for MP the script must be run on every client.

If anyone could tell me exactly how I should execute the script on all clients, I would be really greatfull. (What commmand, when and where?)
I have been trying to read up on the subject but havent gotten it to work yet...  :dunno:
Title: Re: seven's Runway Lights
Post by: Mandoble on 05 Oct 2007, 23:58:41
just run it in the init.sqs or init.sqf file. If you want to make sure there is a player there, then wait first for the condition alive player or local player.
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: [seven] on 07 Oct 2007, 03:55:54
Script updated to version 1.1

What is new?

No longer creates then deletes lights, now simply changes brightness to create the same effect as per mandoble's suggestion.

Now includes a minimum distance check to as per spooner's suggestion.

Includes detailed readme exlplaining all arguments and how performance can be tweaked.

Includes two examples showing different performance.


@ LeeHunt
 I'm using an agp vid card and an old 2.8 GHz P4, same age as yours, so most people should be fine I think.

@ Mandoble and Spooner
Thanks for the excellent suggestions.  :good:
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: Mandoble on 07 Oct 2007, 11:46:33
The end result is quite good  :good: But the script is extremely limited as it will work only with a single airfield of a single island: Sara.

Here is what I propose you to do:
1 - Check OFPEC ILS (ofpec_AirportEvents.sqf) to see how to get all the available airfields in an Island reading the config.
2 - For each airfield, get "ilsPosition" and "ilsDirection" class members. islDirection is in format [x,angle,y] so you only need to use x and y to know the runway angle: _rang = (ilsdirection select 0) atan2 (ilsdirection select 2);
3 - Now you have the starting position of the runway and the direction. So it is time to create the lights (use a light array  per airfield instead of individual variables per each light. lights[airfield number, light number] = createVehicle [x,y,0].
4 - To calculate the x and y use the ilsposition as origin reference and an increasing radius which will point each time to the center of the runway side-to-side. From this point you need to place a light to the left and a light to the right (_ang + 90) using a general value as half of runway width, and then increase the radius the desired delta and proceed with the next pair of lights.
5 - Repeat 3 and 4 for each airfield.
6 - when all your lights are correctly placed, check how close is the player vehicle to each airfield and activate the light animation for the closer one.

This way you will have a universal airfield lights script for any airfield and any island.

EDIT:
I would go even further to have only a single pair of lights per airfield, One at each side of the runway. As the player aproaches, the pair lights are moved forward (seposed) till certain distance, back to origin and move forward again (following the angle of the runway). To create that animation you really dont need more than a pair of lights. The practical effec for the pilots would be the same and the hit in performance would be minimal.

EDIT2:
Additionaly, this is what I get in arma.RPT file when running these example missions:

"Performance warning: Search for 51f2f718# 471613: runway_edgelight.p3d was very large (520 m)
Performance warning: Search for 51f2f398# 471614: runway_edgelight.p3d was very large (520 m)
"

Many messages like the above ones.
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: Spooner on 07 Oct 2007, 14:02:14
Good to see that you've improved the script.

Just to cause trouble again, I realised that if you have multiple instances of the script running, to have multiple pairs of light illuminated at the same time, then they will eventually go out of synchronisation since using sleep commands in multiple scripts isn't precise. It would certainly be possible to have multiple pairs of lights in a single script, but you need to worry first about either getting the light IDs/objects into an array (as in my earlier example) or implementing Mandoble's last suggestion for a generic script. If you need any help with using arrays and iteration through them, then just shout.

@Mandoble
Although this effect would look great for pilots, anyone on the ground wouldn't see the lights appearing or disappearing where the actual runway lights are. Would it not be possible to use a generic script such as you suggest to find the positions of the map-placed runway light objects for visual consistency?
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: Mandoble on 07 Oct 2007, 14:09:45
Nope, because most airfields in an Island do not have any map-placed runway light objects.
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: [seven] on 08 Oct 2007, 13:05:24
The dynamic airport lights thing sounds cool, but the aesthetics would be ruined without actual light fixtures to have the lights appear from.  So we'd have to add the option to add light fixtures fixtures and so we don't unnecessarily create fixtures for more airports than we have to the mission maker would need to insert an argument with an array of the airport id's he wants to be lit up.

As for the the lighting system you described, where the lights move forward as the player approaches, a pilot needs to see as much of the runway ahead as possible.  If a pilot truly needs the lights to land and they are not just being used to look pretty then we must assume he has no night vision, so with that in mind how can a pilot who is on final approach make the decision to land, do a touch and go, perform a go around, or execute a missed approach when he has no visual representation of where the boundaries of the runway ahead are?  Suppose there is a burned out plane wreck or other vehicle sitting in the middle of the runway 400m in front where you are touching down, by the time you saw it you would be going to slow to pull up and too fast to stop.  With the lights going from end to end you can see any obstruction that might cause an accident well in advance.


Spooner, I'm having trouble adjusting your template to create the lights first then use the while loop to illuminate them.  What I'd like to do for the double lights is illuminate two rows at once and then move on to the next two.  So row 1 and 2 would be lit then sleep then row 3 and 4.  Using this two row method we can cut the time it takes for the lights to reach the end from nearly three seconds to just over one thereby helping the pilot by refreshing his visual reference at a faster pace (it also looks amazing like this, feels more like a real airport lighting system), or we can increase performance by upping the sleep time by two fold.  Similarly, we could use an odds and evens scheme for a single light configuration where the odds were lit up until the lights reached the end and then the lights start over using the even rows, again this would make for faster pace and better performance.

This is the array I've been using to play with your template:

Quote
_lightIDs = [
    [471613],
    [471614],
    [471397, 471572],
    [471399, 471573],
    [471404, 471579],
    [471405, 471581],
    [471408, 471585],
    [471411, 471590],
    [471412, 471592],
    [471413, 471595],
    [471416, 471599],
    [471423, 471605],
    [471427, 471608],
    [471434],
    [471437],
    [471438],
    [471439],
    [471443],
    [471447],
    [471450, 471620],
    [471451, 471628],
    [471455, 471633],
    [471456, 471634],
    [471461, 471638],
    [471463, 471644],
    [471467, 471647],
    [471471, 471651],
    [471473, 471654],
    [471477, 471661],
    [471487, 471664],
    [471490, 471665],
    [471495, 471666],
    [471499, 471667],
    [471500, 471668],
    [471503, 471670],
    [471504, 471675],
    [471505, 471676],
    [471506, 471678],
    [471511, 471686],
    [471515],
    [471517],
    [471518],
    [471521, 471700],
    [471522, 471701],
    [471527, 471706],
    [471528, 471710],
    [471532, 471715],
    [471534, 471717],
    [471539, 471722],
    [471540, 471725],
    [471541, 471726],
    [471546, 471729],
    [471553, 471732],
    [471557, 471733],
    [471561, 471734],
    [471568, 471736],
    [471570]
];
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: Spooner on 08 Oct 2007, 17:48:54
I think that there is both a place for a simple, but "perfect", solution for just one airstrip (as I think you want to do) and a complex, generic solution for any airport that Mandoble is suggesting. Maybe, once you have the simple version working, you can think about working out the slightly more complex script/mathematics required for the generic version.

I'm not sure how much you want guidance and how much you want me to fix the code. I'll try to explain it first in pseudo-code for you to implement if, before I write the code straight out and spoil the learning experience for you ;P

First problem you'll be having is that you didn't close the array properly at the end, which will cause an immediate error. May just have been a copy-and-paste error though:
Code: [Select]
_lightIDs = [
    [471613],
    [471614],
    ...others...
    [471568, 471736],
    [471570]
];

Next thing to do is to construct a new list, containing light objects in the same positions as the ids you already have, and iterate though them, lighting and darkening the rows as you go:
Code: [Select]
_lightObjects = [];

// For each row of light IDs
// - create an empty array, _row.
// - insert one or two light objects into _row, created at locations based on the ID numbers in the current row.
// - insert _row into _lightObjects (Use: _lightObjects = _lightObjects + [_row])

// You should then have an array like this (don't type this in, I am just intending to show you that the new object array is structured the same as the ID one):
// [
//     [light object],
//     [light object],
//     ...others...
//     [light object, light object],
//     [light object]
// ];

// Repeat this for ever, while you are close to the airstrip:
for "_i" from 0 to ((count _lightObjects) - 1) do
{
    // Turn OFF the lights in row _i and row (_i + 1).
    // Turn ON the lights in row (_i + 2) and row (_i + 3).
    // Sleep.
};

You should notice that this will work fine until you get to the end of the list of light object, when (_i + 3) is actually asking for a row beyond the end of the array. To fix this, you can use the mod command to wrap each of these numbers around when they get over the end of the array. Although this algorithm will light two rows at once and flip to the next two rows, I'd probably just decrease the sleep time and allow for "sliding" rows which uses about the same amount of CPU (2 rows change lighting at a time instead of 4 rows, but it happens twice as fast) for a slightly improved visual effect:
Code: [Select]
for "_i" from 0 to ((count _lightObjects) - 1) do
{
    // Turn OFF the lights in row _i
    // Turn ON the lights in row (_i + 2).
    // Sleep.
};

This algorithm has two rows always lit, except for the fraction of a second before the very first "slide" occurs (which noone will care about).

**EDIT**
Made a mistake, I suggested to use "_lightObjects = _lightObjects + _row" when I meant "_lightObjects = _lightObjects + [_row]" (corrected in pseudocode, above)
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: [seven] on 09 Oct 2007, 22:23:07
Can't quite get it to work but so far I have something like this:
Quote
_lightObjects = [];

{
   _ids = _x;
   _row = [];
   {
      _lightpos = _lightmark nearestObject _x;
      _light = "#lightpoint" createVehiclelocal _lightmark;
      _light setLightBrightness 0;
      _light setLightAmbient[_ar,_ag,_ab];
      _light setLightColor[_r,_g,_b];
      _light lightAttachObject [_lightpos, [_x,_y,_z]];
      _row = _row + [_light];
   } forEach _ids;
   _lightObjects = _lightObjects + [_row];
} forEach _lightIDs;

while {(_unit distance _lightmark) < _mindist} do
{
   for "_i" from 0 to ((count _lightObjects) - 1) do
   {
      {
      _x setlightbrightness 0;
      } forEach (_lightObjects select _i);

      {
      _x setlightbrightness 0;
      } forEach (_lightObjects select (_i + 1));

      {
      _x setlightbrightness _brightness;
      } forEach (_lightObjects select (_i + 2));

      {
      _x setlightbrightness _brightness;
      } forEach (_lightObjects select (_i + 3));
      sleep _timer;
   };
};

Where am I going wrong?  :dunno:
Also I looked up the mod command in the Biki but I'm still confused as to how to use it so if you could include an example, that would help.  :D

[Edit]: Typos in the quote fixed.
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: Spooner on 09 Oct 2007, 23:03:12
Since the values in the IDs array are numbers, you won't get any joy from:
Code: [Select]
_lightpos = _lightmark nearestObject "_x";
which should be:
Code: [Select]
_lightpos = _lightmark nearestObject _x;

I was being a bit vague about mod, which was obviously too vague :whistle: The problem with the script as is, is that when _i + 3 is greater than the number of rows, then there will be an error. What we need to do is make the row number wrap around if it is too big.

Before the while loop:
Code: [Select]
_numRows = count _lightObjects;

For each of the rows that you are affecting, you need to mod the value:
Code: [Select]
      {
          _x setlightbrighness 0;
      } forEach (_lightObjects select ((_i + 1) mod _numRows));

You also need a while {true} wrapped around the while loop you already have, or you'll only light the lights once.

It can be easier to attach the demo mission to the post rather than copy-and-paste sections of the code. Prevents errors and makes other people's lives easier since they can run the mission rather than imagining how the code would run (I know I'm probably making mistakes because I'm just reading/writing this code in the forum, not in a mission).

**EDIT**
I'm also not entirely sure I am helping you a great deal by trying to get you to write the script in the way I would, but I am trying to get you to learn how to do it rather than just be given the "correct" version of the script. *shrugs*
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: [seven] on 10 Oct 2007, 00:35:24
The way you've been nudging me along so far is just fine, I'm not assuming you want me to write it in any particular way. 

Anyhow, it seems like I'm almost where I want to be but it isn't quite right yet.  I get no errors but no lights either.  File attached.

[Edit] I figured out the problem!  :good:

The argument _x was conflicting with the index value _x in the forEach loop that creates the lights.  So I renamed the argument _x to _xpos and it works.  Now we can maybe add some interesting features.   :scratch:
Thanks a bunch Spooner, you've really gone out your way to help out!  ;)  The file is updated.

[Edit 2] It seems the extra math involved in using an array degrades performace considerably.  I've updated the archive once more, this time there is also a script inside called runwaylightsv1_1quad.sqf that is written in the rudimentary style I orignally was writing in.  It uses the same arguments and also lights up two rows at a time but it noticeably outperforms the array based script I just wrote.  Using the array, the lights look slow and jittery on my old pc, using the old method it's smooth as butter.  Is there any way to keep the script compact and still have decent performace?
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: Spooner on 10 Oct 2007, 11:07:19
Ack, the version you uploaded still had the _x error! Oops! The problem with _x being the forEach iterator and being a sensible name for x-axis position is a pain ;P Good to see you worked that one out! You'll notice that I use "_ids = _x;" to avoid overwriting the value in the nested forEach loop, but I didn't consider the _x script parameter.

I noticed that you pass the player's unit to the script. Well, when a player respawns, the unit changes, so that would break the script. Also, it wouldn't work when in an MP game, where each player object is different. Forget passing _unit and just use the player (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=p#player) command to resolve both these issues. Make sure that you don't run the script on a dedicated server too, since it is just client-side eye-candy (At the top of the lights script, exit if dedicated server: "if (isServer and (isNull player)) exitWith {};").

As far as frame-rate goes, I found the frame-rate about the same in both versions. Remember that you can't compare the frame-rate of a player flying a Camel in one position to the frame-rate of a soldier standing in another position, which may have been giving faulty readings.

Consider what happens when the player is beyond the maximum distance away from the lights. The outer while loop will run continually without breaks and the machine will come to a halt, since no other scripts are being allowed to run. If the player is too far away, then you need to take sleep breaks on each iteration (I'd suggest a couple of seconds).

You used mod correctly, but it isn't strictly necessary for the "_i" loop. The value can only be out of range when you are looking at row (_i + N), when the value needs to be modded to "wrap it around".

Further ideas: Allow for two or more sets of lights to be lit at the same time (e.g. for two sets: _i off, _i + 2 on, _i + 28 off, _i + 30 on). If you do this, you could probably be fine slowing the speed of the lights a bit, without making it harder for the player to work out where the runway is (I'm suggesting this without knowing what these sorts of lights would look like in real life; anyone got a video link to an example?).
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: [seven] on 10 Oct 2007, 15:42:53
Here's a link to a vid I found with blinking approach strobes.  As you can see they move very very fast.  To see them, forward ahead to about 1:20 in the video.
http://www.youtube.com/watch?v=PY3XvuuKJvI

I didn't look at the frames to measure performance.  I added some benchmarking code like so:
Quote
_time = time;

//Lights turning on and off.

_timepassed = time - _time;

 hint format["Time to end of runway is: %1",_timepassed];

I've uploaded two benchmarking examples in one .rar file.

Using the straighforward code (v1_1quad), I get around a 1 second average for the lights to reach to the end of the runway.

Using the array based code (v1_2alpha), I get around a 2.2 second average for the lights to reach to the end of the runway.

Both versions use the same sleep time of .01.

I think a 50% gain is worth the time it took to write all that code.

I think I'm going to do as you were saying and create one perfect, multiplayer-synchronized script for the main airfield (since at least 90% of takeoffs and landings occur there) and then work on something functions dynamically for all airfields once I finish that.  I just need to find a better way to activate the lights if it's going to be properly synched, I already have a few ideas.
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: Spooner on 10 Oct 2007, 16:33:15
OK, I haven't checked this, but using _time is not a good plan since it is already defined, as commented in the definition for time (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=t#time).
Quote from: macguba commenting on time @ OFPEC COMREF
Not to be confused with _time.
Within a script, the reserved local variable _time returns the time elapsed since the script started running.

time is also not updated except when sleeping, so it only really shows the time of sleeping, not other command execution.

I am totally convinced that the difference between the array/loop version and the repeated code version is negligible. What you will find is that there are twice the number of sleep commands actually performed in your looped version compared to your repeated code version. Using the on-off method you are using, the loop:
Code: [Select]
      for "_i" from 0 to (_numRows - 1) do

should be
Code: [Select]
      for [{ _i = 0}, { _i < _numRows}, {_i = _i + 2 }] do

This change will make the two scripts actually perform the same commands within one iteration (I'll hold my hand up to steering you in the wrong direction there! Sorry!).

Another thing to consider: Bear in mind that when you sleep for 0.01 seconds, then that actually will sleep for ONE FRAME (unless FPS is > 100, when it could more more than one frame), not for 0.01 seconds. This will become an issue that so far has been ignored by both of us, since the speed of light travel is very much dependent on current FPS.

As far as making a generic version once this version is complete, I know Mandoble would strangle me if I didn't encourage that ;P
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: Mandoble on 10 Oct 2007, 22:02:37
As far as making a generic version once this version is complete, I know Mandoble would strangle me if I didn't encourage that ;P

In fact I'm tempted to strangle both of you  :P Really, you two took the most complicated way to solve the problem, and yoooou Spooner know that pretty well  :whistle:  :P
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: [seven] on 11 Oct 2007, 08:36:56
Quote
In fact I'm tempted to strangle both of you :P Really, you two took the most complicated way to solve the problem, and yoooou Spooner know that pretty well  :whistle:  :P

Who says the problem is solved?  I still have more questions.  :D

I've been fooling around for a few hours trying to see if I could dynamically detect any runway edgelights that might already be present on a map, using nearestObjects to search around the ILS position I've been having no success.
Also, how can a I convert config files to text for reading  I tried downloading a tool called cfgconvert from bi but the link was no good.  :dunno:
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: Mandoble on 11 Oct 2007, 10:05:54
If you read the ILS position (landing start), the runway heading and the first taxi position (runway end) from the config (check OFPEC ILS to figureout how), why do you need to detect any edgelights? You have all the data needed to create your own ones, separated by the distance you consider optimum to do not affect game performance in any way. But not only that, you will have a script compatible with any Island, present of future. About airfields usage, Sara has two main airfields, one nicely finished, and the other not (SE corner), but in MP games probably side A will use airfield A and side B would use airfield B, and in that second airfield you will not find any pre-placed edgelights on the map.
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: [seven] on 11 Oct 2007, 13:15:26
I have the ils position and direction figured out.  :good:

The answer to your question is simple, I want to use the existing edgelights where they are already present, and create edgelights in the airfields that don't already have them.  The end result will still work with any airport on any map.

[Edit] Also, I don't seem to be able to figure out how to get the first taxi position.  I know to look for "ilsPosition" and "ilsDirection" for the other things but that's it.  How can I look through the config in a text editor so I know what I'm looking for when using code to read the config?
Title: Re: seven's Runway Lights (updated to version 1.1)
Post by: Planck on 11 Oct 2007, 14:03:21
ilsTaxiIn and ilsTaxiOff are what you need for taxi positions.

ilsTaxiIn are the taxi points the aircraft takes to get to the end of the runway to take off.
ilsTaxiOff are the taxi points the aircraft takes to leave the runaway after landing.

The first taxi point for landing is generally the same as the ilsPosition anyway.


Planck
Title: Re: seven's Runway Lights (updated to version 1.3 beta)
Post by: [seven] on 16 Oct 2007, 01:51:43
New test version uploaded.

Whats new?

Automatic detection of pre-existing edgelights.

Creates edgelights if auto-detect is not activated.

Allows for "exceptions" when creating edgelights (so you don't have edgelights blocking your taxiway or whatever).

Multiplayer re-synching so the strobes start at the same time each time a cycle is finished.

Allows different airfield strobes to be controlled by different factions.

Controlling faction of an airfield can be redifined accordingly.

Includes switching script for use with addAction.

Plus more...

This is only a test version so there are no detailed insructions just yet, for now just fly around and have fun playing with the lights while you go barnstorming.
Title: Re: seven's Runway Lights (updated to version 1.3 beta)
Post by: Spooner on 23 Oct 2007, 23:32:27
1. Although you don't have a "server" in your demo mission, in some of your scripts you use:
Code: [Select]
if (not local server) exitWith {};
I know you know how to use isServer, since it is in another of your scripts (the simple isServer command made the "local server" workaround redundant)!

2) I don't really understand what you are trying to do with the synchronisation, "Multiplayer re-synching so the strobes start at the same time each time a cycle is finished.", which presumably uses lightsynch.sqf, so I can't say whether it is working as you intended.

3) When you turn on the strobes, you turn on the strobes at the closest airport, which is correct. When you turn off the strobes, you turn off the strobes at the closest airport, even if that airport isn't the same one that you turned strobes on at beforehand. At least as far as I can tell...

4) Number of other issues I was confused about, I can discuss with you in MSN at some point.
Title: Re: seven's Runway Lights (updated to version 1.3 beta)
Post by: [seven] on 26 Oct 2007, 16:38:11
Quote
I don't really understand what you are trying to do with the synchronisation, "Multiplayer re-synching so the strobes start at the same time each time a cycle is finished.", which presumably uses lightsynch.sqf, so I can't say whether it is working as you intended.

What lightsynch.sqf does is regulate the time when strobes begin again after they have reached the end of the runway, it is also used during single player operation. It is like a metronome.  The clients that are ready (the ones that have finished their last strobe) wait for the value to be true before they start the strobes again, they will all start at the same time give or take a few milliseconds.  So basically what happens is this: different peoples framerates cause them to have slight differences in the speed of the lights movement, but no matter how out of whack they get from one client to another, they always wait for the server to tell them when to start again.  I chose this rather than than true multiplayer synching because I don't want someone with a low framerate messing up the effect for everyone else.

Quote
3) When you turn on the strobes, you turn on the strobes at the closest airport, which is correct. When you turn off the strobes, you turn off the strobes at the closest airport, even if that airport isn't the same one that you turned strobes on at beforehand. At least as far as I can tell...

The switching script I wrote does exactly as you say.  But there is more than one way to skin a cat!   :D

The lights can be activated/deactivated however you wish.  For example, place a trigger over the airfield and use:

Quote
lightswitchonoff set [airportidnumberhere, true];
for the act

Quote
lightswitchonoff set [airportidnumberhere, false];
for the deact

The array lightswitchonoff holds the values that switch the airports off and on.  Use triggers, write a small script, whatever.  The sky is the limit on how you want to change those values!  :good:

Of course I do plan on including more activation scripts for different situations but no point in doing so until I get things down a bit tighter.

As an aside, clients will only check the switch status of one (the closest) airfield at any given time.  If someone say leaves the lights on at pita for some reason, it won't be eating up the resources of people who are closer to antigua.

I have a good idea of some of the other things that you might find strange, hit me up on msn for those.  I also have some questions for you.
Title: Re: seven's Runway Lights (updated to version 1.3 beta)
Post by: Falcon 1 on 26 Nov 2007, 19:51:12
Mind if I use this?

Will give full credit  :good:
Title: Re: seven's Runway Lights (updated to version 1.3 beta)
Post by: [seven] on 26 Nov 2007, 22:36:46
Mind if I use this?

Will give full credit  :good:

Of course you can, that's the point of posting it!  I have to warn you it isn't fully working for multiplayer yet however, spooner is helping out with some issues, hopefully I'll have updates for some of my scripts this week.
Title: Re: seven's Runway Lights (updated to version 1.3 beta)
Post by: Dwarden on 23 Feb 2008, 15:09:24
ok for some reason i'm unable to get this working in MP (and JIP) ... it seems to work ok only on local server ... not dedi nor JIP
Title: Re: seven's Runway Lights (updated to version 1.7 beta)
Post by: [seven] on 28 Feb 2008, 18:58:28
New version uploaded.  Should work for MP/JIP.  :good:

Feedback appreciated.   8)
Title: Re: seven's Runway Lights (updated to version 1.7 beta)
Post by: Mandoble on 20 Mar 2008, 10:46:14
Seven, for us it is a bit "tricky" to do any serious MP test, I assume you have already tested the JIP compatibility. This is still 1.7 beta while the resource itself is getting "old", tell us if this is, in your oppinion, ready to be submitted to the ED.
Title: Re: seven's Runway Lights (updated to version 1.7 beta)
Post by: [seven] on 21 Mar 2008, 14:23:36
As far as MP/JIP is concerned, the code for that has been tested in previous versions and it works fine, but the code has been cleaned up since then and reqireres re-testing.  Also the rpt file still needs examining, so no, it is not ready.  However, a final version is not far off.