Jump to content
Sign in to follow this  
joejoe87577

Helipad Light Script

Recommended Posts

Hi everyone,

this is my first script release so please be Patient with Errors or bugs ;)

The script does the following, it creates lights around a helipad for a better visibility at night and if the helipad is set to invisble the lights also give a good visibility at daytime.



jos4.jpg

b4gw.jpg

And the mirror (Google Drive link): Helipad v.4

news_download_a3_3.png

The Armaholic link may not always be up to date, please compare the Versions!

Current Version: 0.4

Usage:

		
		Copy the Folder "helipad_lights" to your mission folder or mission script folder if you have one.
		Take a look at the example mission to see how to use this script.

	  ///////////////////
	  //Single Helipad://
	  ///////////////////

			null = [this, "yellow", "green", false, "scripts"] execVM "scripts\helipad_lights\helipad_light.sqf";

		Copy this into the init line of the helipad.
		The parameters are:
			helipad: helipad object (this or name of helipad)
			innerlightcolor: string innerlight color (red, green, yellow, blue(not recommended), white(not recommended), bir (blufor), oir (blufor), iir (resistance))
			outerlightcolor: string outerlight color (red, green, yellow, blue, white, bir (blufor), oir (blufor), iir (resistance))
			showhint (optional): boolean show a hint after creation
			scriptFolder (optional): string Foldername of Scripts
							 e.G.: missionfolder\scripts\helipad_lights	the parameter would be "scripts"

		!scriptFolder is very Important, always include this parameter if your script folder is not the mission root folder!
		--------------------------------------------------------------------------------------------------------------------

	  /////////////////
	  //All Helipads://
	  /////////////////

		if (isServer) then {
			null = [5, "scripts"] execVM "scripts\helipad_lights\helipad_light_auto.sqf";	
                       };

		Copy this into your init.sqf, if you do not have a init.sqf create one and copy it to your mission root folder.
		The parameters are:
			createType: number defines on which types of helipads the lights will be created
						1: Helipad (Circle)
						2: Helipad (Civil)
						3: Helipad (Rescue)
						4: Helipad (Square)
						5: all Helipads (excluding invisible Helipads)
			scriptFolder (optional): string Foldername of Scripts. 
							 e.G.: missionfolder\scripts\helipad_lights	the parameter would be "scripts"

		!scriptFolder is very Important, always include this parameter if your script folder is not the mission root folder!
		--------------------------------------------------------------------------------------------------------------------

	  //////////////////
	  //Remove Lights://
	  //////////////////

			null = [helipadName] execVM "helipad_lights\helipad_light_remove.sqf";

		Copy this into your trigger or script, where the lights should be deleted.
		--------------------------------------------------------------------------------------------------------------------

Zip Content:

- helipad_lights_example.Stratis (Example Mission)

- helipad_light.sqf

- helipad_light_auto.sqf

- helipad_light_remove.sqf

- SHK_moveObjects.sqf

- helipad.jqg

- helipad_2.jqg

- readme.txt

Known Errors:

- If there are other helipads close to the helipad the positions of the lights are messed up

- Not fully tested in MP yet

- With the ALiVE Mod, the lights get recreated and messed up! You have to try it, and see if it works until I have a fix for this.

Changelog:

v.1 initial release

v.2

bugs:

- If vehicle is on the helipad the lights were not created correctly

- showhint parameter is now optional

- lightpoints created around the innerlights

- added IR strobes as possible lights

v.3

added:

- SHK_moveObjects Script to set the direction of the lights

- new optional paramter: ScriptFolder

- helipad_light_remove script to remove lights from a helipad

- helipad_light_auto script to create lights for all helipads

v.31

added:

- Helipad (Circle), Helipad (Civil) and Helipad (invisble) now have lights positioned as a circle around them

v.32

added:

- isServer to prevent multiple clients call the script in mp

- #lightpoints removed

- vehicles on helipads do now stay there during the whole creation of the lights

v.4

added:

- IR Strobes can now be deleted

- changed classnames for IR Strobes from B_IRStrobe to NVG_TargetW, O_IRStrobe to NVG_TargetE, I_IRStrobe to NVG_TargetC

Happy Holidays everyone

Edited by JoeJoe87577
Update Jan 05 2014

Share this post


Link to post
Share on other sites

interesting, i was thinking about to work on something like that :)

Share this post


Link to post
Share on other sites

Gald to hear you guys like it. The next steps will be Fixing the annoing bug with the missplaced lights (i've already calculated everything by Hand but i couldn't find any error...) and make it rotatable, until now it is only possible to have the helipad face at 0°.

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Little Update, i'm struggeling with the calculation but i'll get this soon. Here a Little update, i've added small lightpoints to the lamps:

b4gw.jpg

Share this post


Link to post
Share on other sites

An excellent script.

Any chance you can add an option to make the lights available infra-red strobe only, i.e. only visible to night vision?

Share this post


Link to post
Share on other sites

Yes that should be possible, but i can't create the IR strobes via createVehicle, it works with any other grenades but i doesn't work with any strobes.

Edit: Found the solution, had the wrong classname :D, i'll make an update and post the files here.

---------- Post added at 17:51 ---------- Previous post was at 17:37 ----------

I've updated the first post.

Changes in v.2:

bugs:

- If vehicle is on the helipad the lights were not created correctly

added:

- showhint parameter is now optional

- lightpoints created around the innerlights

- added IR strobes as possible lights

Edited by JoeJoe87577

Share this post


Link to post
Share on other sites

Joejoe, would it be possible to make it into an addon, so that all Helipads are lit up as nicely as you have it ?

