Jump to content
LordJarhead

Trigger / Teleport Blur Fade In

Recommended Posts

Hello gents, 

 

I'm currently working on a mission. Let me quickly put a few lines together to explain my goal:

 

You start in an isolated warehouse unable to leave the room. There is no door unlocked. You start with zero gear whatsoever. Not even a watch on you wrist. No map either, you don't know where you are. Well actually you do, you are in your warehouse. 

 

There you have a stash with your stuff, which is at the biginning not much at all. 2 FAK, an old PM 9mm,5 magazines and a handful of mini grenades and a cellphone. You habe no vest, no backpack, no helmet or nightvision, not even binoculars. Nothing really. 

 

Now there is a laptop on a table, with an action... "Go To Zone". This will lead you via boot to the other side of "the Zone". The zone is a demilitarized zone, full of empty houses, villages, warehouses and... Military Outposts! But you are not alone at all. There are raiders, bandits and ex military groups and they are all looking for a good loot. Because that's why you are there as well, getting that loot, that special one, the best! Get it and extract out of the zone by finding one of the few and hard to find underground bunker entries that can safely extract you back to your warehouse, to your stash and to a dealer giving you the lowest prices possible, obviously.

 

Also, there are armored IDAP members trying to clear out the old mine fields and track down biological and chemical weapons and equipment. They are all visibly dressed with striking blue vests and helmets. And they are armed. But they barely use their weapons and only for defense. 

 

The world is dirty, destroyed and only the strongest survive. There are dozens of people who try tho. 

 

On you way in your mobilphone gets a message warning you about any further progress into the zone. There is noone to help you and really rarely you meet a friendly face not trying to kill you for the goods in you pockets. The further you go the more and better loot you could find. Like in one of the military outposts. But they are haunted by heavily armed forces, ex-military groups who are way more efficient as they work in groups. So on your first few go into the zone you might want to make a way around them. Black smoke over these outposts indicate for trouble but also for goods. 

 

When you are lucky and strong enough to find an exit, you can fill your stash and maybe sell a few good items that brings you money to get more goods, better ones. 

 

So that's my basic idea. I admit, it's basically Escape From Tarkov but in single-player. Maybe in co-op, needs to be seen. I have some basic scripts going that add various random items like bandages, water, food, cloths and hats (all civilian) to all houses and places there on each position in a house with a 50% chance. 

 

Even more rarely there are crates in outposts that contain all sorts of weapons but also all selected randomly from a pool of all weapon, vests, backpacks, helmets, items, uniforms etc class names there are in vanilla ArmA 3 and the ArmA3Items Mods that adds basic items like water and food. 

 

There are enemies that start basically with you (dynamic simulation) and have only a pistol. Those are looting the civilian areas for really really rare finds of weapons and ammunitions. Further out and close to named outposts some grouped heavily equipped ex military lurk around, looting bases and keep quality control over the field by eliminating poor folks. Those are way more skilled and deadly. 

 

TLDR;

OK so let's just get to my current "problem" which is basically more of an design issue. When you are in your warehouse off the grid you have to use the addaction on a laptop. It adds the action go to zone and teleports the player to a marker on the map. Now what I would like to have going would be this:

 

 

A nice and smooth fade in | Blur in with that text and all. But I can't get that to work actually. I tried like so many posts here from the forums. Most of the do this on mission start but you only start but using a Teleport to a trigger. 

 

That would be my first problem, maybe someone can help me out here? 

 

Oh yeah, sry for the long text and all.... 

 

LJ 

 

Share this post


Link to post
Share on other sites

First of all I love your sound mod.

 

I'm no script expert by any means but this might help get you started. I found it on the net some time ago.

 

// Start with a silent black screen.
titleCut ["", "BLACK FADED", 999];
0 fadeSound 0;

// Spawn text effects.
_this spawn {

	
	params[
		["_missionName", "TEXT HERE"],
		["_missionAuthor", "TEXT HERE"],
		["_missionVersion", "Version 1.0"],
		["_quote", "Free the civ's...\n\n-A quote"],
		["_duration", 9]
	];

	// Starting quote as volume fades in.
	titleText [_quote,"PLAIN"];
	titleFadeOut _duration;
	_duration fadeSound 1;
	sleep (_duration - 2);

	// New "sitrep style" text in bottom right corner, typed out over time.
	[ 
		[_missionName,"font = 'PuristaSemiBold'"],
		["","<br/>"],
		[_missionAuthor,"font = 'PuristaMedium'"],
		["","<br/>"],
		[_missionVersion,"font = 'PuristaLight'"]
	]  execVM "\a3\missions_f_bootcamp\Campaign\Functions\GUI\fn_SITREP.sqf";

	// Fade from black, to blur, to clear as text types.
	sleep 3;
	"dynamicBlur" ppEffectEnable true;   
	"dynamicBlur" ppEffectAdjust [6];   
	"dynamicBlur" ppEffectCommit 0;     
	"dynamicBlur" ppEffectAdjust [0.0];  
	"dynamicBlur" ppEffectCommit 5;  
	titleCut ["", "BLACK IN", 5];
};

 

 

Share this post


Link to post
Share on other sites
1 hour ago, major-stiffy said:

First of all I love your sound mod.

 

I'm no script expert by any means but this might help get you started. I found it on the net some time ago.

 


// Start with a silent black screen.
titleCut ["", "BLACK FADED", 999];
0 fadeSound 0;

