Jump to content
Sign in to follow this  
tpw

TPW CIVS: ambient civilians and traffic for Arma 3

Recommended Posts

20130915: THIS MOD IS NOW PART OF TPW MODS AND IS NO LONGER SEPARATELY MAINTAINED. PLEASE USE THE TPW MODS THREAD TO REPORT BUGS AND REQUEST FEATURES.

TL;DR - Ambient civilians, traffic, boats, aircraft and animals for Arma 3 without modules.

IMPORTANT: SP and (untested) MP client only for the time being.

Download (always contains latest versions of all my mods): https://dl.dropboxusercontent.com/u/481663/TPW_MODS.zip

Readme:

TPW CIVS - Ambient civilians, traffic, boats, aircraft and animals for Arma 3

Version: 1.12

Authors: tpw

Date: 20130914

Requires: Community Base Addons for Arma 3

Description

-----------

I think most of us agree the newly released Altis is a masterpiece, and I have certainly spent many hours on it without even firing a bullet in anger, just admiring the varied scenery and detail. However, one jarring aspect is the complete lack of civilians and livestock, which makes this beautiful island feel dead. Given the lack of ambient civilian and animal modules, I decided to try to write a simple replacement to bring the island back to life.

TPW CIVS actually consists of five independent scripts: one will spawn civs into houses around the player; one will spawn civilian traffic onto roads around the player; one will spawn boats onto the ocean near the player; one will spawn aircraft and one will spawn flocks of goats/sheep/chickens and dogs around the player. Civs, boats and cars will then move to random waypoints, giving the illusion of a (low) population. Animals will move around displaying their default behaviours. There are no other behaviours, they are just there for decoration! All scripts will monitor things to keep a constant number of civs, animals, boats and cars around the player if there are enough appropriate positions for them.

Features

--------

- Gradually spawn civilians into habitable houses within a specified radius of the player.

- Gradually spawn civilian traffic onto roads within a specified distance of the player.

- Gradually spawn animals at appropriate random positions within a specified distance around the player.

- Gradually spawn civilian boats onto the ocean within a specified distance around the player.

- Occasionally spawn ambient flybys of helicopters and jets.

- Civilian/animal/car/boat densiy can be specified (civilian density will halve at night).

- Civilians/cars/boats will move to random house/road/water waypoints respectively, animals will move around with default behaviours.

- If a civilian/car/animal is killed another will spawn.

- Civilians/cars/animals/boats are removed if more than a specified distance from the player.

- Cars/animals will not spawn if a player is near a designated "exclusion object", which can be any editor placed obect. Up to 10 car and 10 animal exclusion objects can be designated. These can be used to keep cars and animals out of military bases, airstrips etc.

- The mission will fail if the number of total or squad inflicted civilian casualties exceed player defined thresholds.

- Civilian cars may be commandeered. Stand in front of an oncoming car and once it stops in front of you a menu item will appear to commandeer it.

- In MP mode, nearby players will "share" civs/cars/animals rather than spawning their own individual set.

- In MP mode, default settings will override individual configurations, so that all players will cause the same level of civ/car/animal generation.

- Each of the ambient civilian, traffic, boat and animal systems can be individually enabled/disabled.

Installation and configuration

------------------------------

Extract the @TPW_CIVS modfolder to your preferred mod location, and call it via command line or mod launcher. You'll need Community Base Addons A3 (CBA A3) for the addon to launch properly.

Copy @TPW_CIVS\userconfig\TPW_CIVS\TPW_CIVS.hpp to your userconfig\TPW_CIVS\TPW_CIVS.hpp. You may edit this file to taste:

tpw_civ_hint = 1; //Start hint. 0 = no hint

tpw_civ_sleep = 5; //Delay (sec) until civ spawning starts

Civs

tpw_civ_density = 5; // How many houses per civ. 0 = ambient civs disabled

tpw_civ_radius = 150; //Radius (m) around player to check for houses and spawn civs

tpw_civ_waypoints = 15; // How many waypoints to assign each civ

tpw_civ_maxsquadcas = 4; // Maximum number of civilian casualties that can be inflicted by squad

tpw_civ_maxallcas = 50; // Maximum number of total civilian casualties

tpw_civ_casdisplay = 0; // What to do if casualty threshold exceeded (0 -nothing, 1 - popup message, 2 - end mission)

Cars

tpw_car_num = 3; // Max number of cars to spawn around player. 0 = ambient cars disabled

tpw_car_radius = 1000; // Radius (m) around player to check for roads and spawn cars

tpw_car_waypoints = 15; // How many waypoints to give each car

Animals

tpw_animal_max = 15; // Maximum animals near player. 0 = ambient animals disabled

tpw_animal_maxradius = 200; // Distance beyond which animals will be removed

tpw_animal_minradius = 75; // Minimum distance from player to spawn animals

Boats

tpw_boat_radius = 1000; // Radius (m) around player to check for water and spawn boats

tpw_boat_waypoints = 15; // How many waypoints to give each boat