Share this post


Link to post
Share on other sites

Very nice.. what about the ability to also 'delete' the lights say via trigger or some other way of toggling on/off?

Share this post


Link to post
Share on other sites
Guest

Updated version frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Good news everyone. I've been working on an update with many new features :

- Auto creation of Lights for all helipads at mission start

- Rotating lights is now possible (using SHK moveObject script, but waiting for the permission)

- deleting lights is now possible

- example mission and readme now available

I'll post it soon.

I would love to do this for airdrops as well.

Could you please explain what you mean? You can create those lights on every position you want by placing an invisible helipad and calling the script with the name of the helipad.

Share this post


Link to post
Share on other sites

I've updated the first post to Version 0.31. The zip File now contains a complete readme and an example Mission.

I don't have a decdicated Server, so I can't test it in MP by myself.

Share this post


Link to post
Share on other sites

Lights look great ! Would also be good to spawn a chopper in the mission so we can see what it looks like from above :)

Share this post


Link to post
Share on other sites

Still having issues with choppers being placed on the pads in an MP DS enviroment. Too many lights are being created.

Steam screenshots (warning: large)

1

2

3

Edit: Further testing in an MP DS environment. When someone connects to puts more of the lights down. Every time someone connects, which causes the helos to explode for some reason. As seen in the three screenshots below (again steam screens: warning large):

1

2

3

I hope that stuff helps.

Edited by SpectreRSG

Share this post


Link to post
Share on other sites

I'll set up a virtual machine and install a get a Server running. I'll take look at These issues.

Share this post


Link to post
Share on other sites

for prevent dublication of lights you can use this . i use this for my needs and working.... the only thing is that i dont know if the missionnamespace command is for multiplayer . (i hope it is because i need to use my scripts for multi..... not tested yet on dedi... i have more importand things to solve before this......)

if (isNil {missionNamespace getVariable "hlight"}) then
{
hlight_array = []; // Define once
if ((count hlight_array) == 0) then
{
...your  block of code for light creation...
hlight_array set [(count hlight_array), _innerLight];
hlight_array set [(count hlight_array), _light];
missionNamespace setVariable ["hlight", hlight_array];
};
};


/*// for delete use this 
if (!isNil {missionNamespace getVariable "hlight"}) then {{ hlight_array = hlight_array - [_x]; deleteVehicle _x;} forEach hlight_array; hlight = nil;};
*/

i m new to scripting, and sorry if this is not for your needs

Edited by dragonsyr

Share this post


Link to post
Share on other sites

I found another quick fix. In your init.sqf add:

if (isServer) then { 
null = [5, "scripts"] execVM "scripts\helipad_lights\helipad_light_auto.sqf";
};

This will prevent that every Client Triggers this script. I've tried it on a dedicated Server without the this and had the same Problems. After adding this to my init sqf, the choppers stayed in one Piece :D

To the positioning issue, i'm still working on this one. It seems, that when you or any object are to Close to the helipad the positions get messed up. Maybe it is for safety reasons, that you can't create a vehicle to Close to Players, ais or other vehicles...

First Post updated!

@SpectreRSG:

How do you create the choppers? Did you just place them in the Editor, or do you create them with a script?

Share this post


Link to post
Share on other sites

@joejoe ... here is my lightpad.sqf that you can use without positioning problems. You can use it at any point and is on the

pad

_helitarget = pad; //helipad in mission editor
_lightType = "Chemlight_green";
_target_pos = getPos (_helitarget);

if (isNil {missionNamespace getVariable "hlight"}) then
{
hlight_array = []; // Define once
if ((count hlight_array) == 0) then
{
_chemlight = _lightType createVehicle [getPos _helitarget select 0, getPos _helitarget select 1,1];
_ang = 0;
_rad = 6.5; //radius
_outrad = 11;// outer radius
_bcount = 9; //number of lights
_outbcount =9;//number of lights out
_inc = 360/_bcount; 
for "_i" from 0 to _bcount do
{
_a = (_target_pos select 0)+(sin(_ang)*_rad);
_b = (_target_pos select 1)+(cos(_ang)*_rad);
_pos = [_a,_b,_target_pos select 2];
_ang = _ang + _inc;
_light = "Land_Flush_Light_yellow_F" createVehicle _pos; //Chemlight_green  //Land_runway_edgelight
_light setPos _pos;
hlight_array set [(count hlight_array), _light]; // Add to array
hlight_array set [(count hlight_array), _chemlight];

};
for "_i" from 0 to _outbcount do
{
_a1 =(_target_pos select 0)+(sin(_ang)*_outrad);
_b1 = (_target_pos select 1)+(cos(_ang)*_outrad);
_pos1 = [_a1,_b1,_target_pos select 2];
_ang = _ang + _inc;
_light1 = "Land_runway_edgelight_blue_F" createVehicle _pos1; //Chemlight_green  //Land_runway_edgelight
_light1 setPos _pos1;
hlight_array set [(count hlight_array), _light1];
missionNamespace setVariable ["hlight", hlight_array];
};};};
//[] execvm"lightpad.sqf";
//if (!isNil {missionNamespace getVariable "hlight"}) then {{ hlight_array = hlight_array - [_x]; deleteVehicle _x;} forEach hlight_array; hlight = nil;};

maybe this help????

Share this post


Link to post
Share on other sites

Thanks mate, but i found another solution by using the SHK moveObject Script and some other code tweaks :D. I'll post an update soon.

Share this post


Link to post
Share on other sites
Guest

Updated version frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×