// Spawn text effects.
_this spawn {

	
	params[
		["_missionName", "TEXT HERE"],
		["_missionAuthor", "TEXT HERE"],
		["_missionVersion", "Version 1.0"],
		["_quote", "Free the civ's...\n\n-A quote"],
		["_duration", 9]
	];

	// Starting quote as volume fades in.
	titleText [_quote,"PLAIN"];
	titleFadeOut _duration;
	_duration fadeSound 1;
	sleep (_duration - 2);

	// New "sitrep style" text in bottom right corner, typed out over time.
	[ 
		[_missionName,"font = 'PuristaSemiBold'"],
		["","<br/>"],
		[_missionAuthor,"font = 'PuristaMedium'"],
		["","<br/>"],
		[_missionVersion,"font = 'PuristaLight'"]
	]  execVM "\a3\missions_f_bootcamp\Campaign\Functions\GUI\fn_SITREP.sqf";

	// Fade from black, to blur, to clear as text types.
	sleep 3;
	"dynamicBlur" ppEffectEnable true;   
	"dynamicBlur" ppEffectAdjust [6];   
	"dynamicBlur" ppEffectCommit 0;     
	"dynamicBlur" ppEffectAdjust [0.0];  
	"dynamicBlur" ppEffectCommit 5;  
	titleCut ["", "BLACK IN", 5];
};

 

 

 

Thank you for the quick answer, really cool!

 

The thing is, this probably needs to be in the init files or something? But how do I call the script on a trigger or on action?

 

Like this is my LapTop Addaction:

 

This addAction["Go To Zone",{player setPos getMarkerPos "marker_entry"}];

 

 

LJ

Share this post


Link to post
Share on other sites
1 hour ago, LordJarhead said:

But how do I call the script on a trigger or on action?

 


This addAction ["Go To Zone","myTeleportScript.sqf"];

 


As for the above code, some fiddling required I'm sure. Unless that was the point of your question?

Share this post


Link to post
Share on other sites

Ah, this is far easier than expected.

 

This addAction["Go To Zone",{ 
    
    [0,"BLACK",2,1] call BIS_fnc_fadeEffect;  //[fade out, to black, 2 second fade, blurred]
    
    player setPos getMarkerPos "marker_entry"; 
    
    [1,"BLACK",2,1] call BIS_fnc_fadeEffect;  //[fade in, from black, 2 second fade, blurred]
    
}];

 

Remove the comments before pasting, of course.

Share this post


Link to post
Share on other sites
41 minutes ago, Harzach said:

Ah, this is far easier than expected.

 


This addAction["Go To Zone",{ 
    
    [0,"BLACK",2,1] call BIS_fnc_fadeEffect;  //[fade out, to black, 2 second fade, blurred]
    
    player setPos getMarkerPos "marker_entry"; 
    
    [1,"BLACK",3,1] call BIS_fnc_fadeEffect;  //[fade in, from black, 2 second fade, blurred]
    
}];

 

Remove the comments before pasting, of course.

 

YOU ARE THE MAN!

 

That was amazing! I searched for quiet some time now and didn't found a clue! So thank you VERY much!

 

I was thinking, for my next step I would like to create some sort of load out templates for the AI, so that when they spawn they always have a different set of loot in their pockets, a different weapon or different set of vest, backpack or uniform to just randomize that whole thing more. Is there like a quick and easy way to do that? Maybe by script.sqf? I would like to have different set of items, like really low spec items (Cheap pistols, maybe an SMG, nothing more. Bandoliers and small backpacks, minigrenades), a medium spec like more advanced gear and maybe even a high spec class, with powerful weapons, silencers, nightvision, full specops stuff... 

 

I did that with loot caches, so crates that get filled randomly with iteams and I have a bunch of "arrays" I think they are called that the BIS_SelectRandom can select a few from. So for example I have an "old weapons" crate that can be filled with up to three weapons and it randomly chooses from AKM, AKSU, Protector, PM 9mm, RPG and so on. So sometimes I can find only three pistols, or even three launchers if I'm lucky...

 

LJ

Share this post


Link to post
Share on other sites

You could assemble arrays of specific items for each item type (primary weapon, secondary weapon, launcher, uniform, vest, backpack, etc.) and "level" (low spec, med spec, high spec), then write a script or function that runs on every AI at spawn that removes all of their items then equips them randomly from those arrays. I am almost positive that there are a few script systems out there that do just this.

Share this post


Link to post
Share on other sites

So my next one:

 

I have an ammo crate, I fill that crate with random items. The init of the crate is like this:

 

init_Handle = this execVM "cacheFillerPoor.sqf";

 

The script SQF is like this:

_this allowDamage false; 

clearWeaponCargoGlobal _this; 
clearMagazineCargoGlobal _this; 
clearItemCargoGlobal _this; 
clearBackpackCargoGlobal _this;

