Jump to content
Sign in to follow this  
Simas

Addon idea feedback: Civilian Car Alarms

Recommended Posts

I have been working on an addon that adds civilian car alarms to Arma 3 for a couple of days now (right now just to the Offroad, but in the Beta/Final also for the two extra upcoming civilian vehicles). Now, before you think about GTA and car stealing - please be aware that what I am focusing here is not on this gangster kind of stuff :cool:

Basically, the idea is, that in urban combat the civilian car alarms can be part of combat experience.

How will this work?

Simple. You add a couple of civilian vehicles around Agia Marina in the editor and set the "Vehicle Lock" to "Locked". That's pretty much it. No scripting required. Any locked civilian cars will have alarms enabled by default.

However, besides this editor functionality - 3 additional scripting functions will be provided (in the Functions Library). The functions will allow you to enable or disable or even activate alarms manually with scripting. This also means that you can add car alarms to non-locked vehicles. Although in this case the mechanics will slightly change, since players will be able to enter car alarm enabled vehicles.

How will the alarms trigger?

So far I have three ideas (with working prototypes):

a) On contact. A direct hit will trigger the alarm. A fragment from an exploding grenade will do the same. If the vehicle sustains heavy damage on hit (nearby AT hit or so) - the alarms are not triggered. They are assumed to be destroyed/disabled.

b) Proximity based trigger. I am not exactly sure about this. My idea is to activate the alarm if you are firing a loud weapon close by. Is this even realistic? What should the range be approximately? I do plan to take into account different muzzles (and silencers) for this.

c) How about (very) nearby helicopters triggering the alarms? From down-wash and vibrations?

Disabling the alarm

Once the alarm is triggered - it will play for a limited amount time (1-2 minutes?) and will die off itself. I think I need a compromise here as it would be quite annoying for the alarm to be persistent. Also, once the alarm dies off it is assumed to be disabled (another hit will not activate it again).

Beside this limited time functionality - you will be able to disable the alarm yourself when you are near the car. But this mechanic is slightly different depending on if the car is "locked" or not.

Technical side of things

I have already a working prototype, so I don't think there are any major engine limitations preventing this to be implemented the way I see it. Although, the best way to play that kind of looping alarm sound is with cfgSFX and createSoundSource[], and the latter has a very nasty bug #8231 right now. Please upvote this issue if you have feedback tracker account. (edit: found a workaround for this bug!)

Another minor issue I am having right now is how to make the reflectors/reverse lights blink without producing the high beam headlamp light effect at night. I have a couple of ideas for this but need to test them.

Other notes

- There will be a couple different alarm siren sound effects. I need to balance the range and volume. They will also be persistent per vehicle (meaning if you re-activate - you get the same siren). I also plan to do slight randomization with pitch if the engine will allow this.

- And I plan to make the civilian AI use (enable/disable) the alarm when in "Careless" state.

- The addon will be singleplayer and multiplayer ready (coded with performance in mind).

Sorry for the long post..

So... what do you think? Am I insane? Do you see this as a gimmick? Or do you see this feature as an enhancement to Arma realism and gameplay? Any suggestions?

Edited by simast

Share this post


Link to post
Share on other sites

an alarm sound and the lights going on/ off would be cool. though it's not for all cars. a "poor" takistani vehicle shouldn't have this.

Share this post


Link to post
Share on other sites

It is a really good idea stick with it. This will add some unexpected and needed atmosphere to what are "normal" Arma fights. Just make sure it is a script that you can place on cars pretty easily, for mission makers, or have a random feature that just attaches it to some percentage of certain types of cars.

Share this post


Link to post
Share on other sites

Agree with all the comments above. The ability to select which cars have the alarm (eiher give it a random function or allow mission creators to put a line in the vehicles init box).

This mod would definitely add atmosphere, similar to the tension of avoiding firing on or contact with the cars in the Left for Dead games. Speaking of which, you would be a hero in the DayZ community lol

Share this post


Link to post
Share on other sites

Yep, the basic idea is to have two ways how to enable car alarms:

1) You can force alarm using scripting. Place a car in the editor and put the line in the init field "this call VEP_fnc_enableAlarm" and that car will have a guaranteed alarm enabled on mission start (assuming it's not flying, is not underwater and does not meet other edge case conditions).

2) The second way to enable car alarms is with the "Locked" vehicle status. Place a civilian car and set it to "Locked" in the editor. When you do this - there will be a percentage chance for the car to either have the alarm or not enabled automatically (this also depends on the car, for example offroad is less likely to have car alarms compared to hatchback civilian car versions).

I am thinking of releasing this addon named as "VEP" - short of "vehicle extras project". As I have some extra ideas (beside this car alarm thingy) I want to add to Arma civilian vehicles :)

Edited by simast

Share this post


Link to post
Share on other sites
an alarm sound and the lights going on/ off would be cool. though it's not for all cars. a "poor" takistani vehicle shouldn't have this.

what takistani?

Share this post


Link to post
Share on other sites

And then ... zombies swarming in from all directions :eek:

Share this post


Link to post
Share on other sites

Well I have an aftermarket exhaust on my car and it causes the occasional alarm to go off, love it. I like the idea but I suggest making a set of code ghat can be applied to any vehicle for possible future vehicle packs. Firing an m4 probably wont trigger a car alarm but possibly a 50 cal. Just food for thought.any weapon that you can "feel" while firing I would say. M4 is like a toy... pew pew pew. But awesome mod, its the details that count.

Share this post


Link to post
Share on other sites

I can never duplicate it on demand, however...

someone, i think Zguba, made a .pbo that had included in it scripts that placed a car alarm on randomly spawned vehicles from the bis vehicle module. I can think of several instances where upon getting a vehicle an alarm went off.. I just about s#$t myself.

Share this post


Link to post
Share on other sites

Sounds like an awesome addition, especially with the much more "dense" Altis. Depending on how people set up their streets in the editor, it could make for interesting gameplay. Not to mention some kind of degree to stealth, don't want to be hitting parked vics when you're supposed to be snoopin' around. :P

Share this post


Link to post
Share on other sites

A quick update on this:

Made lots of progress on this lately. It's turning better than I originally thought it will be.. :cool:

I am using 5 sound samples for alarms right now (+ turn off "beeps").. each having 3 different pitch levels. That makes for 15 unique car alarm sounds already. Also, when assigning alarm sounds they are distributed to be unique (rather than with pure randomness) and basically if you have 5 cars in town - they will all sound differently.

Here is what's left:

- Night time lighting (still fighting the issue how to disable beam head lights during the night). I also want to add extra dynamic lighting (with lightAttachObject/lightDetachObject).

- Turn off mechanics when the cars are not locked (technically all you will need to do is "get in", wait for an animation and the car alarm will turn off after awhile).

- I want to add car alarm triggers based on shock waves (rather than direct shrapnel hits). There isn't really a direct event handler for this in Arma, but maybe I can figure out some sort of a workaround.

- And multi-player testing..

Once the night time issues are resolved I will make a quick YouTube video showing the results..

sounds good!! Curious about your other ideas. :)

Well, at least two things are on my mind right now (also kind of prototyped to make sure they are possible within Arma engine):

- Vibrations and shakes (especially for helicopters: downwash vortex, RPM build-up, damage effects, near Vne)

- Simple turn indicators (and convoy lights?) + AI integration

.. but this stuff is for the future - once I am done with car alarms :)

Share this post


Link to post
Share on other sites

Hey simast,

Get to the light off you can use this code "player action ["lightOff", vehicle player]" where vehicle player is the name of the car.

I don't think shockwaves are in the game but you could just put an event handler Firednear "FiredNear

Share this post


Link to post
Share on other sites
Get to the light off you can use this code "player action ["lightOff", vehicle player]" where vehicle player is the name of the car.

Well, that's what I am already doing to make the lights blink during alarm. It works really well in daylight when there are no high beam lights (Arma 3 vehicles do not cast any lights during the daylight). On nights however the lights are way too extreme for a car alarm.. Basically - what I am trying to do is keep the regular lights (think "reflectors") without the high beam light effect. I tried something like "myCar setHit ["light_r", 1]" to disable individual light parts - but my quick testing did not seem to work as intended (I suspect there is a bug with setHit and light selectors..).

