Jump to content
Sign in to follow this  
TRexian

WIP JTD Ambient Civilian Traffic module

Recommended Posts

Updated 17 Nov

@ moderators - this could probably be moved to the complete section, now. :) Or, let me know if I should start a new thread.

@ everyone else - here is a link to the latest version, we'll call this a Release Candidate. :) Version 01d. It has a key, and a signature, and a readme. This is my first attempt at putting that package together, though, so there is a significant chance I got it wrong.

http://www.mediafire.com/file/czntmhojy5z/JTD_ACTON_01d.7z

Mirrors are welcome (or you may want to wait until it becomes an actual release - your call)! :)

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

I want to change the icon (have one almost ready), and figure out what issues/tweaks there may be.

The zip has 2 files, the pbo and the hpp. The pbo goes into the \addons\ subfolder of your choice (ideally, @JTD\addons\) and the hpp goes into \userconfig\JTD\ just like the FireAndSmoke addon uses.

The hpp has the following user-customizable parameters. (Unlikely anyone will really tweak these, but you never know.)

//Config settings for JTD_ACTON - ambient civilian traffic module.

// define percentage (zero to 1) of ALICE-spawned civs that will spawn traffic

// value greater than 1 becomes 1

// default is 1

#define JTD_ACTON_percent 1

// Traffic maximum concurrent vehicles allowed.

// default 50

#define JTD_ACTON_max 50

// Max cargo allowed percentage (zero to 1) - will modify randomization of cargo amount

// default 1

#define JTD_ACTON_maxCargo 1

// Minimum cargo allowed percentage (zero to 1) - will modify randomization of cargo amount

// default 0

#define JTD_ACTON_minCargo 0

// default vehicles

// can add custom vehicles by adding the "name"

// note that if you add a vehicle with a "crew" (like a military vehicle) the entire crew will spawn

#define JTD_ACTON_DEFAULT_vehicles ["Ikarus", "hilux1_civil_1_open", "hilux1_civil_2_covered", "hilux1_civil_3_open", "Lada1", "Lada2", "LadaLM", "car_hatchback", "car_sedan", "datsun1_civil_1_open", "datsun1_civil_2_covered", "datsun1_civil_3_open", "Skoda", "SkodaBlue","SkodaRed", "SkodaGreen", "tractor", "tractorOld", "UralCivil", "UralCivil2", "VWGolf", "TT650_Civ"]

// default civilians

// can add custom civs by adding the "name"

#define JTD_ACTON_civs ["Assistant", "Citizen4", "Profiteer2", "Functionary1", "Functionary2", "Citizen1", "Citizen2", "Citizen3", "Doctor", "Profiteer1", "Profiteer3", "Profiteer4", "RU_Assistant", "Rocker1", "Rocker2", "Rocker3", "Rocker4", "SchoolTeacher", "Villager1", "Villager2", "Villager3", "Villager4", "Woodlander1", "Woodlander2", "Woodlander3", "Woodlander4", "Worker1", "Worker2", "Worker3", "Worker4"]

// Define percentage (zero to 1) of time spawned civ will be armed with AK

// default is .5; make 0 if no civs to be armed

#define JTD_ACTON_civAK .5

Couple things - I had to create an array of civilians because the BIS function spawnGroup doesn't appear to spawn civilians.

http://forums.bistudio.com/showthread.php?t=89751

Beware - as we know, the drivers education courses in Chernarus leave much to be desired:

ACT_accident1-1.jpg

And yes, you can arm some of the civilians. In most places where there is conflict, the civilians at least have access to some kind of firearm (usually an AK). At this point, this only affects the civs spawned for the vehicles, but I've used it in a different context to arm ALICE civs.

Sometimes they get out of their vehicles:

ACT_beCareful-1.jpg

Also, there is a likelihood that some of the passenger seats will also be occupied by riders. Carpooling is important for the environment, even in Chernarus!

Otherwise, it is pretty simple.

Place the ALICE module. Place the JTD Ambient Civilian Traffic module. Go from city to city and see the civs drive around.

There are certain things logged to the rpt.

Feedback welcome.

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

Also:

It probably requires CBA/XEH. I used DMarkwick's FireAndSmoke addon for a bunch of stuff, and his requires it. And, if you don't have it anyway, you probably should.

It *MIGHT* actually be MP compatible out of the box. Should be run on the server, as if it is run on a client, it should exit without doing anything (or more accurately, only execute the substantive parts if it is being run on a server).

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

Thanks/credits:

JTD

-- DMarkwick

-- ReconPathFinder

-- TRexian

OFPEC

SNKMAN for his posts about the module config

Rommel @ OFPEC for ideas

Edited by TRexian
Updated

Share this post


Link to post
Share on other sites

Nice! Works like a charm... takes away alot of hassle placing (and configuring) the ambient life modules.

Only 1 question is it possible not to write the "ACT started" and "cargo assigned" entries in arma2.rpt, gives less overview when troubleshooting my scripts :D