_item1 = ["ItemWatch","ItemMap","Binocular","FirstAidKit","Medikit","rb_antibiotic","rb_Waterpure","rb_bandage","rb_bloodbag","rb_Meat","rb_MeatC","rb_TacticalBacon","rb_BakedBeans","rb_TacticalBaconempty","rb_BakedBeansempty","rb_bottle","rb_bottleclean","rb_bottledirty","rb_bottlesalt","rb_Spirit","rb_franta","rb_Spiritempty","rb_frantaempty","rb_oldcan","rb_redgull","rb_redgullempty","rb_hammer","rb_saw","rb_wrench","rb_Axe","rb_ducttape","rb_cereal","rb_RiceBox","rb_canteen","rb_canteen_dirty","rb_canteen_salt","rb_canteen_empty","rb_matches","rb_nails","rb_knife","rb_HandyCam","rb_MobilePhone","rb_SmartPhone","rb_file"] call BIS_fnc_selectRandom;
_item2 = ["ItemWatch","ItemMap","Binocular","FirstAidKit","Medikit","rb_antibiotic","rb_Waterpure","rb_bandage","rb_bloodbag","rb_Meat","rb_MeatC","rb_TacticalBacon","rb_BakedBeans","rb_TacticalBaconempty","rb_BakedBeansempty","rb_bottle","rb_bottleclean","rb_bottledirty","rb_bottlesalt","rb_Spirit","rb_franta","rb_Spiritempty","rb_frantaempty","rb_oldcan","rb_redgull","rb_redgullempty","rb_hammer","rb_saw","rb_wrench","rb_Axe","rb_ducttape","rb_cereal","rb_RiceBox","rb_canteen","rb_canteen_dirty","rb_canteen_salt","rb_canteen_empty","rb_matches","rb_nails","rb_knife","rb_HandyCam","rb_MobilePhone","rb_SmartPhone","rb_file"] call BIS_fnc_selectRandom;
_item3 = ["ItemWatch","ItemMap","Binocular","FirstAidKit","Medikit","rb_antibiotic","rb_Waterpure","rb_bandage","rb_bloodbag","rb_Meat","rb_MeatC","rb_TacticalBacon","rb_BakedBeans","rb_TacticalBaconempty","rb_BakedBeansempty","rb_bottle","rb_bottleclean","rb_bottledirty","rb_bottlesalt","rb_Spirit","rb_franta","rb_Spiritempty","rb_frantaempty","rb_oldcan","rb_redgull","rb_redgullempty","rb_hammer","rb_saw","rb_wrench","rb_Axe","rb_ducttape","rb_cereal","rb_RiceBox","rb_canteen","rb_canteen_dirty","rb_canteen_salt","rb_canteen_empty","rb_matches","rb_nails","rb_knife","rb_HandyCam","rb_MobilePhone","rb_SmartPhone","rb_file"] call BIS_fnc_selectRandom;
_cloth1 = ["H_Bandanna_camo","H_Bandanna_cbr","H_Bandanna_gry","H_Bandanna_khk","H_Bandanna_khk_hs","H_Bandanna_mcamo","H_Bandanna_sand","H_Bandanna_sgg","H_Bandanna_surfer","H_Bandanna_surfer_blk","H_Bandanna_surfer_grn","H_BandMask_blk","H_BandMask_demon","H_BandMask_khk","H_BandMask_reaper","H_Beret_02","H_Beret_blk","H_Beret_blk_POLICE","H_Beret_brn_SF","H_Beret_Colonel","H_Beret_gen_F","H_Beret_grn","H_Beret_grn_SF","H_Beret_ocamo","H_Beret_red","H_Booniehat_dgtl","H_Booniehat_dirty","H_Booniehat_grn","H_Booniehat_indp","H_Booniehat_khk","H_Booniehat_khk_hs","H_Booniehat_mcamo","H_Booniehat_oli","H_Booniehat_tan","H_Booniehat_tna_F","H_Cap_Black_IDAP_F","H_Cap_blk","H_Cap_blk_CMMG","H_Cap_blk_ION","H_Cap_blk_Raven","H_Cap_blk_Syndikat_F","H_Cap_blu","H_Cap_brn_SPECOPS","H_Cap_grn","H_Cap_grn_BI","H_Cap_grn_Syndikat_F","H_Cap_headphones","H_Cap_khaki_specops_UK","H_Cap_marshal","H_Cap_oli","H_Cap_oli_hs","H_Cap_oli_Syndikat_F","H_Cap_Orange_IDAP_F","H_Cap_police","H_Cap_press","H_Cap_red","H_Cap_surfer","H_Cap_tan","H_Cap_tan_specops_US","H_Cap_tan_Syndikat_F","H_Cap_usblack","H_Cap_White_IDAP_F","H_Construction_basic_black_F","H_Construction_basic_orange_F","H_Construction_basic_red_F","H_Construction_basic_vrana_F","H_Construction_basic_white_F","H_Construction_basic_yellow_F","H_Construction_earprot_black_F","H_Construction_earprot_orange_F","H_Construction_earprot_red_F","H_Construction_earprot_vrana_F","H_Construction_earprot_white_F","H_Construction_earprot_yellow_F","H_Construction_headset_black_F","H_Construction_headset_orange_F","H_Construction_headset_red_F","H_Construction_headset_vrana_F","H_Construction_headset_white_F","H_Construction_headset_yellow_F","H_EarProtectors_black_F","H_EarProtectors_orange_F","H_EarProtectors_red_F","H_EarProtectors_white_F","H_EarProtectors_yellow_F","H_Hat_blue","H_Hat_brown","H_Hat_camo","H_Hat_checker","H_Hat_grey","H_Hat_Safari_olive_F","H_Hat_Safari_sand_F","H_Hat_tan","H_HeadBandage_bloody_F","H_HeadBandage_clean_F","H_HeadBandage_stained_F","H_HeadSet_black_F","H_HeadSet_orange_F","H_HeadSet_red_F","H_HeadSet_white_F","H_HeadSet_yellow_F","H_Helmet_Skate","H_MilCap_blue","H_MilCap_dgtl","H_MilCap_gen_F","H_MilCap_ghex_F","H_MilCap_gry","H_MilCap_mcamo","H_MilCap_ocamo","H_MilCap_oucamo","H_MilCap_rucamo","H_MilCap_tna_F","H_Shemag_khk","H_Shemag_olive","H_Shemag_olive_hs","H_Shemag_tan","H_ShemagOpen_khk","H_ShemagOpen_tan","H_StrawHat","H_StrawHat_dark","H_Tank_black_F","H_TurbanO_blk","H_Watchcap_blk","H_Watchcap_camo","H_Watchcap_cbr","H_Watchcap_khk","H_Watchcap_sgg","H_WirelessEarpiece_F","U_AntigonaBody","U_AttisBody","U_C_Commoner1_1","U_C_Commoner1_2","U_C_Commoner1_3","U_C_Commoner2_1","U_C_Commoner2_2","U_C_Commoner2_3","U_C_Commoner_shorts","U_C_ConstructionCoverall_Black_F","U_C_ConstructionCoverall_Blue_F","U_C_ConstructionCoverall_Red_F","U_C_ConstructionCoverall_Vrana_F","U_C_Driver_1","U_C_Driver_1_black","U_C_Driver_1_blue","U_C_Driver_1_green","U_C_Driver_1_orange","U_C_Driver_1_red","U_C_Driver_1_white","U_C_Driver_1_yellow","U_C_Driver_2","U_C_Driver_3","U_C_Driver_4","U_C_Farmer","U_C_Fisherman","U_C_FishermanOveralls","U_C_HunterBody_brn","U_C_HunterBody_grn","U_C_IDAP_Man_cargo_F","U_C_IDAP_Man_casual_F","U_C_IDAP_Man_Jeans_F","U_C_IDAP_Man_shorts_F","U_C_IDAP_Man_Tee_F","U_C_IDAP_Man_TeeShorts_F","U_C_Journalist","U_C_Man_casual_1_F","U_C_Man_casual_2_F","U_C_Man_casual_3_F","U_C_Man_casual_4_F","U_C_Man_casual_5_F","U_C_Man_casual_6_F","U_C_man_sport_1_F","U_C_man_sport_2_F","U_C_man_sport_3_F","U_C_Mechanic_01_F","U_C_Novak","U_C_Paramedic_01_F","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_C_Poor_1","U_C_Poor_2","U_C_Poor_shorts_1","U_C_Poor_shorts_2","U_C_PriestBody","U_C_Protagonist_VR","U_C_Scavenger_1","U_C_Scavenger_2","U_C_Scientist","U_C_ShirtSurfer_shorts","U_C_Soldier_VR","U_C_TeeSurfer_shorts_1","U_C_TeeSurfer_shorts_2","U_C_WorkerCoveralls","U_C_WorkerOveralls","U_Competitor","U_I_C_Soldier_Bandit_1_F","U_I_C_Soldier_Bandit_2_F","U_I_C_Soldier_Bandit_3_F","U_I_C_Soldier_Bandit_4_F","U_I_C_Soldier_Bandit_5_F","U_I_C_Soldier_Camo_F","U_I_C_Soldier_Para_1_F","U_I_C_Soldier_Para_2_F","U_I_C_Soldier_Para_3_F","U_I_C_Soldier_Para_4_F","U_I_C_Soldier_Para_5_F","U_I_G_resistanceLeader_F","U_I_G_Story_Protagonist_F","U_I_GhillieSuit","U_I_HeliPilotCoveralls","U_I_OfficerUniform","U_I_pilotCoveralls","U_I_Protagonist_VR","U_I_Soldier_VR","U_I_Wetsuit","U_IG_Guerilla1_1","U_IG_Guerilla2_1","U_IG_Guerilla2_2","U_IG_Guerilla2_3","U_IG_Guerilla3_1","U_IG_Guerilla3_2","U_IG_Guerrilla_6_1","U_IG_leader","U_IG_Menelaos","U_KerryBody","U_Marshal","U_MillerBody","U_NikosAgedBody","U_NikosBody"] call BIS_fnc_selectRandom;

