Jump to content
william516

Help getting police and ambulance emergency lighting to work.

Recommended Posts

I have checked tons of places and still can not figure this out.  I went as far as downloading and trying to reverse engineer a .pbo file for the ARMA3 Swat 4 style game.  This is on the workshop.  It basically attempts  to turn ARM3 into the older SWAT 4 game.  All im trying to do is get the lighting on downloaded and default police and ambulances to work by AI.  I wanted to create an atmosphere of chaos where police have barricaded off many streets of the town for a mission.  In the swat mission mentioned above they have vans and the offroad truck with flashing lights.  I checked and they had this in the init field: 

 

"CIV action ["lightOn",  this]; "  I tried this in the init of the van and it did nothing.  I even changed this to the name of the van example van_1.  I cant figure out why this does not work.  I looked at the different scripts and could not find a script that dealt with the lighting in the mission.

 

I looked online and found a youtube video showing codes used in an addon car that should work but for the life of me i can not figure out where the car pbo file is in the steam folder or ARMA3.  Also cant find the exact truck used in the video.  I did notice that the van that the SWAT mission is using is apparently one that is a DLC van.  I placed it in an empty VR map and when i walked up to it it said that i could not get in it.  Not sure if that makes a difference in lighting or not.  I tried also with the default ambulance and offroad truck with light bar.

 

I also tried 

vehicle animate ["BeaconsStart", 1];  in the init field of multiple vehicles but it did nothing.  I replaced vehicle with the vehicle name Van_1.  I tried this on the vans and the offroad trucks etc.  I must be missing something simple.  It can not be that hard to simply get flashing lights on vehicles.  

 

The only other though i had was to try and use lighting effects and attach them to the vehicle or another object nearby just to give the scene a red and blue flashing effect.  I'm not sure what i would do in that case.  I downloaded an  editor that works in conjunction with eden editor that should allow me to place effects but when the editor first starts "eden editor"  I get error messages referencing the effects editor.  I also can not add anything to even after reading the manual.  Im still trying to work through that as the editor seems like an awesome tool and idea.

 

Asking for help in explaining how to get the ambulance van, trucks, and police cars lights to work in a SP mission used by the AI.  These vehicles are parked, they do not need to move at this point.  If this is not possible can some explain how to get a light source to flash red and blue pattern on the scene or buildings so it at least "looks" like there are a ton of emergency vehicles on the scene.

 

I have limited scripting skills but can usually get stuff to work with help over time.

 

Thanks again.  i know that the information is a little vague but im not at my computer right now to get all the codes i have tried or the name of the program that allows editing of lightsources and emitters.

 

Bill

Share this post


Link to post
Share on other sites

The vanilla police vehicles lights do not put out red, and blue light, but if you want to use them anyway.

 

If you want the lights on from the start, just put this in the init field.

 

For the Police Offroad

this animate ["BeaconsStart", 1]; 

 

For the Police, and Ambulance Vans

this animateSource ['lights_em_hide',1];

 

 

To turn on siren for Offroads, and Vans

 

Turn siren on

[this,'CustomSoundController1',1,0.2] remoteExec ['BIS_fnc_setCustomSoundController'];

 

Turn siren off

[this,'CustomSoundController1',0,0.4] remoteExec ['BIS_fnc_setCustomSoundController'];

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you i will give this a try and see if it works.   I was trying to use the 3ditor to add light sources but that does not work because i can not press the insert key to add anything.  

 

 

I just tried this and found that the 

this animate ["BeaconsStart", 1];   code works for most offroads trucks.  

 

this code

this animateSource ['lights_em_hide',1];  This one does not work and results in a message that says "INIT" with a large exclamation mark in a triangle.  I can not enter it.  I tried changing this to the vehicle name like van1.  Results were the same im not sure what the INIT error is for.

 

 

Edited by william516
give results

Share this post


Link to post
Share on other sites
3 hours ago, william516 said:

Thank you i will give this a try and see if it works.   I was trying to use the 3ditor to add light sources but that does not work because i can not press the insert key to add anything.  

 

 

I just tried this and found that the 

this animate ["BeaconsStart", 1];   code works for most offroads trucks.  

 

this code

this animateSource ['lights_em_hide',1];  This one does not work and results in a message that says "INIT" with a large exclamation mark in a triangle.  I can not enter it.  I tried changing this to the vehicle name like van1.  Results were the same im not sure what the INIT error is for.

 

 

 

I tested everything before I posted, and it worked for me.

 

this animateSource ['lights_em_hide',1];

 