Edited by DTM2801

Share this post


Link to post
Share on other sites

Cool, I'll fire this up tonight. I've got a bit tired of waypointing civvie vehicles in my missions just to add a little local "colour"...

Share this post


Link to post
Share on other sites
Nice! Works like a charm... takes away alot of hassle placing (and configuring) the ambient life modules.

Only 1 question is it possible not to write the "ACT started" and "cargo assigned" entries in arma2.rpt, gives less overview when troubleshooting my scripts :D

hehe

Indeed. :) Don't worry - next version those'll be out. (Well, I'll probably leave in the started/ended stuff.) ;)

The running total of cars created will be out, too. That's in there pretty much for testing.

Also - I forgot to mention I've tested this only on the released 1.04. Oh, and it probably needs CBA/XEH... *probably* should've mentioned that in the original post... :doh:

Share this post


Link to post
Share on other sites
About freakin' time :)

You've been waiting a long time for that, haven't you? :p

Now where are my keys, dammit?! :D

Share this post


Link to post
Share on other sites

Wait! This spawns civilians in cars and they drive around? To populate streets and make it more alive? This is really what i wanted since day one. Loved it in Lomac as it creates atmosphere of a living place.

Will test right away. Thanks TRexian!

Alex

Share this post


Link to post
Share on other sites

Well, hope you guys don't get your hopes up too much. :) This doesn't take a little village and make it look like rush hour in Tokyo. :)

It seems like most of the towns in Chernarus wouldn't have much traffic IRL. So, this really just gives a "taste" of it. As you drive from town to town, you should notice civ vehicles around. And, if you're in a bigger town, it should seem busier, based also on the number of civs around generally.

There are some areas I'd like to tweak, but wanted to get some feedback before pushing too far one way or another. :)

Share this post


Link to post
Share on other sites

Ok yes i figured it was something like that. I would really like civ vehicles driving the streets between villages - wich maybe this is doing. Didnt have time testing yesterday. The villages and cities are busy with the civ module, but i really miss that vehicles are going between villages.

Share this post


Link to post
Share on other sites

could something like this be altered in a seperate version to populate the maps with random opfor too?

Share this post


Link to post
Share on other sites
could something like this be altered in a seperate version to populate the maps with random opfor too?

"Ambient combat module" will do that for you, its been in Arma2 since day one.

Share this post


Link to post
Share on other sites
"Ambient combat module" will do that for you, its been in Arma2 since day one.

I have tried that and it doesn't work like I would expect. The only thing I have noticed is that sometimes I hear random explosions or see choppers flying around, but no infantry or tanks. Does it take a long time to happen? like how long?

Share this post


Link to post
Share on other sites

You need an INIT.SQF for ACM for best result. There you can choose what sides to spawn and what frequency you want them to come. Also choose how much of air and ground there will be. Also range min-max spawn distance from you. Skill range of spawned units plus ammo amount range - all made random when spawned within your values. You also choose what factions to spawn. I usually have all and full force. :)

It takes some 10-20 seconds for first things to spawn - usually helicopters. After that it will come more and more and yes they will fight eachother if you choose both sides to spawn so there will be explosions and full war after some time.

INIT.SQF for ACM Module (name the module BIS_ACM) and synch to you. The first "frequency" set to 1 means full force spawning. All values can be set between 0-1 (meaning 0.1 or 0.5 works also). Add this init.sqf in your mission folder (Paste below to a text document in notepad and save as init.sqf):

waitUntil {!isNil {BIS_ACM getVariable "initDone"}};

waitUntil {BIS_ACM getVariable "initDone"};

//Sets frequency and number of patrols (0-1). BIS_ACM is module name.

[1, BIS_ACM] call BIS_ACM_setIntensityFunc;

//min max spawn distance (in meters)

[bIS_ACM, 300, 700] call BIS_ACM_setSpawnDistanceFunc;

//factions to be spawned (ger=guerilla)

[["USMC", "INS", "RU", "CDF", "GER"], BIS_ACM] call BIS_ACM_setFactionsFunc;

//Skill range for spawned units

[0, 0.4, BIS_ACM] call BIS_ACM_setSkillFunc;

//Amount of ammo spawned units possess

[0.2, 0.5, BIS_ACM] call BIS_ACM_setAmmoFunc;

//Type of patrol. With 0 meaning no chance of appearing, and 1 meaning 100% chance. -1 removes patrol type completely (0.1-0.9 works as well).

["ground_patrol", 1, BIS_ACM] call BIS_ACM_setTypeChanceFunc;

["air_patrol", 0.5, BIS_ACM] call BIS_ACM_setTypeChanceFunc;

Sorry for this sliding TRexian.

Alex

Edited by Alex72

Share this post


Link to post
Share on other sites

Great Work,like that much!

But i had a funny issue here.I was playing my mission only with the Standart Vehicle Modul,not placed Alice and yours.As the start fighted some russian soldiers were jumping in cars and driving directly in my direction lol

