Jump to content

Recommended Posts

2 minutes ago, RZNUNKWN said:

"HIT scalar NaNm"

 

Have you delete the ?

_distance = _killer distance2D _killed;

if yes copy this again.

  • Thanks 1

Share this post


Link to post
Share on other sites

It works now, and it was so simple. I'm really bad at this. 🤦‍♂️

Thanks, GF!

  • Haha 1

Share this post


Link to post
Share on other sites
On 3/3/2019 at 9:03 AM, RZNUNKWN said:

Thanks, GF!

 

I forgot to tell you , that there is this also if you want to check :

 

 

This is a money killing reward according to the distance , with a simple notification added.

 

  • Like 1

Share this post


Link to post
Share on other sites

I'm prty new to scripting but I may be retarded too, can't find a way to add the possibility thing

Can't add this

//________________    add _possibility    ________________

_possibility            = random 10 < 3;

if (_possibility) then {
	<code>
	};

to this

//________________ Drop items ________________			
			
			_Drop_items = "groundWeaponHolder" createVehicle (getpos _unit);
			
			_Drop_items addItemCargoGlobal [(selectRandom[
			
			//________________ Ravage_items ________________
			"rvg_money", 
			"rvg_money",
			"rvg_money",			
			"rvg_spirit", 
			"rvg_franta",
			"rvg_beans", 
			"rvg_bacon", 			
			"rvg_rustyCanEmpty",
			"rvg_beansEmpty",
			"rvg_baconEmpty",
			"rvg_spiritEmpty",
			"rvg_frantaEmpty",
			"rvg_plasticBottleEmpty"
	
			]), 1];	//	select the amount of the items
	};
}];

I'd appreciate if you could explain like I'm 5. ty

  • Like 1

Share this post


Link to post
Share on other sites

Hello there GreenXp !

 

So first of all ,

are you using any kind of editing ( .sqf) program ?

Share this post


Link to post
Share on other sites
1 minute ago, GEORGE FLOROS GR said:

Hello there GreenXp !

 

So first of all ,

are you using any kind of editing ( .sqf) program ?

Notepad++

  • Like 1

Share this post


Link to post
Share on other sites

There is also highlighting for the sqf , the link is in the front page.

 

There are the options (settings) that you can set , to true or false and if you follow ( click to find ) what you want ,

 

ex.  _12_Drop_Items

 

//________________	Drop Items	________________			


if (_12_Drop_Items) then {	

if (_Systemchat_Enabled) then {
systemchat "_12_Drop_Items";
};
			

//_Drop_Items = "groundWeaponHolder" createVehicle (getpos _unit);
						
_Drop_Items_Amount =   round (1 + random 1);
_Drop_Items = "WeaponHolderSimulated" createVehicle (getpos _unit); 

//	OR add rarity 
//	if (floor (random 20) < 2) then {	the code below here	};

_Drop_Items addItemCargoGlobal [_addItemCargoGlobal_Array_1, _Drop_Items_Amount];
			
};			

 

i have already an exaple how to add a possibility to the code:

 

//    OR add rarity
//    if (floor (random 20) < 2) then {    the code below here    };

 

and this line here :

 

_Drop_Items addItemCargoGlobal [_addItemCargoGlobal_Array_1, _Drop_Items_Amount];

 

that is says , what will be the selected item ( the array that will be a random item selected )

_addItemCargoGlobal_Array_1

 

and the amount of the item

_Drop_Items_Amount

 

Then if you want the items to be from the certain default or your custom array also , then you need to add the certain array name (local variable ) there.

If you check what the _addItemCargoGlobal_Array_1 is , you will notice that it contains multiple arrays , which are selected on random :

 

//________________	Add random items in containers ( uniform , vest and backpack )	________________
//________________	You can adjust here the arrays
_addItemCargoGlobal_Array_1 = selectRandom[	

	_sideweapons_loot,
	_weapons_Loot,
	
	_magazineClass_sideweapon,
	_magazineClass_weapon,
	
	_items_loot1,
	_items_loot2,
	_items_loot3,
	_Clothes_array,
	_Vests_array,
	_Backpacks_array,
	
	_Ravage_items
];	

 

So , instead of using the _addItemCargoGlobal_Array_1 you can add the _Ravage_items included array , in the code above.

 

Finally , this example will look like :

 

if (_12_Drop_Items) then {	

if (_Systemchat_Enabled) then {
systemchat "_12_Drop_Items";
};
			

//_Drop_Items = "groundWeaponHolder" createVehicle (getpos _unit);
						
_Drop_Items_Amount =   round (1 + random 1);
_Drop_Items = "WeaponHolderSimulated" createVehicle (getpos _unit); 

if (random 10 < 2) then {    

	//	the code below here
	_Drop_Items addItemCargoGlobal [_Ravage_items, _Drop_Items_Amount];
 };
			
};	

 

Share this post


Link to post
Share on other sites

