Jump to content
JOHN007

Random Items With Civilians

Recommended Posts

Hello.

 

Basically looking for a script that, for example, if you would to search a civilian ingame you would see a set of random items in their possession.

 

May I ask can anyone help or know any scripters that could point me in the right direction? You don't get many replies on this forum.

 

I've searched this whole forum for months now there's nothing on this.

 

Just to recap,, Search civilian,, see random items.

 

Thankyou for your time and hope to speak soon.

Share this post


Link to post
Share on other sites

I don't get what u want. What do u mean with searching a civilian and what with seeing random items?

sent from mobile using Tapatalk

Share this post


Link to post
Share on other sites

Thankyou very much for the reply much appreciated.

 

Basically I would like to allocate the ''Arp Items'' to the civilians inventory but allocated using a random parameter/array?

 

The link to the items are here. http://www.armaholic.com/page.php?id=18032

 

So for example, you would search a civilian ingame and see random items selected from the Arp Mod in their possession.

 

Now I've found where the script is for Alice which replaces all civilians inventory with stones. Here is the config..

 

// 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)
[BIS_alice_mainscope,"ALICE_civilianinit",[
//        {
//            if (leader group _this == _this) then {_this setVariable ["rmm_gtk_exclude", true]};
//        },
        {_this setSkill 0},
        { 
                {_this disableAI _x} count ["AUTOTARGET","TARGET"]
        },
        {removeAllWeapons _this}, 
        {removeAllItems _this},
        {
		if (random 1 > 0.1) then {
			_this setSkill 0.2;
			{_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 {
			_this setSkill 0.1;
			{_this enableAI _x} count ["AUTOTARGET","TARGET"];
                        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;

 

I'm sure that this could be edited to allow the Arp Items to be randomly allocated to the civilians inventory but I'm no expert on setting up this sort of parameter?

 

Thankyou very much for your time and hope to speak soon.

Share this post


Link to post
Share on other sites

Okay if i understood it correctly then u want that the civilians have arp items instead of stones in their inventory. Is this correct?

sent from mobile using Tapatalk

Share this post


Link to post
Share on other sites

Hello Sarogahtyp Thankyou for the reply.

 

Yes indeed using the Arp Items but randomly allocated. The script I posted is allocating 8 stones to every civilians inventory. So it is working as intended but I'm sure we can have random spawns of Arp items also.

Share this post


Link to post
Share on other sites

Update here.

 

Maybe a parameter that's sets a 1% chance of any ''Arp Item'' being allocated to the civilians inventory?

Share this post


Link to post
Share on other sites

The hard part for me is to build an array with all arp items but i ll try when on desktop

sent from mobile using Tapatalk

Share this post


Link to post
Share on other sites

Thankyou ever so much for the reply.

 

There isn't anything on this forum regarding this array parameter setup either on Arma 2 or Arma 3 so this is absolutely brilliant.

 

This is going to be a very unique script indeed. The emersion would be high with this. I can assist you as much as possible but I've found no information online with any help towards creating this type of array I haven't been able to write or even back engineer any sort of mod with this in mind?

 

Thankyou for your time and expertise on this parameter, hope to speak soon.

Share this post


Link to post
Share on other sites

okay, I ve some work for u. u should build an array of all classnames. I tell u how.

 

1. Download the ARP .rar file from armaholic

2. Open classnames.txt

3.Put all classnames in an array like the following.

["ARP_babywipes", "ARP_bloodchit", "ARP_bloodchit_corner", "ARP_book_manual"]

The array should contain all classnames after that. Not just 4 like I did above.

4. Post the array.

Share this post


Link to post
Share on other sites

okay script is ready for testing.

// 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)
[BIS_alice_mainscope,"ALICE_civilianinit",[
//        {
//            if (leader group _this == _this) then {_this setVariable ["rmm_gtk_exclude", true]};
//        },
        {_this setSkill 0},
        { 
                {_this disableAI _x} count ["AUTOTARGET","TARGET"]
        },
        {removeAllWeapons _this}, 
        {removeAllItems _this},
        {
		if (random 1 > 0.1) then {
		
			_arp_items = ["ARP_babywipes", "ARP_bloodchit", "ARP_bloodchit_corner", "ARP_book_manual", "ARP_book_novel", "ARP_bugspray", "ARP_cards", "ARP_comic", "ARP_condom", "ARP_dice", "ARP_dip", "ARP_elec_powder", "ARP_eyedrops", "ARP_gq", "ARP_gum", "ARP_ID", "ARP_letter_love", "ARP_letter_norm", "ARP_letter_susp", "ARP_lighter", "ARP_lipbalm", "ARP_multitool", "ARP_nationalgeo", "ARP_newspaper", "ARP_picture_fam", "ARP_picture_gf", "ARP_picture_susp", "ARP_playboy", "ARP_refbelt", "ARP_shemagh_black", "ARP_shemagh_blue", "ARP_shemagh_brown", "ARP_shemagh_green", "ARP_shemagh_olive", "ARP_shemagh_red", "ARP_shemagh_tan", "ARP_shemagh_white", "ARP_skittles", "ARP_snickers", "ARP_socks_black", "ARP_socks_green", "ARP_stuff_animal", "ARP_sudoku", "ARP_sunblock", "ARP_tanboxer", "ARP_tanshirt", "ARP_toiletpaper", "ARP_towel", "ARP_usbdrive", "ARP_vhstape", "ARP_water_tabs", "ARP_2way", "ARP_550cord", "ARP_acetone", "ARP_bandana_green", "ARP_bandana_black", "ARP_bandana_blue", "ARP_bandana_purple", "ARP_bandana_red", "ARP_batteries", "ARP_beefjerky", "ARP_beer", "ARP_boots_mil", "ARP_bungeecord", "ARP_camcorder", "ARP_canopener", "ARP_cigarettes", "ARP_clacker", "ARP_CLP", "ARP_detcord", "ARP_domo", "ARP_ducttape", "ARP_dumbphone", "ARP_dvds", "ARP_energydrink", "ARP_exan", "ARP_facepaint", "ARP_firestarter", "ARP_gameboy", "ARP_garageopener", "ARP_hammer", "ARP_handwarmer", "ARP_hexamine", "ARP_hydrochloric", "ARP_matches", "ARP_mp3", "ARP_nails", "ARP_pacecounter", "ARP_phonecard", "ARP_pitabread", "ARP_poppybag", "ARP_potatobag", "ARP_psp", "ARP_ricebag", "ARP_sandwich", "ARP_smartphone", "ARP_steelpipe", "ARP_stethoscope", "ARP_toxicgas", "ARP_twinkies", "ARP_vodka", "ARP_whistle", "ARP_wpnclnkit", "ARP_chili", "ARP_cigar", "ARP_coke", "ARP_dew", "ARP_drpepper", "ARP_goldbar", "ARP_goldwatch", "ARP_laptop", "ARP_mezzo", "ARP_pepsi", "ARP_pineapples", "ARP_socks_black_dirty", "ARP_socks_green_dirty", "ARP_soup", "ARP_spaghettios", "ARP_suitcase_black", "ARP_suitcase_silver", "ARP_tablet", "ARP_tanboxer_dirty", "ARP_tanshirt_dirty", "ARP_tuna", "ARP_zippo", "ARP_airfilter", "ARP_basketball", "ARP_cellphone", "ARP_chucks", "ARP_clutch_disk", "ARP_clutch_pressureplate", "ARP_coldairintake", "ARP_electricaltape", "ARP_fanbelt", "ARP_flywheel", "ARP_gamecontroller", "ARP_headlamp", "ARP_knife", "ARP_knife_combat", "ARP_leaflet_psyop", "ARP_leaflet_wanted", "ARP_licenseplate_afghan", "ARP_m16_bolt", "ARP_m16_lower_receiver", "ARP_m16_upper_receiver", "ARP_piston", "ARP_sleepingbag", "ARP_solderingiron", "ARP_spoon", "ARP_steeringwheel", "ARP_thermos", "ARP_valvesprings", "ARP_wirecutter"];
			
			_this setSkill 0.2;
			{_this enableAI _x} count ["AUTOTARGET","TARGET"];
			
			_this addWeapon (_arp_items call BIS_fnc_selectRandom);
			_this addWeapon (_arp_items call BIS_fnc_selectRandom);
			_this addWeapon (_arp_items call BIS_fnc_selectRandom);
			_this addWeapon (_arp_items call BIS_fnc_selectRandom);
			_this addWeapon (_arp_items call BIS_fnc_selectRandom);
			_this addWeapon (_arp_items call BIS_fnc_selectRandom);
			_this addWeapon (_arp_items call BIS_fnc_selectRandom);
			_this addWeapon (_arp_items call BIS_fnc_selectRandom);
//			if(!("Throw" in weapons _this)) then {_this addWeapon "Throw";};
		};
                if (random 1 > 0.95 && (_this isKindOf "Woman_EP1" || _this isKindOf "Woman")) then {
			_this setSkill 0.1;
			{_this enableAI _x} count ["AUTOTARGET","TARGET"];
                        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;

you just need to replace _arp_items = ["ARP_babywipes", "ARP_bloodchit", "ARP_bloodchit_corner", "ARP_book_manual"]; with the complete array. but for testing it has not to be complete.

you should have something similar this but with much more item classnames:

 

Edited by sarogahtyp
Updated Array, classname corrected

Share this post


Link to post
Share on other sites

Hello,

 

Here is the completed array.

 

["ARP_babywipes", "ARP_bloodchit", "ARP_bloodchit_corner", "ARP_book_manual", "ARP_book_novel", "ARP_bugspray", "ARP_cards", "ARP_comic", "ARP_condom", "ARP_dice", "ARP_dip", "ARP_elec_powder", "ARP_eyedrops", "ARP_gq", "ARP_gum", "ARP_ID", "ARP_letter_love", "ARP_letter_norm", "ARP_letter_susp", "ARP_lighter", "ARP_lipbalm", "ARP_multitool", "ARP_nationalgeo", "ARP_newspaper", "ARP_picture_fam", "ARP_picture_gf", "ARP_picture_susp", "ARP_playboy", "ARP_refbelt", "ARP_shemagh_black", "ARP_shemagh_blue", "ARP_shemagh_brown", "ARP_shemagh_green", "ARP_shemagh_olive", "ARP_shemagh_red", "ARP_shemagh_tan", "ARP_shemagh_white", "ARP_skittles", "ARP_snickers", "ARP_socks_black", "ARP_socks_green", "ARP_stuff_animal", "ARP_sudoku", "ARP_sunblock", "ARP_tanboxer", "ARP_tanshirt", "ARP_toiletpaper", "ARP_towel", "ARP_usbdrive", "ARP_vhstape", "ARP_water_tabs", "ARP_2way", "ARP_550cord", "ARP_acetone", "ARP_bandana_green", "ARP_bandana_black", "ARP_bandana_blue", "ARP_bandana_purple", "ARP_bandana_red", "ARP_batteries", "ARP_beefjerky", "ARP_beer", "ARP_boots_mil", "ARP_bungeecord", "ARP_camcorder", "ARP_canopener", "ARP_cigarettes", "ARP_clacker", "ARP_CLP", "ARP_detcord", "ARP_domo", "ARP_ducttape", "ARP_dumbphone", "ARP_dvds", "ARP_energydrink", "ARP_exan", "ARP_facepaint", "ARP_firestarter", "ARP_gameboy", "ARP_garageopener", "ARP_hammer", "ARP_handwarmer", "ARP_hexamine", "ARP_hydrochloric", "ARP_matches", "ARP_mp3", "ARP_nails", "ARP_pacecounter", "ARP_phonecard", "ARP_pitabread", "ARP_poppybag", "ARP_potatobag", "ARP_psp", "ARP_ricebag", "ARP_sandwich", "ARP_smartphone", "ARP_steelpipe", "ARP_stethoscope", "ARP_toxicgas", "ARP_twinkies", "ARP_vodka", "ARP_whistle", "ARP_wpnclnkit", "ARP_chili", "ARP_cigar", "ARP_coke", "ARP_dew", "ARP_drpepper", "ARP_goldbar", "ARP_goldwatch", "ARP_laptop", "ARP_mezzo", "ARP_pepsi", "ARP_pineapples", "ARP_socks_black_dirty", "ARP_socks_green_dirty", "ARP_soup", "ARP_spaghettios", "ARP_suitcase_black", "ARP_suitcase_silver", "ARP_tablet", "ARP_tanboxer_dirty", "ARP_tanshirt_dirty", "ARP_tuna", "ARP_zippo", "ARP_airfilter", "ARP_basketball", "ARP_cellphone", "ARP_chucks", "ARP_clutch_disk", "ARP_clutch_pressureplate", "ARP_coldairintake", "ARP_electricaltape", "ARP_fanbelt", "ARP_flywheel", "ARP_gamecontroller", "ARP_headlamp", "ARP_knife", "ARP_knife_combat", "ARP_leaflet_psyop", "ARP_leaflet_wanted", "ARP_licenseplate_afghan", "ARP_m16_bolt", "ARP_m16_lower_receiver", "ARP_m16_upper_receiver", "ARP_piston", "ARP_sleepingbag", "ARP_solderingiron", "ARP_spoon", "ARP_steeringwheel", "ARP_thermos", "ARP_valvesprings", "ARP_wirecutter"]

 

Thankyou.

Share this post


Link to post
Share on other sites

okay. Test the code from my last post and give feedback pls.

Share this post


Link to post
Share on other sites

Only just seen the last post I didn't check the notifications sorry.

 

Ok I'm testing the new script with all the items included.

 

Thankyou for your expertise on this script. 

Share this post


Link to post
Share on other sites

You are a genius!

 

It works! It bloody works! I've loaded the multiplayer dedicated server and civilians all have random items in their possession. You have completed the last piece of the puzzle. I'm speechless right now. You have created an epic addition to Dogs brilliant Arp Items mod.

 

I'm 99% sure these items are synced with the server I need to test this further with a few players but I'm sure that the items are indeed synced. I'll post back the multilayer results ASAP!

 

The emersion level is high right now. Oh my days this is a master level script you've created here!

 

Eternally grateful for your time and expertise on this parameter.

 

Hope to speak soon.

Share this post


Link to post
Share on other sites

It was just a little modification and u did the hardest job. U built the array

sent from mobile using Tapatalk

Share this post


Link to post
Share on other sites

Hello,

 

There was a slight weapon error on screen but I figured it out. There was a text error in the readme with an item, Link here.

''Bug: On the .txt files you write ARP_beefjerkey but in the mod the correct name is ARP_beefjerky.''

 

Ok so I updated the item array on my post if you could slightly edit your post to correct the error that would be fantastic.

 

All fixed now.

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

×