Share this post


Link to post
Share on other sites

Couple things:

- Last night, for some reason, I started getting script errors. Very strange, it worked fine one night, then 24 hours later, it didn't. The only real difference was that I also added the ambient civ vehicles. So, there's a CHANCE that the two modules might conflict. That'll require some more testing.

- There are a couple mirrors now (THANKS guys!) I'll edit the original post to add them.

- jay316 - that is a very interesting idea, my friend. :) It would not be very difficult to use this same paradigm to add small random opfor groups in the civilian population. My first thought would be to create an insurgent group, and give them a set of waypoints around the town. Call it AIM - Ambient Insurgent Module. :) I'll add that to my idea list.

Edits:

@Alex - no problem with the minor derailing of the topic. :D I've been FAR too prolific in thread derailing in my life, I'd be the last person to get upset about it. :)

@Himmelsfeuer - yes, I just discovered last night that there may be a conflict with the Standard Vehicle module. I'll need to sort out exactly what issues arise when that happens. :)

And thank everyone for testing!

Edited by TRexian

Share this post


Link to post
Share on other sites

What script errors was it? FSM errors? Just checking since that is reported. When playing Cipher mission by Wiper that happens (he uses ALICE module). And the RPT is spammed with FSM errors. Only happens as i understand it in some villages/cities and not always and therefore you might not see errors everytime.

Share this post


Link to post
Share on other sites

Yeah, I know those wss errors or somesuch with the ALICE module. Saw those alot!

No, I have the error-reporting on, and it is specific to the JTD_ambientCivTraffic.sqf. Line 71. Problem is... line 71 is a rem (//) statement! LOL.

I *think* it may've gotten confused with some dev scripts I had sloppily left in a folder. As I played the mission, I went through Stary Sobor and Korobina (I think that's the name) and saw a bunch of vehicles, but no drivers. I wonder if the problem was related to those towns....

Share this post


Link to post
Share on other sites
You need an INIT.SQF for ACM for best result. There you can choose what sides to spawn and what frequency you want them to come. Also choose how much of air and ground there will be.

you know that's all great but I have no idea what you are talking about.

What I understand from this is that I paste that code into a notepad file that I rename to .sqf and then sync the combat module to the player... and it all automatically works and there is a war going on?

What's ACM? Ok forget it I am on two hours of sleep and I think I am missing something critical about how this works.

Share this post


Link to post
Share on other sites

I've just thought of a way to (maybe) use the presence of SILVIE (the civ vehicle module) to my advantage.

If the SILVIE module is also placed on a map, I may be able to use those vehicles to spawn, instead of spawning vehicles of my own....

I'll wait on that, though, until I am sure that there is really an issue.

Share this post


Link to post
Share on other sites
you know that's all great but I have no idea what you are talking about.

What I understand from this is that I paste that code into a notepad file that I rename to .sqf and then sync the combat module to the player... and it all automatically works and there is a war going on?

What's ACM? Ok forget it I am on two hours of sleep and I think I am missing something critical about how this works.

ACM = Ambient Combat Module.

Read all about it and how it works in this thread: http://forums.bistudio.com/showthread.php?t=73393

:)

Share this post


Link to post
Share on other sites
you know that's all great but I have no idea what you are talking about.

What I understand from this is that I paste that code into a notepad file that I rename to .sqf and then sync the combat module to the player... and it all automatically works and there is a war going on?

What's ACM? Ok forget it I am on two hours of sleep and I think I am missing something critical about how this works.

Its Ambient Combat Module and it spawns units around you to create an ambient war kicking in. I dont know if you been around this game since ArmA1, but we have for example "Kronzkys urban patrol script". Wich you define an area and then add some units that are copied by the scripts and add them randomlly within your defined area. And they will start patrol randomly. This does the same but in a bigger way and it sucks addind everything yourself doesnt it. THen you know where they are and how many and what types. With ACM you have no idea where they spawn and what types etc. Its there to spice up missions with random enemy/good guy patrolling.

I use it in most missions i make, and i also have a pure ACM+SOM mission (minus random missions SOM produce) and then a base i built. I start it up and after a couple of minutes theres a huge war and im in the middle of it. Great if you want some action. The SOM you can "milk" out a support menu from wich gives you artillery, ammo/vehicle drop, air taxi, air strike and UAV. Set to repeatedly you can call each thing in as many times as you want.

So yeah the ACM module is there to populate your game with random patrols of various factions and type such ground, air, armor, units and so on. Remember that you define the distance. So they might be spawned at the maximum range from you. That mean you might not see any enemy right away. The ACM module also remove dead units on its own - but not straight away. So it cleans up as well. Superb module that have a big role.

@TRexian

Ah ok got you on the errors. Cool it isnt the FSM then at least. :)

Edited by Alex72

Share this post


Link to post
Share on other sites

Hi there,

Its great, thanks a lot for sharing.

If a mission maker uses this, will the players have to have the mod installed also?

Thanks

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  

×