As it turns out I'm too retarded and couldn't figure it out after hours so I ended up doing this (added spaces between items, as it is right now it looks like it's a 1 to 3 ratio but sometimes more), I'm surprised it works but I'm happy with it and I'm done messing with scripts I'm too retarded for them.

//________________ Enemies , will drop items or add to their inventory , when killed , configurable ________________

addMissionEventHandler ["EntityKilled", 
{
	params ["_killed", "_killer"];	
	if (_killed isKindOf "CAManBase"  

//________________ you can select to enable the script with the side of the killed persons ________________	

	
	&& {(	
		(side group _killed) == east || 
		(side group _killed) == independent ||		
		(side group _killed) == west)	
		}

		
		) then
	{
	//systemChat format ["killed"];
	
//________________ notification ________________	
//	[[
//		["Killed","align = 'center' size = '1' font='PuristaBold'","#FBFCFE"]
//	]]spawn BIS_fnc_typeText2;
	
			_unit = _this select 0;

//________________  add to their inventory ________________	
			
			//you can add a vest (when killed!)
//			_unit addVest				"";

			
			//you can add a weapon (on random)
//			_PrimaryWeapon = selectRandom [
			//LightMachineGuns
//			""
//			];
			
//			_unit addWeaponGlobal		_PrimaryWeapon;

			//you can add a certain weapon
			//_unit addWeaponGlobal			"";
			
			//you can attachment of the weapon
//			_unit addPrimaryWeaponItem	"";
			
//			_uniform	= uniformContainer _unit;
//			_vest		= vestContainer _unit;
			
			//add to their inventory
//			_unit linkItem "";
			
			//add in their uniform
//			_uniform addMagazineCargoGlobal ["", 0];
//			_uniform addItemCargoGlobal		["", 0];			
			
			//add in their vest
//			_vest addMagazineCargoGlobal ["", 0];

			
//________________ Drop items ________________			
			
			_Drop_items = "groundWeaponHolder" createVehicle (getpos _unit);
			
			_Drop_items addItemCargoGlobal [(selectRandom[
			
			
			
			//________________ Ravage_items ________________
			"rvg_money",
			"",			
			"rvg_money",
			"",
			"",
			"rvg_money",
			"", 
			"rvg_money",
			"",
			"rvg_money",
			"", 
			"rvg_money",
			"",
			"rvg_money",
			"", 
			"rvg_money",
			"",
			"rvg_money",
			"", 
			"rvg_money",
			"",
			"",
			"rvg_money",
			"",			
			"rvg_money",
			"",
			"",
			"rvg_money",
			"", 
			"rvg_money",
			"",
			"rvg_money",
			"", 
			"rvg_money",
			"",
			"",
			"rvg_money",
			"",
			"rvg_money",
			"", 
			"rvg_money",
			"",			
			"rvg_spirit",
            "",			
			"rvg_franta",
			"",
			"",
			"rvg_beans", 
			"",
			"rvg_bacon",
            "", 			
			"rvg_rustyCanEmpty",
			"",
			"rvg_beansEmpty",
			"",
			"rvg_baconEmpty",
			"",
			"rvg_spiritEmpty",
			"",
			"rvg_frantaEmpty",
			"",
			"rvg_plasticBottleEmpty"
	
			]), 1];	//	select the amount of the items
	};
}];

 

Share this post


Link to post
Share on other sites

You could as i told you ,

just set in the settings , anything that you didn't like to false , instead of starting deleting lines and messing without needed nd wasting time and this is why i gave you the certain example complete , just to copy paste from the topic.

Share this post


Link to post
Share on other sites
8 hours ago, GEORGE FLOROS GR said:

You could as i told you ,

just set in the settings , anything that you didn't like to false , instead of starting deleting lines and messing without needed nd wasting time and this is why i gave you the certain example complete , just to copy paste from the topic.

I did copy paste that but it wouldn't work and I don't know where to put the items that I want to spawn too, I told you I'm too retarded for this shit.

Share this post


Link to post
Share on other sites
10 minutes ago, GreenXp said:

where to put the items that I want to spawn

 

You can select any array and modify this or even make your custom.

So else if you are ok with your edit , then since it's working it's fine.

Share this post


Link to post
Share on other sites

just check the selectrandom if you want :

https://community.bistudio.com/wiki/selectRandom

 

you don't need even with this code to add all this code , just :

 

_Ravage_items = selectRandom [

	"rvg_money",
	"rvg_money",
	"rvg_money",
	"rvg_money",
	"rvg_franta",
	"rvg_beans", 
	"rvg_bacon",		
	"rvg_rustyCanEmpty",
	"rvg_beansEmpty",
	"rvg_baconEmpty",
	"rvg_spiritEmpty",
	"rvg_frantaEmpty",
	"rvg_plasticBottleEmpty"
	];


_Items_Amount = 1 + random 1;
_Drop_Items = "WeaponHolderSimulated" createVehicle (getpos _unit); 

if (random 9 < 3) then {    //	add the possibility here

	_Drop_Items addItemCargoGlobal [_Ravage_items, _Items_Amount];
};

 

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

×