Ok here goes, i wanna make something happen based on a probability set by the user. 5 numbers, I want the user to be abe to say well, 0% chance of a number 1 10% chance of a number 2 etc......
I cant really figure a way of doing this without using way two many numbers.
You might want to randomize values. (Use with alterable value e.g. Start of Frame ---> Set Active's Alterable Value A to Random( [the number] ) ). If you need more help just reply saying what you need help in.
lol what help do i need eeek, lol im stupid..... im not getting this at all, i know its probably real simple but im struggling.
If i make 6 random numbers the chances of the 6 numbers being chosen is 1/6 i could use a line that says if 1 then activate group 1 etc... But i want to be able to increase the chances of numbers, normally i would do this by making a random number between say 1 and 100, then saying if its greater than 1 but less than 20 then activate 1 if its greater than 20 and less than 50 activate group 2 that would work fine except i want the user to be able to change the chances.
Hmm.. I don't really get what you're trying to say. How bout giving an example or something? Is it really necessary to use more than one random number?
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
2nd June, 2003 at 04:48:47 -
The easiest method of doing a probability state movement is by setting the object's alterable value to a random number, like Alebrain said. Then when the value is equal to a value then make the object do something eg.
Always - set fly.alt a to random (10)
If fly.alt a = 1 - Shoot a bullet at player.
Just remember that setting something to random 10 is setting it to a random digit starting at 0. Which means this counter goes from 0-9 (10 digits.)
The only problem with this is that there is an equal chance of any of the statuses being selected.
One way to make some options have a greater chance of being picked would be:
Always - set fly.alt a to random (10)
If fly.alt a = 0 - Shoot a bullet at player.
If fly.alt a = 1 - Shoot a bullet at player.
If fly.alt a = 2 - Shoot a bullet at player.
If fly.alt a = 3 - Evade Player.
If fly.alt a = 4 - Follow Player.
This creates a 3/10 change for shooting at the player, and a 1/10 chance for evading or following the player.
That's just one way. Now i feel like writing an A.I Article.
Ok, im back again, didnt really take the time to read this properly, just printed it out and filed it away for future reference, when i did read it through a little slower i realised this wont solve my problem.
HEres what i want to do, I want to be able to activate one of several groups at random, but only one. I want the user to be able to set the probability of these groups being activated using a percentage value.
Using the above examples i wouldnt be able to allow the user to change the probability.
THis would make it choose the groups at random, but the user wouldnt be able to change the probability, because to change the probability you would have to change:
counter = 0 - activate group 1
counter = 1 - activate group 2
counter = 2 - activate group 3
more lines would have to be added or removed to match the options the user selects.
Im sorry if i am being totally thick n missing the point here, Im a newbie n it sucks
Whoooopie, Ever noticed how things seem easyer when ya had a few beers to help ya brain hehe ..... was just on my way to bed n figured out the answer to my problem, so i got back up and tapped away for 20 minutes, and yup it worked.
I realise that their is probably a much simpler way of doing this, and if anyone looks at my example i would like their feedback. ignore the ini part of this demo, figured i would learn how to make a ini whilst i was at it hehe