Share this post


Link to post
Share on other sites

Oh I see what you are saying, you don't want the headlights to turn on but the warning lights.

Found this in the Six Config Browser

	class Reflectors {
	class Left {
		ambient[] = {0.1, 0.1, 0.1, 1};
		brightness = 0.5;
		color[] = {0.9, 0.8, 0.8, 1};
		direction = "konec L svetla";
		hitpoint = "L svetlo";
		position = "L svetlo";
		selection = "L svetlo";
		size = 0.5;
	};
	class Right {
		ambient[] = {0.1, 0.1, 0.1, 1};
		brightness = 0.5;
		color[] = {0.9, 0.8, 0.8, 1};
		direction = "konec P svetla";
		hitpoint = "P svetlo";
		position = "P svetlo";
		selection = "P svetlo";
		size = 0.5;
	};
};

You may have to call it by the slavic... in this case, "L svetlo" and "P svetlo"

Share this post


Link to post
Share on other sites

Well, the Offroad Reflector class definition in Arma 3 is:

class Reflectors
{
class Left
{
	color[] = {1900,1800,1700};
	ambient[] = {5,5,5};
	position = "Light_L";
	direction = "Light_L_end";
	hitpoint = "Light_L";
	selection = "Light_L";
	size = 1;
	innerAngle = 100;
	outerAngle = 179;
	coneFadeCoef = 10;
	intensity = 1;
	useFlare = 0;
	dayLight = 0;
	flareSize = 1.0;
	class Attenuation
	{
		start = 1.0;
		constant = 0;
		linear = 0;
		quadratic = 0.25;
		hardLimitStart = 60;
		hardLimitEnd = 120;
	};
};
class Right: Left
{
	position = "Light_R";
	direction = "Light_R_end";
	hitpoint = "Light_R";
	selection = "Light_R";
};
class Right2: Right
{
	position = "light_R_flare";
	useFlare = 1;
};
class Left2: Left
{
	position = "light_L_flare";
	useFlare = 1;
};
class Right3: Right2
{
	position = "light_R_flare2";
	flareSize = 0.3;
};
class Left3: Left2
{
	position = "light_L_flare2";
	flareSize = 0.3;
};
};

So as you can see - "Light_R" and "Light_L" are the headlight selections. You can also use the myCar selectionPosition "Light_L" trick to check if the slection is valid in P3D model (it should return a non [0,0,0] position).

That's why I am saying there is a bug with setHit and lights.. I will do some more testing and will report the issue on the feedback tracker. Still, thanks for trying to help! :)

Edited by simast

Share this post


Link to post
Share on other sites

Yeah, confirmed, setHit - setHitPointDamage, both don't work on the Offroad and the Hunter.

The Event handler does fire off when the car is shot and does log the event

T=3.725 : [39f3a040# 163319: offroad.p3d,"light_l",0.915594,B Alpha 1-1:1 (Brick),"B_65x39_Caseless"]

T=3.725 : [39f3a040# 163319: offroad.p3d,"light_r",0,B Alpha 1-1:1 (Brick),"B_65x39_Caseless"]

T=3.725 : [39f3a040# 163319: offroad.p3d,"light_l",0.915594,B Alpha 1-1:1 (Brick),"B_65x39_Caseless"]

T=3.725 : [39f3a040# 163319: offroad.p3d,"light_r",0,B Alpha 1-1:1 (Brick),"B_65x39_Caseless"]

T=3.725 : [39f3a040# 163319: offroad.p3d,"light_l",0.915594,B Alpha 1-1:1 (Brick),"B_65x39_Caseless"]

Share this post


Link to post
Share on other sites

Also note how the "Dammaged" event is fired 3 times (identical) for the Offroad on the headlights - this is another issue I have reported as bug #8736. As for setHit not working with headlights - I have submitted a new bug #8797.

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  

×