How to set up a % chance trigger?

staind25

TH.net Regular
Reaction score
7
I need to make a trigger that says, basically, "If this unit is attacked, there is a 25% chance that this buff will be removed."

Any ideas on how to do that?

I just need to know how to set up the % chance. I can do the buff removal and all...but how do I tell the game to 'roll the dice' so to speak? Do I need a variable for this?

Thanks!
 

staind25

TH.net Regular
Reaction score
7
Pff, now if I would've looked around for 5 minutes before asking.........

I do believe Integer Comparison - (Random number integer between 1 and 4) equal to 4 should work, right? That should take a random number and if it's 4, then do the action?

Thanks
 

Exide

I am amazingly focused right now!
Reaction score
448
Here's the basic idea of how I do it:
Create an ability, for example based on Slow Poison (on that puts a buff on the target and has a 100% chance of hitting.)
Once you have that ability, you can modify it any way you want. The idea is to have a buff that is there for 0,01 seconds. (Just enough to check for it using a trigger.)

Now create a trigger that 'when any unit takes damage' - check if (Triggering unit) has buff *Your_Ability_Buff*, then do actions...

Notice that 'A unit is attacked' doesn't mean that the unit takes damage. (It can be bugged by right-clicking the target 1000 times - the trigger would fire 1000 times.)

"Umm 1 to 100 and if its below 25."
-1 out of 4 is also 25%
 

Menelaus

New Member
Reaction score
9
Pff, now if I would've looked around for 5 minutes before asking.........

I do believe Integer Comparison - (Random number integer between 1 and 4) equal to 4 should work, right? That should take a random number and if it's 4, then do the action?

Thanks

yup this solution is perfectly fine too
 

canons200

New Member
Reaction score
50
"Umm 1 to 100 and if its below 25."
-1 out of 4 is also 25%
this statement is not wrong, but in term of 1 out of 4 as compared to 2500 out of 10000, 2500 out of 10000 is more precise.

I did the experiment before, 1 out of 10 as compared to 1000 out of 10000, i perform the spell for 10000 times, the result from 1 out of 10 is 768 time success while the 100 out of 10000, 947 time success.

but of course, this random test doesn't always the same, but still the higher value, the more precise.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
this statement is not wrong, but in term of 1 out of 4 as compared to 2500 out of 10000, 2500 out of 10000 is more precise.

I did the experiment before, 1 out of 10 as compared to 1000 out of 10000, i perform the spell for 10000 times, the result from 1 out of 10 is 768 time success while the 100 out of 10000, 947 time success.

but of course, this random test doesn't always the same, but still the higher value, the more precise.

I would agree. 1 out of 4 is 25% but its chance to come up will be less than 25 out of 100. That is why i said the above.
 

killingdyl

Active Member
Reaction score
6
lol learned this from math and bio class, "Probability is only true in big numbers" and by big i mean in the 100,000 to 1,000,000,000. so the higher your number, the more precise
 

Bogrim

y hello thar
Reaction score
154
Trigger:
  • Buff Chance
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) has buff Acid Bomb) Equal to True
      • (Random integer number between 1 and 4) Equal to 1
    • Actions
      • Unit - Remove Acid Bomb buff from (Triggering unit)

Replace Acid Bomb with whichever buff you're using.

lol learned this from math and bio class, "Probability is only true in big numbers" and by big i mean in the 100,000 to 1,000,000,000. so the higher your number, the more precise
1 out of 4 is the same chance as 25 or less out of 100, and 250 or less out of 1000. No matter how many numbers you put on the dice, the roll is still the same.

When your teacher said probability is only true in bigger numbers, he was talking about proving the percentage of a chance. If you roll a dice ten times, each side of the dice theoretically has a 1/6 chance but you might get the same side three times because that is the nature of a random chance. Randomness does not divide equally, but if you roll the dice enough times you will come closer to the theoretical number though you can never get a precise result.
 

staind25

TH.net Regular
Reaction score
7
I'm actually kind of curious how anyone would safely assume that higher numbers means a more precise "roll"...considering like everyone's mentioned, the whole point is that it's supposedly "random" (Even though I guess computers can't truly be random). But I mean, where would you get evidence that 100 out of 1000 is more accurate than 1 out of 10, when each time you test it, the results are EXPECTED to be different?

Just curious. It's actually something interesting to think about, and I'd like to know how that works.
 

Exide

I am amazingly focused right now!
Reaction score
448
I'm actually kind of curious how anyone would safely assume that higher numbers means a more precise "roll"...considering like everyone's mentioned, the whole point is that it's supposedly "random" (Even though I guess computers can't truly be random). But I mean, where would you get evidence that 100 out of 1000 is more accurate than 1 out of 10, when each time you test it, the results are EXPECTED to be different?

Just curious. It's actually something interesting to think about, and I'd like to know how that works.

To put it simple:
Probability theory is bullshit.
'nuff said.
 

Bogrim

y hello thar
Reaction score
154
I'm actually kind of curious how anyone would safely assume that higher numbers means a more precise "roll"...considering like everyone's mentioned, the whole point is that it's supposedly "random" (Even though I guess computers can't truly be random). But I mean, where would you get evidence that 100 out of 1000 is more accurate than 1 out of 10, when each time you test it, the results are EXPECTED to be different?
Read what I wrote in the post just above yours.
To put it simple:
Probability theory is bullshit.
'nuff said.
Because it's not the probability theory. If you roll a dice, there's an equal chance for every side to face up. While chance might be affected by the toss itself and other physical factors, it's generally considered to be random.

The probability theory is that if you throw that dice enough times, you will get results that prove the probability of 1/6 chance for each of the six sides to turn up.

Whoever started this debate got it wrong. It's not about throwing a dice with 1000 sides, but throwing a dice 1000 times to lessen the inaccuracy of randomness and therefore prove the theory.

Go to school and learn this stuff, or something.
 

staind25

TH.net Regular
Reaction score
7
Read what I wrote in the post just above yours

Yeah, I read that...my question was more directed to the people stating that 100 in 1000 is more precise than 1 in 10.

And yeah, you're probably right about the teacher meaning that the more you roll the dice, the more accurate your result...which is NOT the same as saying that 100 in 1000 is more precise than 1 in 10.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top