Help making something take effect at Random scores
LordTarantor
Member, PRO Posts: 890
I have a creature that I want it to come out every 10 to 15 (random) points of score.
Is there a formula I can use or do I have to make multiple formulas like:
If score is random 10,15
change monster to 1
If score is random 20,25
change monster to 1
and so on?
Comments
Rule
Game.score = random(10,15)
Change attribute
Monster to 1
Or
Spawn actor
Monster
There's really a couple different ways to go about doing it depending on what type of factor your looking to get out of it.
Yes the first time is easy but to get the monster out for the second time is why I'm asking the question. do I have to make the rule again every time I want it to come out or is there a rule to cover everything in just one?
You'll need to set up some game attributes and update those as the score changes. Do something like this:
make an attribute (boolean): monsterCanSpawn (set it to false)
make another attribute (integer): monsterRandom (set it to 0)
make another attribute (integer): monsterGate (set it to 0)
In the rule that updates your game score, add in another rule that checks for when game score is equal to monsterGate + 10. When this happens, set monsterCanSpawn to true.
Already, you've set up an attribute that will update for every 10 points. We'll add in the randomness factor (10 - 15 points) in now.
Make a new rule that checks for when monsterCanSpawn is true. If true, set monsterRandom to a random # between 0 and 5. Now make 6 rules, each checking for all of the possible monsterRandom #s (0-5). If true, spawn the monster -AND- set monsterCanSpawn to false -AND- set monsterGate to game score.
That should do it. I'm doing this mid-project at work so I may have missed something or made a mistake, but this should give you the idea of how to get it done.
Let me know either way!
ok, I find that that approach would take a lot of rules but it gave an Idea for a work around,
Made a integer named counter.
every time score is +1 counter is +1.
If counter is random 10,15
Change monster to monster is +1
Change counter to 0
Thanks a lot guys!
Well. Leave it to me to find the path of most resistance lol