Jump to content
khaosmatical

% Presence object deletion

Recommended Posts

So I'm doing a dynamic raptor mission of sorts in which I've used object presence to help give some randomness to each playthrough. With some of the items for example 'rarer' weapons I've placed the ammo with them (this could be solved by putting it in a crate together but I'm aiming more for an immersion factor with this.) What I'm trying to do is when the weapon does not spawn due to the % chance presence can I also delete the ammo and if possible do it only on objects rather than having to have more triggers?

 

 

Share this post


Link to post
Share on other sites

consider something like this:

(this is a snippet of a piece of code I have written)

for "_i" from 0 to 10 do {
_rN =  random 100;
_chance = 50;
	if(_rn  > _chance ) then {

	};
};

I'm not sure I fully understand the question though.

Hopefully this helps? 

Share this post


Link to post
Share on other sites
2 hours ago, khaosmatical said:

So I'm doing a dynamic raptor mission of sorts in which I've used object presence to help give some randomness to each playthrough. With some of the items for example 'rarer' weapons I've placed the ammo with them (this could be solved by putting it in a crate together but I'm aiming more for an immersion factor with this.) What I'm trying to do is when the weapon does not spawn due to the % chance presence can I also delete the ammo and if possible do it only on objects rather than having to have more triggers?

 

 

Immersion factor considering raptors carrying magazines?

Whatever floats your boat I guess.

 


_raptors = [raptor1,raptor2,raptor3];
_weapons = ["arifle_AKM_F","arifle_CTARS_blk_F","arifle_Katiba_F"];
_weapons = _weapons - [selectRandom _weapons];


_magazines = _weapons apply {selectRandom (getArray (configfile >> "CfgWeapons" >> _x >> "magazines"))};

{
_count = round random [2,4,8];
_rndMag = selectRandom _magazines;
_x addMagazines [selectRandom _magazines,_count];
systemchat str format ["%1 carrying %2 %3",_x,_count, _rndMag];
} forEach _raptors;

 

Cheers

Share this post


Link to post
Share on other sites
11 hours ago, khaosmatical said:

What I'm trying to do is when the weapon does not spawn due to the % chance presence can I also delete the ammo and if possible do it only on objects rather than having to have more triggers?

Give the placed weapon a "variable name" example weap1 and set its probability as needed. Then in the ammos "condition of presence" put

!isNil "weap1" 

If the weapon does not spawn due to its probability then the variable weap1 will be nil causing the ammo not to spawn as well.

 

Just make sure you place the ammo after placing the weapon as they will be spawned in the order placed, so if you place the ammo first it will be spawned first and weap1 will always be nil causing it to never spawn.

Share this post


Link to post
Share on other sites

Addition to the chance of spawning:

With the random command you can use 

_number = round random [0,10,0]; // random [min,mid,max];
_weapons select _number; // 10 is most likely, 0 very unlikely

To test this command I've made a script (just for you ;) , though you don't have to use it ofcourse):

@Midnighters solution is fine as well. I've done this in a very similar way so far.

  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, Larrow said:

Then in the ammos "condition of presence"

 

Wow, after all the thousands of hours I've played the ARMA series, I have literally never noticed the 'condition of presence' on objects... Now I feel dumb.

 

Much appreciated everyone, I can continue building the nightmare inducing mission.

  • Like 1

Share this post


Link to post
Share on other sites
On 4/29/2017 at 4:30 AM, khaosmatical said:

 

Wow, after all the thousands of hours I've played the ARMA series, I have literally never noticed the 'condition of presence' on objects... Now I feel dumb.

 

Much appreciated everyone, I can continue building the nightmare inducing mission.

Wait. What?

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

×