tpw_boat_num = 3; // Max number of boats to spawn around player. 0 = ambient cars disabled

Air

tpw_air_time = 300; // Maximum time between flybys

To designate a car exclusion object, enter "tpwcarexc" (no quotes) into the name field of any editor placeable object. This can be a logic, or any other object including moving vehicles. If you don't want to see traffic around any airport you fly into, then you can name your transport aircraft "tpwcarexc". You may designate a maximum of 10 such objects: tpwcarexc, tpwcarexc_1 -> tpwcarexc_9

Animal exclusion objects: tpwanimexc, tpwanimexc_1 -> tpwanimexc_9

Ambient civs, cars, boats and animals can be disabled/enabled mid game via the debug console:

tpw_civ_active=false; // no civilians

tpw_civ_active=true; // civilians

tpw_car_active=false; // no cars

tpw_car_active=true; // cars

tpw_animal_active=false; // no animals

tpw_animal_active=true; // animals

tpw_boat_active=false; // no boats

tpw_boat_active=true; // boats

tpw_air_active=false; // no aircraft

tpw_air_active=true; // aircraft

Note that these commands won't remove already spawned civs/cars/animals.

Script version of the four addons are in @TPW_CIVS\scripts. Instructions for running them are in the header of each script. Please note that if you already have the addon version running, the script version will detect it and quit.

Known issues

------------

TPW CIVS is in very early development, and will contain bugs and plenty of room for improvement.

- To make this mod as light on the system as possible the AI simply wander from waypoint to waypoint, with no other behavioural changes.

- I recommend WW_AICOVER and TPW_EBS if you want civilians to react to nearby combat

- AI civs are poor drivers, and this mod does nothing to improve on that!

- TPW CIVS is guaranteed to work as advertised in SP, and maybe MP client (although this has not been fully tested). It will not run on a dedicated server.

- Stuck or damaged vehicles may occasionally vanish before a player's eyes, even though they have been scripted not to. I am continuing to search for a solution to this.

To do

-----

- Ambient furniture

Feedback

--------

As always I welcome feedback. My mods only improve due to your input. However, input which consists of asking me why there is no dedicated server version, without offering help in this department, improves nothing, especially my temper.

For the record: I only play SP, have little interest in playing MP, little skill in coding MP, and no ability to test it. If you desperately want a fully functioning MP version of this or any of my other mods, and can't wait for me to make it happen, then you are welcome grab the code and knock yourself out.

For the sake of my sanity, when you're reporting bugs and issues can you please tell me:

- Arma3 version

- Version of my mod

- Script or addon version

- Running on SP, MP or dedi

Thanks

------

Bad Benson: MP help and suggestions.

Bashka: class based house detection and waypoint tips.

Woodpeckersam: randomised civ clothing tips.

Changelog

---------

20130914: v1.12

- Ambient aircraft flybys added.

20130913: v1.11

- Ambient boats added.

- Overhauled house detection for civs.

- Localised waypoints for civs tp prevent them walking between towns if the civ radius is large.

- Introduced "all in one" startup hint for all TPW mods, you'll get the one hint showing all active mods.

- Script versions will detect an already running addon and quit.

20130911: v1.10

- Civilians/cars/animals may be separately enabled/disabled mid game.

- Fixed bug in waypoint behaviour.

20130910: v1.09

- Civilan cars may be commandeered.

- Civilians now wear a greater range of clothing (not just the green striped polo shirt).

- Mission failure from excessive civilian causalties now uses "End7".

20130909: v1.08

- Ambient animal functionality added.

20130908: v1.07

- Cars will now drive with limited speed within 150m of player.

- Total and squad inflicted civilian casualties are counted, and will end a mission if they exceed a defined threshold.

- Bugfixes

20130907: v1.06

- Undefined variable bugfix.

- Cars will not be removed if less than 100m from the player, regardless of their visibility status.

20130907: v1.05

- Civilians now only spawn at and travel between habitable buildings (class: land_i_house_).

- Added traffic exclsion capability.

20130905: v1.04

- Updated civilians and cars for dev build 0.77.109751.

20130903: v1.03

- Improved civ and car line of sight conditions for removal.

- "Stuck" cars not visible to player are removed.

- Misc code fixes.

20130901: v1.02

- Some stupid late night coding errors fixed!

20130831: v1.01

- MP undeclared variable bugfixes.

20130830: v1.00

- First addon release, SP and tentative MP client functionality.

Disclaimer

----------

I totally refuse to accept responsibility for anything that might happen to your game/computer/life as a result of using my mod. If you accept this, then feel free to use and modify this code, on the proviso that you post back changes and improvements so that everyone can benefit from them, and acknowledge the original author (tpw) in any derivative works.

My A3 mods:

TPW CIVS: Ambient civs and traffic

TPW FALL: Realistic infantry falling from height and bullet hits

TPW LOS: AI Line of sight system for enhanced CQB

TPW EBS: Engine based AI/player suppression

