Less than random Random Choice?
I want to be able to pick random enemies to attack by picking the m by random. That is easy enough, but I want them to be introduced gradually.
As the player levels up I want only enemies with the matching level (alterable value c) to be able to be randomly picked.
I tried making an event that one would think would make this happen, but EVERY enemy with that level appears. Any suggestions?
Re: Less than random Random Choice?
Random 100
= 12,5,87,100,1 etc.
Random 20 + 80
= 81, 89, 100, 98, 89 etc.
get the point :) ?
Re: Less than random Random Choice?
That isn't what I was looking for.
This is how it is. I have a qualifier for enemies. Certain enemies have a level 1, some have a level 2, and so on.
I have a timer that counts down from 5 and on 0 I want a random enemy picked with a level that is less than or equal to the level of the player.
I tried this:
Counter = 0
+Alterable Value C ("Group.Enemies") <= value ("Level Counter")
+Pick ("Group.Enemies") at random
These conditions told one of the bad guys to activate flag 0 and attack. Instead, ALL of them attack!
Re: Less than random Random Choice?
Just do this:
Set a counter to random( <playerLevelHere> )
If counter == 0
--> create "baddie level 1"
If counter == 1
--> create "baddie level 2"
ect.. ect..
However if you are level 120 then you still get lvl 5 monsters for example. To make a level range instead set counter to:
random( <levelRange> +1 ) + <playerLevel> - <levelRange>
For example: if the level range is 10 and the playerlevel is 60, then a possible outcome is:
3 + 60 - 10 = 54
Then it will always be less or equal to the player level but within the level range.
*edit* just realized you wanted to pick out enemies, not creating them.
If you use the 'set counter' code from above I mentioned, this code should work:
(compare to alterable value) if Monsterlevel of 'group.enemies' <= <theRandomCounterValue>
pick one of 'group.enemies'
---> Do stuff
It is critical that you don't use "compare two general values" to compare the monsters level as MMF2 will not pick out any objects then. It will only tell you if the comparisson was true for the last created object of those types and then not "pick them out". So any actions afterwards a 'compare two general values' will just affect all objects.
A good thumb of rule is that "object selection" only occurs when you use the object's own conditions. (with exception to the 'New object' object that can pick out objects based on position or the Mouse object that can pick out objects if they were clicked)
Re: Less than random Random Choice?
Oh bother... It didn't work. All the enemies still came at once.
Re: Less than random Random Choice?
KingToast, they are right, keep trying you must be making a mistake somwhere.
if your totally stuck upload your "BAD" engine and well fix it :cool:.
Re: Less than random Random Choice?
Hm. I will keep taking a look, though it isn't IMPERATIVE that the bad guys appear as I want them to, it would just be easier on the player.
Re: Less than random Random Choice?
I don't think the Pick At Random even works properly for qualifiers...
Re: Less than random Random Choice?
I don't think so either. Unless it is just the simple one out of them all. Qué triste!