How to pick 1 object (from 4 object) to do action?
Okay, if you have ever played Ogre Battle series, we're on the same track.
[img:right]http://www.4colorrebellion.com/media/pics/08/02/ogrebattle64.jpg[/img]
I have all enemy objects set as Enemy Qualifier.
Now I want the player Character (non-controllable) to randomly choose 1 of all Enemy and attack it.
The Bold part is where I'm still figuring how to do that <_<'
Any thought plz?
Re: How to pick 1 object (from 4 object) to do action?
Oh, *note*
The "choose 1 object at random" is not the 'Condition' part, it's the 'Then' part (if 'Condition' is IF, this part is THEN.)
---
Added:
Actually, it doesn't have to be exactly like that...
If I figure out how to 'pick 1 object' from multiple object as a THEN part of the condition, I can use it for many many purpose.
Example:
If mouseover Skeleton, create Counter next to it.
Now I want that counter to show Skeleton's Value A (HP).
So I want that Counter to Set to the nearest Skeleton's A Value. But I can't find how, or alternatives.
Re: How to pick 1 object (from 4 object) to do action?
You could always give each occurence a different alterable value (in sequence) then draw a standard random number, and use it to pick one.
Perhaps spreading values might help here - although I've never used it myself, so am not up to speed.
Re: How to pick 1 object (from 4 object) to do action?
there a many ways you can do this.
The easiest is to probably pick a Group.Enemy at random and set its flag 0 to ON. Then you can continue with the rest of your events and attack only the enemy with flag 0 ON.
Remember to turn the flag back OFF when u finish.
You can also use an alterable value and give each enemy a unique ID (1,2,3,4 etc) and then pick a value at random and store it in on of the players alterable values at the target (Alterable Value 0 is renamed to 'target' for example)
Remember that when u pick a random number it starts from 0, so if your enemies ID's start at 1, you need to add 1 to the result otherwise if it picks the nubmer 0 it wont work
Re: How to pick 1 object (from 4 object) to do action?
Those are rly good ideas :)
I got it to work now, thx!