_this addItemCargoGlobal [_item1,1];
_this addItemCargoGlobal [_item2,2];
_this addItemCargoGlobal [_item3,1];
_this addItemCargoGlobal [_cloth1,1];

 

Now I dont want to crate multiple crates because I want to add an inventory to different items such as garbage bins and tents and such. The item that should get the inventory gets the loot from the ammo crate like this:

 

this addaction ["Search", 
{myammocrate_1 setpos position (_this select 1); 
(_this select 1) action ["Gear", myammocrate_1]},[], 6, true, true, "", "(_this distance _target)<3"];

Now that works well but I want to add several bins and tents and such and I would like them all to have the same crate in their. Problem is, the crate generates the items onces and then all would have the same items.

 

Is there an easy way to let the sleep and repeat the script like every 30 seconds?

 

LJ

Share this post


Link to post
Share on other sites

Sure, you could wrap it in a while loop:

 

_this allowDamage false; 

_item1array = ["ItemWatch","ItemMap","Binocular","FirstAidKit","Medikit","rb_antibiotic","rb_Waterpure","rb_bandage","rb_bloodbag","rb_Meat","rb_MeatC","rb_TacticalBacon","rb_BakedBeans","rb_TacticalBaconempty","rb_BakedBeansempty","rb_bottle","rb_bottleclean","rb_bottledirty","rb_bottlesalt","rb_Spirit","rb_franta","rb_Spiritempty","rb_frantaempty","rb_oldcan","rb_redgull","rb_redgullempty","rb_hammer","rb_saw","rb_wrench","rb_Axe","rb_ducttape","rb_cereal","rb_RiceBox","rb_canteen","rb_canteen_dirty","rb_canteen_salt","rb_canteen_empty","rb_matches","rb_nails","rb_knife","rb_HandyCam","rb_MobilePhone","rb_SmartPhone","rb_file"];
_item2array = ["ItemWatch","ItemMap","Binocular","FirstAidKit","Medikit","rb_antibiotic","rb_Waterpure","rb_bandage","rb_bloodbag","rb_Meat","rb_MeatC","rb_TacticalBacon","rb_BakedBeans","rb_TacticalBaconempty","rb_BakedBeansempty","rb_bottle","rb_bottleclean","rb_bottledirty","rb_bottlesalt","rb_Spirit","rb_franta","rb_Spiritempty","rb_frantaempty","rb_oldcan","rb_redgull","rb_redgullempty","rb_hammer","rb_saw","rb_wrench","rb_Axe","rb_ducttape","rb_cereal","rb_RiceBox","rb_canteen","rb_canteen_dirty","rb_canteen_salt","rb_canteen_empty","rb_matches","rb_nails","rb_knife","rb_HandyCam","rb_MobilePhone","rb_SmartPhone","rb_file"];
_item3array = ["ItemWatch","ItemMap","Binocular","FirstAidKit","Medikit","rb_antibiotic","rb_Waterpure","rb_bandage","rb_bloodbag","rb_Meat","rb_MeatC","rb_TacticalBacon","rb_BakedBeans","rb_TacticalBaconempty","rb_BakedBeansempty","rb_bottle","rb_bottleclean","rb_bottledirty","rb_bottlesalt","rb_Spirit","rb_franta","rb_Spiritempty","rb_frantaempty","rb_oldcan","rb_redgull","rb_redgullempty","rb_hammer","rb_saw","rb_wrench","rb_Axe","rb_ducttape","rb_cereal","rb_RiceBox","rb_canteen","rb_canteen_dirty","rb_canteen_salt","rb_canteen_empty","rb_matches","rb_nails","rb_knife","rb_HandyCam","rb_MobilePhone","rb_SmartPhone","rb_file"];
_cloth1array = ["H_Bandanna_camo","H_Bandanna_cbr","H_Bandanna_gry","H_Bandanna_khk","H_Bandanna_khk_hs","H_Bandanna_mcamo","H_Bandanna_sand","H_Bandanna_sgg","H_Bandanna_surfer","H_Bandanna_surfer_blk","H_Bandanna_surfer_grn","H_BandMask_blk","H_BandMask_demon","H_BandMask_khk","H_BandMask_reaper","H_Beret_02","H_Beret_blk","H_Beret_blk_POLICE","H_Beret_brn_SF","H_Beret_Colonel","H_Beret_gen_F","H_Beret_grn","H_Beret_grn_SF","H_Beret_ocamo","H_Beret_red","H_Booniehat_dgtl","H_Booniehat_dirty","H_Booniehat_grn","H_Booniehat_indp","H_Booniehat_khk","H_Booniehat_khk_hs","H_Booniehat_mcamo","H_Booniehat_oli","H_Booniehat_tan","H_Booniehat_tna_F","H_Cap_Black_IDAP_F","H_Cap_blk","H_Cap_blk_CMMG","H_Cap_blk_ION","H_Cap_blk_Raven","H_Cap_blk_Syndikat_F","H_Cap_blu","H_Cap_brn_SPECOPS","H_Cap_grn","H_Cap_grn_BI","H_Cap_grn_Syndikat_F","H_Cap_headphones","H_Cap_khaki_specops_UK","H_Cap_marshal","H_Cap_oli","H_Cap_oli_hs","H_Cap_oli_Syndikat_F","H_Cap_Orange_IDAP_F","H_Cap_police","H_Cap_press","H_Cap_red","H_Cap_surfer","H_Cap_tan","H_Cap_tan_specops_US","H_Cap_tan_Syndikat_F","H_Cap_usblack","H_Cap_White_IDAP_F","H_Construction_basic_black_F","H_Construction_basic_orange_F","H_Construction_basic_red_F","H_Construction_basic_vrana_F","H_Construction_basic_white_F","H_Construction_basic_yellow_F","H_Construction_earprot_black_F","H_Construction_earprot_orange_F","H_Construction_earprot_red_F","H_Construction_earprot_vrana_F","H_Construction_earprot_white_F","H_Construction_earprot_yellow_F","H_Construction_headset_black_F","H_Construction_headset_orange_F","H_Construction_headset_red_F","H_Construction_headset_vrana_F","H_Construction_headset_white_F","H_Construction_headset_yellow_F","H_EarProtectors_black_F","H_EarProtectors_orange_F","H_EarProtectors_red_F","H_EarProtectors_white_F","H_EarProtectors_yellow_F","H_Hat_blue","H_Hat_brown","H_Hat_camo","H_Hat_checker","H_Hat_grey","H_Hat_Safari_olive_F","H_Hat_Safari_sand_F","H_Hat_tan","H_HeadBandage_bloody_F","H_HeadBandage_clean_F","H_HeadBandage_stained_F","H_HeadSet_black_F","H_HeadSet_orange_F","H_HeadSet_red_F","H_HeadSet_white_F","H_HeadSet_yellow_F","H_Helmet_Skate","H_MilCap_blue","H_MilCap_dgtl","H_MilCap_gen_F","H_MilCap_ghex_F","H_MilCap_gry","H_MilCap_mcamo","H_MilCap_ocamo","H_MilCap_oucamo","H_MilCap_rucamo","H_MilCap_tna_F","H_Shemag_khk","H_Shemag_olive","H_Shemag_olive_hs","H_Shemag_tan","H_ShemagOpen_khk","H_ShemagOpen_tan","H_StrawHat","H_StrawHat_dark","H_Tank_black_F","H_TurbanO_blk","H_Watchcap_blk","H_Watchcap_camo","H_Watchcap_cbr","H_Watchcap_khk","H_Watchcap_sgg","H_WirelessEarpiece_F","U_AntigonaBody","U_AttisBody","U_C_Commoner1_1","U_C_Commoner1_2","U_C_Commoner1_3","U_C_Commoner2_1","U_C_Commoner2_2","U_C_Commoner2_3","U_C_Commoner_shorts","U_C_ConstructionCoverall_Black_F","U_C_ConstructionCoverall_Blue_F","U_C_ConstructionCoverall_Red_F","U_C_ConstructionCoverall_Vrana_F","U_C_Driver_1","U_C_Driver_1_black","U_C_Driver_1_blue","U_C_Driver_1_green","U_C_Driver_1_orange","U_C_Driver_1_red","U_C_Driver_1_white","U_C_Driver_1_yellow","U_C_Driver_2","U_C_Driver_3","U_C_Driver_4","U_C_Farmer","U_C_Fisherman","U_C_FishermanOveralls","U_C_HunterBody_brn","U_C_HunterBody_grn","U_C_IDAP_Man_cargo_F","U_C_IDAP_Man_casual_F","U_C_IDAP_Man_Jeans_F","U_C_IDAP_Man_shorts_F","U_C_IDAP_Man_Tee_F","U_C_IDAP_Man_TeeShorts_F","U_C_Journalist","U_C_Man_casual_1_F","U_C_Man_casual_2_F","U_C_Man_casual_3_F","U_C_Man_casual_4_F","U_C_Man_casual_5_F","U_C_Man_casual_6_F","U_C_man_sport_1_F","U_C_man_sport_2_F","U_C_man_sport_3_F","U_C_Mechanic_01_F","U_C_Novak","U_C_Paramedic_01_F","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_C_Poor_1","U_C_Poor_2","U_C_Poor_shorts_1","U_C_Poor_shorts_2","U_C_PriestBody","U_C_Protagonist_VR","U_C_Scavenger_1","U_C_Scavenger_2","U_C_Scientist","U_C_ShirtSurfer_shorts","U_C_Soldier_VR","U_C_TeeSurfer_shorts_1","U_C_TeeSurfer_shorts_2","U_C_WorkerCoveralls","U_C_WorkerOveralls","U_Competitor","U_I_C_Soldier_Bandit_1_F","U_I_C_Soldier_Bandit_2_F","U_I_C_Soldier_Bandit_3_F","U_I_C_Soldier_Bandit_4_F","U_I_C_Soldier_Bandit_5_F","U_I_C_Soldier_Camo_F","U_I_C_Soldier_Para_1_F","U_I_C_Soldier_Para_2_F","U_I_C_Soldier_Para_3_F","U_I_C_Soldier_Para_4_F","U_I_C_Soldier_Para_5_F","U_I_G_resistanceLeader_F","U_I_G_Story_Protagonist_F","U_I_GhillieSuit","U_I_HeliPilotCoveralls","U_I_OfficerUniform","U_I_pilotCoveralls","U_I_Protagonist_VR","U_I_Soldier_VR","U_I_Wetsuit","U_IG_Guerilla1_1","U_IG_Guerilla2_1","U_IG_Guerilla2_2","U_IG_Guerilla2_3","U_IG_Guerilla3_1","U_IG_Guerilla3_2","U_IG_Guerrilla_6_1","U_IG_leader","U_IG_Menelaos","U_KerryBody","U_Marshal","U_MillerBody","U_NikosAgedBody","U_NikosBody"];