^^^ Is for the police, and ambulance vans. The above code goes in the init field of the van. 

 

You can also turn on the beacons by right clicking on the vehicle, then click on "Edit Vehicle Appearance". From there you can turn on the beacons. 

Share this post


Link to post
Share on other sites

It's the strange case of spot the difference, I can't see it but one works the other doesn't

 

this animateSource ['lights_em_hide',1]; // william516 doesn't work

this animateSource ['lights_em_hide',1]; // stburr91 does work

  • Like 1

Share this post


Link to post
Share on other sites
22 hours ago, william516 said:

The only other though i had was to try and use lighting effects and attach them to the vehicle or another object nearby just to give the scene a red and blue flashing effect.  I'm not sure what i would do in that case.  I downloaded an  editor that works in conjunction with eden editor that should allow me to place effects but when the editor first starts "eden editor"  I get error messages referencing the effects editor.  I also can not add anything to even after reading the manual.  Im still trying to work through that as the editor seems like an awesome tool and idea.

 

 

Thanks again.  i know that the information is a little vague but im not at my computer right now to get all the codes i have tried or the name of the program that allows editing of lightsources and emitters.

 

Bill

 

Is this the red, and blue lighting effect you are trying to achieve?

 

 

 

 

4 minutes ago, f2k sel said:

It's the strange case of spot the difference, I can't see it but one works the other doesn't

 

this animateSource ['lights_em_hide',1]; // william516 doesn't work

this animateSource ['lights_em_hide',1]; // stburr91 does work

 

 

Sometimes when you copy/paste from the forums, weird things can happen. 

  • Like 1

Share this post


Link to post
Share on other sites

The video above is pretty much exactly what Im trying to achieve with different patterns.  The second line of code worked even when copied and pasted.  I did however write that in manually.  It shows and works correctly.  I did notice that it simply seems to flash lights or textures but does not have any surrounding affect.  So no matter what it looks like i will need to add light sources to light up the surrounding area.  How would i go about taking light sources to work similar to what i see in the video above.  I'm assuming it would have to be coded.  

The 3ditor emitter editor does not work.  I tried pressing the INSERT key and i can not add effects.  So im stuck using using attachto i guess.  Have any good hints.

 

Thanks again for all your help.

Share this post


Link to post
Share on other sites
19 hours ago, william516 said:

The video above is pretty much exactly what Im trying to achieve with different patterns.  The second line of code worked even when copied and pasted.  I did however write that in manually.  It shows and works correctly.  I did notice that it simply seems to flash lights or textures but does not have any surrounding affect.  So no matter what it looks like i will need to add light sources to light up the surrounding area.  How would i go about taking light sources to work similar to what i see in the video above.  I'm assuming it would have to be coded.  

The 3ditor emitter editor does not work.  I tried pressing the INSERT key and i can not add effects.  So im stuck using using attachto i guess.  Have any good hints.

 

Thanks again for all your help.

 

 

Here's an example mission with the light effect.

 

 

 

This is a quick example, I'm sure there are many (maybe better) ways of running the lighting loop. 

 

Click on the red, and blue lamps to see the code to make the lights blink. 

Share this post


Link to post
Share on other sites

Thanks again i will check this out and see what i can come up with and let you know.  I appreciate all the help again.

  • Like 1

Share this post


Link to post
Share on other sites

I wanted once again to say thank you for the help.  What i thought would be a simple process is apparently harder then what i thought.  It looks like the script you put in is basically turning on a or spawning a light-source and then deleting it using a sleep command between to regulate the pattern.  Adjusting the sleep time seems to make things go faster or longer depending on the time set.  I never though that you would have to spawn and delete just to make this work.  I'm assuming this would make simulating all the different light sources from cars very hard on the computer and frame rates, because it has to constantly spawn and delete.

 

It also appears that these are not attached to the vehicle and therefore will not move with the vehicle and if the vehicle is destroyed they remain working.  Is there a way to attach the light-sources to the vehicle so that when the vehicle moves they would also move.  what i tried to do did not work and the global attach with 3ditor does not work and causes a CTD.  Really sucks because that looked like the easiest way to do things.

 

The other question i had was about shutting the siren down.  I noticed that you set the vehicle to "combat"  when it switched to combat it shut the siren down and also the vehicle headlights.  Is there a way to simply shut the siren off without causing the vehicle to go into combat mode, or should i simply add a sleep command and then set the vehicle back to safe or careless.  

 

Thanks once again for all the help, im starting to see how things work and appreciate the time and effort.

  • Like 1