TPW HOUSELIGHTS: Automatic house lighting for Altis/Stratis

TPW BLEEDOUT: Realistic bleeding system

TPW FOG: Foggy breath for Altis/Stratis

Edited by tpw

Share this post


Link to post
Share on other sites

If BIS does not include CIV or other ambient modules on release I expect you'll be a popular guy!!!

Share this post


Link to post
Share on other sites

Thanks a ton man! I've been missing the civilian site module, especially since the release of Altis.

Share this post


Link to post
Share on other sites

Nice! Was looking for something like that for my exploration hiking tours on Atlis. Thank you tpw! Any chance of ambient animals? (sheeps, dogs, etc).

Share this post


Link to post
Share on other sites

It would be great to have this as an addon instead of script. Much more easier I guess for the noobs :)

Share this post


Link to post
Share on other sites

very nice! downloading right away

edit:

Looks very good. :) However, when you shoot the driver of a vehicle the vehicle gets deleted after a couple seconds. Best would be that the vehicle would stay there so you can take it, and only gets deleted when you're out of its radius. :)

Edited by ltsThomas

Share this post


Link to post
Share on other sites

Tpw, you are a genius, Altis feels populated now. You just saved me tons of time adding ambient civilians manually. Thanks a lot. :)

Share this post


Link to post
Share on other sites
very nice! downloading right away

edit:

Looks very good. :) However, when you shoot the driver of a vehicle the vehicle gets deleted after a couple seconds. Best would be that the vehicle would stay there so you can take it, and only gets deleted when you're out of its radius. :)

Why are you car jacking the poor civilians? LOL

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

Next step to add the Flee behaviour when in range of firefights or is that too much overhead?

Share this post


Link to post
Share on other sites

tpw, great work mate. ^^ agree with ItsThomas about the deletion when outside the radius.

Share this post


Link to post
Share on other sites

This would be so great for my mission if it worked in multiplayer.

Share this post


Link to post
Share on other sites

Nice work Tpw. BIS should ve contacted you a long time ago and make you their employee :D Arma without ur addons and srcipts wouldnt be nearly as enjoyable as it is now :)

Share this post


Link to post
Share on other sites

This is great! But are you planning to add the option to randomise clothing?

Here is an example of my script. There must be a simpler way to pick up clothing in the config but the idea works. And knowing you TPW, you can most certainly do a better job at it.

private ["_hat_item","_civ_clothes","_civ_hats","_unit","_cloth_item"];
waitUntil {!isNil "bis_fnc_init"};

_civ_clothes = ["U_C_Commoner1_1","U_C_Commoner1_2","U_C_Commoner1_3","U_C_Poloshirt_blue","U_C_Poloshirt_burgundy","U_C_Poloshirt_redwhite","U_C_Poloshirt_salmon","U_C_Poloshirt_stripped","U_C_Poloshirt_tricolour","U_NikosBody","U_MillerBody","U_KerryBody","U_OrestesBody","U_C_Novak"];

_civ_hats = ["H_Cap_red","H_Cap_blu","H_Cap_brn_SERO","H_StrawHat","H_Hat_blue","H_Hat_brown","H_Watchcap_blk","H_Cap_surfer"];

_unit = _this select 0;

// Remove original equipment
removeAllWeapons _unit;
removeUniform _unit;
removeHeadgear _unit;
removeVest _unit;
removeBackpack _unit;
_unit unassignItem "NVGoggles";
_unit removeItem "NVGoggles";

// Add clothing
_cloth_item = _civ_clothes call BIS_fnc_selectRandom;
_unit addUniform _cloth_item;

// Random integer, if 1 instead of 0, add a random item from the array

if(round (random 1) == 1) then
{
_hat_item = _civ_hats call BIS_fnc_selectRandom;
_unit addHeadgear _hat_item;
};
exit;

If it ends up being mod compatable, then imagine the amount of clothing mods that can be added to this "module" without you having to script it.

Great work as always TPW :D

Edited by ArmASalt3

Share this post


Link to post
Share on other sites

I have used the civvy script in my mission "Rescue the Doctor", it added so much to it. Now going to add the civilian cars.

TPW, added you to the credits and rightfully so. :)

Share this post


Link to post
Share on other sites

Starting to get a serious man-crush on you tpw.

Civ air traffic in your future?

Edit: getting undefined variable in expression _x for line 136 in tpw_cars

Edited by R.Flagg

Share this post


Link to post
Share on other sites

Edit: getting undefined variable in expression _x for line 136 in tpw_cars

Also getting non-stop spam of undefined variable in expression -errors in both scripts.

Calling them via Init.sqf

nul = [] execvm "civ.sqf";nul = [] execvm "traffic.sqf";

Edited by froggyluv

Share this post


Link to post
Share on other sites
Why are you car jacking the poor civilians? LOL

No doubt. Perhaps someone could adapt SHK's Civ-kill-Counter to work with this. Ya know, hearts and minds.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×