Jump to content
DirtyDel

Trigger probability chance

Recommended Posts

Guys, I really tried posting a new new topic as a last resort. Syntax can get so frustrating. It gets to a point where I'm wasting so much time trying to figure it out.

 

I'm trying to get a trigger that has a 50% activation chance when blufor is present within.

 

Trigger 100m

Activation [BLUFOR]

Activation type [Present]

 

What I've tried in  condition:

 

this && ceil random 2 < 1 (no activation)

this && ceil random 2 > 1 (activates every time)

this && ceil random 1> 2 (no activation)

this && ceil random 1<2 (activates every time)

random 2; (no activation)

 

 

Share this post


Link to post
Share on other sites

this && random 1 < 0.5, but you cannot have repeated activation ticked, because it will just randomly activate deactivate, should be set to activate once

 

Share this post


Link to post
Share on other sites

Neither of those worked. It was activation every time. I'm struggling here.

Share this post


Link to post
Share on other sites

Wait of course it will happen every time, condition is checked every 0.5 seconds so early or later the random condition will become true and it will activate. You need to generate random number outside the trigger, or even better randomly remove some triggers

  • Like 1

Share this post


Link to post
Share on other sites

Put this in OnActivation before your code:

if (random 1 < 0.5) exitWith {deleteVehicle thisTrigger}; //.... rest of the code here

 Condition is just 

this

 

Share this post


Link to post
Share on other sites

I think I understand what you're saying: all of the "random # < #" commands are based on time?

 

once i understood what you meant, i perceived it differently. so this is how i did it:

 

placed a character down with 50% presence in a trigger (trg1) activated by him.

 

activated the next trigger i want to activate with the my player by putting in the condition triggeractivated trg1 

 

simple and effective.

 

Share this post


Link to post
Share on other sites

It is neither simple nor effective, but if you want to do it this way it is your choice

Share this post


Link to post
Share on other sites
32 minutes ago, DirtyDel said:

I think I understand what you're saying: all of the "random # < #" commands are based on time?

 

once i understood what you meant, i perceived it differently. so this is how i did it:

 

placed a character down with 50% presence in a trigger (trg1) activated by him.

 

activated the next trigger i want to activate with the my player by putting in the condition triggeractivated trg1 

 

simple and effective.

 

 

You can skip the trigger and check for isNil "bob" (your 50% guy) instead of triggerActivated trg1

Share this post


Link to post
Share on other sites
34 minutes ago, pierremgi said:

 

You can skip the trigger and check for isNil "bob" (your 50% guy) instead of triggerActivated trg1

 

that worked. thank you.

 

2 hours ago, killzone_kid said:

Put this in OnActivation before your code:


if (random 1 < 0.5) exitWith {deleteVehicle thisTrigger}; //.... rest of the code here

 Condition is just 


this

 

 tried it this way, did not work as i intended

Share this post


Link to post
Share on other sites
37 minutes ago, DirtyDel said:

tried it this way, did not work as i intended

From what you described it should work exactly how you intended, but I will not argue with you

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

×