Share this post


Link to post
Share on other sites
12 hours ago, william516 said:

I wanted once again to say thank you for the help.  What i thought would be a simple process is apparently harder then what i thought.  It looks like the script you put in is basically turning on a or spawning a light-source and then deleting it using a sleep command between to regulate the pattern.  Adjusting the sleep time seems to make things go faster or longer depending on the time set.  I never though that you would have to spawn and delete just to make this work.  I'm assuming this would make simulating all the different light sources from cars very hard on the computer and frame rates, because it has to constantly spawn and delete.

 

It also appears that these are not attached to the vehicle and therefore will not move with the vehicle and if the vehicle is destroyed they remain working.  Is there a way to attach the light-sources to the vehicle so that when the vehicle moves they would also move.  what i tried to do did not work and the global attach with 3ditor does not work and causes a CTD.  Really sucks because that looked like the easiest way to do things.

 

The other question i had was about shutting the siren down.  I noticed that you set the vehicle to "combat"  when it switched to combat it shut the siren down and also the vehicle headlights.  Is there a way to simply shut the siren off without causing the vehicle to go into combat mode, or should i simply add a sleep command and then set the vehicle back to safe or careless.  

 

Thanks once again for all the help, im starting to see how things work and appreciate the time and effort.

 

The red, and blue light sources are placeable lamps in the editor. I placed the lamps, named them rl1, and bl1, I'm not spawning, and deleting them, I ran a simple script to show, and hide them. Click on rl1, and bl1 to see the simple script I put in their init fields to make them show, and hide. I don't think using several sets of red, and blue lights would be all that cpu intensive. 

 

Unfortunately attaching light sources causes problems in Arma, the lights lag, and flicker when you move, and the attachto command does use computer resources, so it's not recommended in this situation. I was under the impression that you wanted static lighting effects to create immersion at a "crime scene" for your mission. I would recommend that you just use the vanilla beacon lights for moving vehicles, and the red, and blue lights for static lighting effects. 

 

Turning off the siren is done using the command,  [Name of your vehicle here,'CustomSoundController1',0,0.4] remoteExec ['BIS_fnc_setCustomSoundController'];

 

In my example I set the ambulance driver to "combat" so he would shut off the headlights, as that is the easiest was to get the AI to turn headlights off. 

Share this post


Link to post
Share on other sites

No what you did was perfect for ambient lighting,  i was just wondering what it took to get the lighting effects attached to a vehicle.  Thank you once again, i will look into the attachto command just to try it and see how it performs.

 

 

Share this post


Link to post
Share on other sites
23 hours ago, william516 said:

No what you did was perfect for ambient lighting,  i was just wondering what it took to get the lighting effects attached to a vehicle.  Thank you once again, i will look into the attachto command just to try it and see how it performs.

 

 

 

 

I tested attaching the red, and blue light lamps, and it works pretty well. 

Share this post


Link to post
Share on other sites

What mission do i choose.  The link takes me to a steam workshop but im not sure what file to try out.

Share this post


Link to post
Share on other sites
1 hour ago, william516 said:

What mission do i choose.  The link takes me to a steam workshop but im not sure what file to try out.

 

I didn't upload the mission file where I did the test of attaching the lights.

 

If I have time tomorrow I'll upload the mission file with the lights attached.

Share this post


Link to post
Share on other sites
On 1/22/2020 at 3:40 PM, william516 said:

Ok thanks again.

 

Here's a link to an example mission with the lights attached.

 

I used  "BIS_fnc_attachToRelative"  to attach the red, and blue lights, so you can adjust the lights however you want them in the editor, and that's how they will attach.

 

I would recommend that you save the truck, and lights as a composition, that way you can easily place it in your mission. 

 

 

 

Share this post


Link to post
Share on other sites
On 1/18/2020 at 5:35 PM, stburr91 said:

The vanilla police vehicles lights do not put out red, and blue light, but if you want to use them anyway.

 

If you want the lights on from the start, just put this in the init field.

 

For the Police Offroad

this animate ["BeaconsStart", 1]; 

 

For the Police, and Ambulance Vans

this animateSource ['lights_em_hide',1];

 

 

To turn on siren for Offroads, and Vans

 

Turn siren on

[this,'CustomSoundController1',1,0.2] remoteExec ['BIS_fnc_setCustomSoundController'];

 

Turn siren off

[this,'CustomSoundController1',0,0.4] remoteExec ['BIS_fnc_setCustomSoundController'];

 

this works perfectly! Thank you very much! :)

  • Like 2

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

×