Jump to content
Sign in to follow this  
wolffy.au

BIS Module Improvement Project

Recommended Posts

updated my mission to latest version of MIP and now a mpeventhandler that I added to "Alice_civilianinit" that worked previously no longer does..

init-alice2.sqf (original code I used on old version that worked)

[bIS_alice_mainscope,"ALICE_civilianinit",[
       {_this setSkill 0},
       {
               {_this disableAI _x} count ["AUTOTARGET","TARGET"]
       },
       {_this allowFleeing (random 1)},
       {removeAllWeapons _this},
       {removeAllItems _this},
       [color="Red"]{_this addMPEventHandler ["mpkilled", {null = _this execVM "scripts\civ_casualties.sqf";}]}[/color]

]] call BIS_fnc_variableSpaceAdd;

init-alice2.sqf (new non working code)

[bIS_alice_mainscope,"ALICE_civilianinit",[
       {_this setSkill 0},
       {
               {_this disableAI _x} count ["AUTOTARGET","TARGET"]
       },
       {_this allowFleeing (random 1)},
       {removeAllWeapons _this},
       {removeAllItems _this},
       [color="Red"]{_this addMPEventHandler ["mpkilled", {null = _this execVM "scripts\civ_casualties.sqf";}]},[/color]
       {
	if (random 1 > 0.1) then {
		{_this enableAI _x} count ["AUTOTARGET","TARGET"];
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
//			if(!("Throw" in weapons _this)) then {_this addWeapon "Throw";};
	};
               if (random 1 > 0.95 && (_this isKindOf "Woman_EP1" || _this isKindOf "Woman")) then {
                       if (random 1 > 0.5) then {
                               _this addMagazine "8Rnd_9x18_Makarov";
                               _this addMagazine "8Rnd_9x18_Makarov";
                               _this addWeapon "Makarov";
                       } else {
                               _this addMagazine "6Rnd_45ACP";
                               _this addMagazine "6Rnd_45ACP";
                               _this addWeapon "revolver_EP1";
                       };
               };
       }

]] call BIS_fnc_variableSpaceAdd;

EDIT:

REPRO - http://desrat.lightning-bolt.net/ArmA/mip.takistan.zip

Edited by Desrat
added repro

Share this post


Link to post
Share on other sites

Workaround by modifying init-alice2.sqf slightly (change is highlighted)

// array of codes which is executed upon every civilian unit created. 
// [bIS_alice_mainscope,"ALICE_civilianinit",[{_this addweapon "Mk_48"}]] call bis_fnc_variablespaceadd; 
// Dumb down civilian units to use less CPU (see http://creobellum.org/node/175)
[color="Red"][b]BIS_alice_mainscope setvariable ["ALICE_civilianinit",[[/b][/color]
       {_this setSkill 0},
       {
               {_this disableAI _x} count ["AUTOTARGET","TARGET"]
       },
       {_this allowFleeing (random 1)},
       {removeAllWeapons _this},
       {removeAllItems _this},
       {_this addmpeventhandler ["mpkilled",{null = [_this select 1] execVM "scripts\civ_casualties.sqf";}]},
       {
	if (random 1 > 0.1) then {
		{_this enableAI _x} count ["AUTOTARGET","TARGET"];
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
		_this addMagazine "HandGrenade_Stone";
//			if(!("Throw" in weapons _this)) then {_this addWeapon "Throw";};
	};
               if (random 1 > 0.95 && (_this isKindOf "Woman_EP1" || _this isKindOf "Woman")) then {
                       if (random 1 > 0.5) then {
                               _this addMagazine "8Rnd_9x18_Makarov";
                               _this addMagazine "8Rnd_9x18_Makarov";
                               _this addWeapon "Makarov";
                       } else {
                               _this addMagazine "6Rnd_45ACP";
                               _this addMagazine "6Rnd_45ACP";
                               _this addWeapon "revolver_EP1";
                       };
               };
       }

]] call BIS_fnc_variableSpaceAdd;

Share this post


Link to post
Share on other sites

Wolffy: thanks so much for continuing to make this stuff available for the community!

Share this post


Link to post
Share on other sites
Is it possible that BIS_fnc_variableSpaceAdd is not initialised yet?

I don't know what it is. All I know is that unless I use setvariable then any eventhandlers added to civilians doesn't fire. I haven't tried silvie (for a event handler on a vehicle) anyway the post above although only a small change definitely fixed my issue without losing any of the functionality that the MIP was created for.

Share this post


Link to post
Share on other sites

Ok, so I found what I think is the error. I'm really surprised I didn't see it sooner. I've updated your Dev-Heaven ticket with a new init-alice2.sqf to try out.

I've made one additional major change - GarbageCollector is now to set auto by default.

Share this post


Link to post
Share on other sites

I'll take a look tomorrow, don't have access to my main rig till then.

Share this post


Link to post
Share on other sites

Hi Wolffy!

This projects looks brilliant but I haven't got to have ALICE 2 work properly. I tried your latest release with the example missions and with the fixed init script. I've used the debug mode to examine the problems. Here are the issues I've run into:

#1 At least in Chernarus and Utes seems to have some problems with depopulation when you leave the spawn area. Most of the citizens are removed but typically 1-3 citizens are left in the town. But here's something worse. When you return to the same town again it is not repopulated. In Takistan this seems to work ok but something's wrong with the Arma 2 islands.

#2 Ambient civilian traffic. The vehicles spawn right infront of my nose which kills the immersion. Is there a way to have a minimum spawn distance you could adjust? And/Or have it spawn in another town? And maybe something more to improve. Instead of spawning new vehicles, have a possibility of getting a citizen come out of a house and enter a nearby SILVIE car and drive away. Or vise versa, having a car arrive to a town, exit the vehicle and go into a house. That could be a nice touch!

#3 House effects. At least on Chernarus and Utes maps you can see the chimney smoke but I haven't seen any lights in the windows during night. Is this a bug or have I just not happened to see any yet?

#4 Sometimes a villager dies when spawned (Collision glitch with an object?) and scares it's friends making them lock themselves in their homes. Could this be easily fixed by setting allowdamage false for a few seconds once spawned? Or make the villagers ignore their dying mates for a few seconds from init.

#5 The villagers are mostly running instead of walking. Life in armaverse is hectic I guess. I've fixed this with a looping script making civilians forcespeed 0.5 when behaviour is safe or careless and otherwise forcespeed -1 so this isn't that big of an issue in my case. Thought you could look into it anyways.

Other than that this looks very nice and most of all it doesn't burden the CPU as much as the original module. Thumbs up and hope you keep updating this beauty also in the future!

Edited by King Nothing

Share this post


Link to post
Share on other sites

Thanks King Nothing - the only ones I thought were still a problem were #1 and #2. Will revisit and see what I can do about the others.

With this project, I try not to re-write stuff, just fix things that BIS never got around to fixing. I've tried to fix all those bugs at some point - some are just weird and take more time to fix. Check the Issues list on Dev-Heaven - if any of those you've mentioned are not there already, feel free to add them.

Share this post


Link to post
Share on other sites

Ok, I added the the mentioned issues to devheaven. Hope this helps you in your work.

One question: Is it possible to run ALICE 1 with these improvements? I just thought it won't be necessary to run ALICE 2 in chernarus and utes and have dependancy on OA, am I right? Thanks in advance.

Share this post


Link to post
Share on other sites

Mainly for features like AI traffic, which are ALICE2 only and therefore I didn't bother trying to fix ALICE1, but rather make ALICE2 work like ALICE1 where it wasn't already.

I hope that answers your question.

Share this post


Link to post
Share on other sites

Is it possible to script so that a player gains rating points for talking to civilians, ambient or otherwise? I play long SP patrol missions with no guarantee of enemy contact, and am seeking a "hearts and minds" aspect to my simulation. Thanks in advance for any suggestions.

Share this post


Link to post
Share on other sites

I do the opposite using Event Handlers so that when you steal one of their cars you lose points (to the point they throw stones at you). I guess you could use the same system when you heal them, you gain points. I know you lose points if you kill them.

Checkout init-alice2.sqf and init-silvie.sqf for the custom stuff I do.

Share this post


Link to post
Share on other sites

I trust the Installation Instructions from the first page of the thread are still accurate?

Share this post


Link to post
Share on other sites

Yes, I believe so. Check the vanilla and custom demo missions if you run into any problems.

Share this post


Link to post
Share on other sites

Fourth Release

Latest MIP release here:

http://dev-heaven.net/attachments/download/14900/mip-20111022.zip

Changelog:

- Aligned with 1.59 source

Ambient Civilians

- Fixed Respect/respawn error caused by Garbage Collector deleting empty groups

- Choose traffic spawn points away from players

- Removed enableFleeing causing civs to run everywhere

- Allowed AUTOTARGET for armed civs

- Increased default skill for armed civs

- Store spawnpoints to increase performance

- Reverted to not broadcasting of setVariables

- Deactivate HouseEffects if town is not active

Ambient Vehicles

- Randomly remove weapon and magazine cargo

Garbage Collector

- Changed Garbage Collector Auto Scavange to be on by default

Share this post


Link to post
Share on other sites

[*]Added civilian stone throwing and random pistols (optional)

how do i enable such an option?

Share this post


Link to post
Share on other sites

Have a look at the mip-custom.utes mission. In the ALICE2 module, I run the init-alice2.sqf file, which sets it all up in civilian_init.

Share this post


Link to post
Share on other sites

Yo Wolffy!

Awsome, man! i guess the version is the same used in MSO so i could check the fn_respect bug with current 3.45 versions of MSO?

Hope you are fine!

Share this post


Link to post
Share on other sites

Yeah, haven't released an MSO with it yet - but you could dropin the MIP version as a replacement.

I can't remember the exact file names off hand, but check the contents of init-alice2.sqf and init-silvie.sqf against the setup files in ambience\modules\crb_civilians

Share this post


Link to post
Share on other sites

cool, will do - im sure it will work out

and btw: thx for all ya afford for the community!

Share this post


Link to post
Share on other sites
Is there a way to get this to work on Tigeria ?

All the modules should have debugging features you can turn on and see on the map. Try them, if nothing happens then let the map author know it doesn't work.

There is plenty of resources on BIF about how to get ALICE and other modules working in maps.

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  

×