while {true} do {

    clearWeaponCargoGlobal _this; 
    clearMagazineCargoGlobal _this; 
    clearItemCargoGlobal _this; 
    clearBackpackCargoGlobal _this;
    
    _item1 = selectRandom _item1array;
    _item2 = selectRandom _item2array;
    _item3 = selectRandom _item3array;
    _cloth1 = selectRandom _cloth1array;
    
    _this addItemCargoGlobal [_item1,1];
    _this addItemCargoGlobal [_item2,2];
    _this addItemCargoGlobal [_item3,1];
    _this addItemCargoGlobal [_cloth1,1];
    
	sleep 30;
    
};

 

  • Thanks 1

Share this post


Link to post
Share on other sites
4 hours ago, LordJarhead said:

Now that works well but I want to add several bins and tents and such and I would like them all to have the same crate in their. Problem is, the crate generates the items onces and then all would have the same items.Is there an easy way to let the sleep and repeat the script like every 30 seconds?

 

LJ

 

Made something similar a while ago and modified it to your needs.

It basically checks if a cursorObject is an allowed type to receive the hidden loot crate, places and fills the loot crate.

Should work fine in MP.

 

initServer.sqf:

missionNamespace setVariable ["GOM_fnc_allLootObjects",[],true];
missionNamespace setVariable ["GOM_fnc_allLootFakeCrates",[],true];
missionNamespace setVariable ["GOM_fnc_allowedLootObjects",["Land_GarbageBin_02_F","Land_GarbageHeap_04_F","Land_GarbageBags_F"],true];//modify this to add custom objects that serve as loot objects

initPlayerLocal.sqf:
 

GOM_fnc_fillCrate = {

	params ["_crate"];

	_amount = 1 + random 4;
	_weapons = ["SMG_01_Holo_F",0.75,"arifle_AK12_F",0.55,"srifle_DMR_01_DMS_F",0.15];

	for "_i" from 0 to _amount do {
		//pick a random weapon each iteration according to weights
		_weapon = selectRandomWeighted _weapons;
		_crate addWeaponCargoGlobal [_weapon,1];
		//add at least 4 baseline magazines and 4 random ones (like tracers etc)
		_mags = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
		_crate addMagazineCargoGlobal [_mags#0,4 + random 4];
		_rndMags = 1 + random 4;
		for "_j" from 0 to _rndMags do {
			_crate addMagazineCargoGlobal [selectRandom (_mags - [_mags#0]),1];
		};
	};


};

player addAction ["Search",{

	params ["_object","_caller","_ID"];

	_lootObj = cursorObject;

	if (_lootObj in GOM_fnc_allLootObjects) exitWith {

		_crate = GOM_fnc_allLootFakeCrates select (GOM_fnc_allLootObjects find _lootObj);
		_caller action ["Gear",_crate];

	};

	_crate = "Box_IND_Ammo_F" createVehicle [0,0,500];//change to whatever class you seem fit
	_crate hideObjectGlobal true;
	_crate allowDamage false;
	_crate enableSimulationGlobal false;
	_crate setposATL getPosATL _lootObj;

	clearItemCargoGlobal _crate;
	clearWeaponCargoGlobal _crate;
	clearMagazineCargoGlobal _crate;

	[_crate] call GOM_fnc_fillCrate;

	_caller action ["Gear",_crate];

	_allLootObjs = missionNamespace getVariable ["GOM_fnc_allLootObjects",[]];
	_allFakeCrates = missionNamespace getVariable ["GOM_fnc_allLootFakeCrates",[]];

	_allLootObjs pushBack _lootObj;
	_allFakeCrates pushBack _crate;

	missionNamespace setVariable ["GOM_fnc_allLootObjects",_allLootObjs,true];
	missionNamespace setVariable ["GOM_fnc_allLootFakeCrates",_allFakeCrates,true];

},[],0,true,true,"","typeOf cursorObject in GOM_fnc_allowedLootObjects AND {_target distance cursorObject < 2} AND {_this isEqualTo vehicle _this} AND {_target isEqualTo _this}"];


The fillCrate function is just to showcase the functionality, requires the ammo crate as a parameter, you can easily add your own loot distribution inside this function.

 

 

Quick demo mission.

 

Cheers

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

Oh wow thanks both of you, guys! 

 

Grumpy, may it be that your loot is not randomly selected? Like you have the same loot in each crate? 

 

Thanks for all the help! This is really great! 

 

I'm about to bother you with the next idea, soon :) 

 

LJ 

Share this post


Link to post
Share on other sites
1 minute ago, LordJarhead said:

Oh wow thanks both of you, guys! 

 

Grumpy, may it be that your loot is not randomly selected? Like you have the same loot in each crate? 

 

Thanks for all the help! This is really great! 

 

I'm about to bother you with the next idea, soon :) 

 

LJ 

 

The loot is entirely random, it's just selected randomly from 3 different rifles, with a larger weapon pool the outcome will have a bigger variety of course.

 

Cheers

Share this post


Link to post
Share on other sites
13 hours ago, Harzach said:

You could assemble arrays of specific items for each item type (primary weapon, secondary weapon, launcher, uniform, vest, backpack, etc.) and "level" (low spec, med spec, high spec), then write a script or function that runs on every AI at spawn that removes all of their items then equips them randomly from those arrays. I am almost positive that there are a few script systems out there that do just this.

 

Now that's still a topic in my mind. On how to get this to work. But honestly, I don't get a single thing. Would you be able to point out a few more things here or maybe even a small template? 

 

@Grumpy Old Manoh OK cool. I'll gonna check that as well. Thanks for all the help, gents!

 

LJ 

Share this post


Link to post
Share on other sites
4 hours ago, Grumpy Old Man said:

 

The loot is entirely random, it's just selected randomly from 3 different rifles, with a larger weapon pool the outcome will have a bigger variety of course.

 

Cheers

Doe

 

5 hours ago, Grumpy Old Man said:

 

Made something similar a while ago and modified it to your needs.

It basically checks if a cursorObject is an allowed type to receive the hidden loot crate, places and fills the loot crate.

Should work fine in MP.

 

initServer.sqf:


missionNamespace setVariable ["GOM_fnc_allLootObjects",[],true];
missionNamespace setVariable ["GOM_fnc_allLootFakeCrates",[],true];
missionNamespace setVariable ["GOM_fnc_allowedLootObjects",["Land_GarbageBin_02_F","Land_GarbageHeap_04_F","Land_GarbageBags_F"],true];//modify this to add custom objects that serve as loot objects

initPlayerLocal.sqf:
 


GOM_fnc_fillCrate = {

	params ["_crate"];

	_amount = 1 + random 4;
	_weapons = ["SMG_01_Holo_F",0.75,"arifle_AK12_F",0.55,"srifle_DMR_01_DMS_F",0.15];

	for "_i" from 0 to _amount do {
		//pick a random weapon each iteration according to weights
		_weapon = selectRandomWeighted _weapons;
		_crate addWeaponCargoGlobal [_weapon,1];
		//add at least 4 baseline magazines and 4 random ones (like tracers etc)
		_mags = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines");
		_crate addMagazineCargoGlobal [_mags#0,4 + random 4];
		_rndMags = 1 + random 4;
		for "_j" from 0 to _rndMags do {
			_crate addMagazineCargoGlobal [selectRandom (_mags - [_mags#0]),1];
		};
	};


};

player addAction ["Search",{

	params ["_object","_caller","_ID"];

	_lootObj = cursorObject;

	if (_lootObj in GOM_fnc_allLootObjects) exitWith {

		_crate = GOM_fnc_allLootFakeCrates select (GOM_fnc_allLootObjects find _lootObj);
		_caller action ["Gear",_crate];

	};

	_crate = "Box_IND_Ammo_F" createVehicle [0,0,500];//change to whatever class you seem fit
	_crate hideObjectGlobal true;
	_crate allowDamage false;
	_crate enableSimulationGlobal false;
	_crate setposATL getPosATL _lootObj;

	clearItemCargoGlobal _crate;
	clearWeaponCargoGlobal _crate;
	clearMagazineCargoGlobal _crate;

	[_crate] call GOM_fnc_fillCrate;

	_caller action ["Gear",_crate];

	_allLootObjs = missionNamespace getVariable ["GOM_fnc_allLootObjects",[]];
	_allFakeCrates = missionNamespace getVariable ["GOM_fnc_allLootFakeCrates",[]];

	_allLootObjs pushBack _lootObj;
	_allFakeCrates pushBack _crate;

	missionNamespace setVariable ["GOM_fnc_allLootObjects",_allLootObjs,true];
	missionNamespace setVariable ["GOM_fnc_allLootFakeCrates",_allFakeCrates,true];

},[],0,true,true,"","typeOf cursorObject in GOM_fnc_allowedLootObjects AND {_target distance cursorObject < 2} AND {_this isEqualTo vehicle _this} AND {_target isEqualTo _this}"];


The fillCrate function is just to showcase the functionality, requires the ammo crate as a parameter, you can easily add your own loot distribution inside this function.

 

 

Quick demo mission.

 

Cheers

 

Ok with this I can't seem to get any items out of the crate. I thought the objects might have disabled simulation but that wasn't the case.

 

Also, this seems to be all useful for weapons and magazines, but I'd expect to find random items like hats, matches, water bottles and such things (ArmA3ItemsMod) in a garbage bin and not an AK12, you know? :P As said, I'm barely even a noob when it comes to scripting :((

 

LJ

Share this post


Link to post
Share on other sites
5 hours ago, LordJarhead said:

Now that's still a topic in my mind. On how to get this to work. But honestly, I don't get a single thing. Would you be able to point out a few more things here or maybe even a small template? 

 

I'm working on something for myself which does this, but is only applied to one side.

 

Do you want the randomization to be applied to just one side, all sides, or only certain sides?

Share this post


Link to post
Share on other sites
Just now, Harzach said:

 

I'm working on something for myself which does this, but is only applied to one side.

 

Do you want the randomization to be applied to just one side, all sides, or only certain sides?

Cool!

 

Actually there are all sides running around and fighting each other, so all sides I'd say :)

 

LJ

Share this post


Link to post
Share on other sites
11 minutes ago, LordJarhead said:

all sides

 

I'd assume that you'd want separate item pools for each side then :D

 

Share this post


Link to post
Share on other sites
Just now, Harzach said:

 

I'd assume that you'd want separate item pools for each side then :D

 

 

Not quiet necessarily, like they are all kinda lone wolfs fighting everything else. So there is no "real side" in the mission. Its just a bunch of raiders so to say. Most should start with real crappy gear like a PM 9mm or a Rook40 or something, maybe an Protector, nothing more. Only some smaller groups have like a more quality gear and powerful weapons.

Share this post


Link to post
Share on other sites

Nuts! The system I'm working on requires CBA, I totally forgot. Let me know if that's an issue for you.

  • Thanks 1

Share this post


Link to post
Share on other sites
3 hours ago, Harzach said:

Nuts! The system I'm working on requires CBA, I totally forgot. Let me know if that's an issue for you.

Well I guess that's OK. I might wanted to add different weapon mods as well later on when things are stable. So I guess it would worth the shot. Thanks for your help mate :) 

 

LJ 

Share this post


Link to post
Share on other sites
On 6.6.2018 at 3:36 AM, Harzach said:

Nuts! The system I'm working on requires CBA, I totally forgot. Let me know if that's an issue for you.

 

How it goes, mate :)

 

LJ

Share this post


Link to post
Share on other sites
1 hour ago, LordJarhead said:

 

How it goes, mate :)

 

LJ

Slow, sorry! Real life demands win every time.

Share this post


Link to post
Share on other sites
On 6/5/2018 at 11:24 PM, LordJarhead said:

Doe

 

 

Ok with this I can't seem to get any items out of the crate. I thought the objects might have disabled simulation but that wasn't the case.

 

Also, this seems to be all useful for weapons and magazines, but I'd expect to find random items like hats, matches, water bottles and such things (ArmA3ItemsMod) in a garbage bin and not an AK12, you know? :P As said, I'm barely even a noob when it comes to scripting :((

 

LJ

 

Of course you'd need to modify the fill crate function to fill the crate as you need.

Up to you to add items, mod items and whatnot to it.

This was just an example to show how this could be done in a performance friendly way.

Of course finding an AK12 in a garbage bin would be a rare occasion in most parts of the world.

 

You could always post in the find or offer editing forum if you want someone else to script stuff for you.

As long as your request isn't "Altis life dev wanted" thread no. 5000+ I'm sure people are willing to help, heh.

 

Cheers

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

×