Random object placements?
Hi.
Ok, i have done my map for my game and i am ready to place the objects which the player will pick up. The problem is that these objects needs to be placed at random points around the map each time the game is started.
So my question is, how do you do it so that objects are placed randomly around the map?
Examples welcome. ;)
Many Thanks
Tony.
Re: Random object placements?
That depends. Do you want certain constraints on where they can be placed, and if so, what are these? eg: Within a certain area, in a random spot out of a set of predefined possibilities, anywhere within the frame, aligned to a grid (eg: they can appear only at 0,0 32,0 64,0 etc)...?
Re: Random object placements?
Hi Namida.
Thank you for your reply. I need random spot out of a set of predefined possibilities for each object to be placed on the map each time the game starts. I haven't worked out how many locations for each object yet.
There are about 10 objects.
Many Thanks
Worf
Re: Random object placements?
Put the objects into a qualifier and then add as many pre defined position objects as you like. Then just do start of frame: Set position of qualifier group to position of pre defined spot. MMF2 will automatically do the random positioning for you. ;)
Re: Random object placements?
Hi LB.
Thank you for your reply. Are there any examples on this as i am new to MMF2 and all what i have done so far is through the help of examples.
Many Thanks
Worf
Re: Random object placements?
Well, an example reeealy is not needed at all here. All it is is one event...
Add the objects to a qualifier. This can be done in the objects' properties.
Place the defined position objects where you want the objects in the qualifier to appear at.
When you have obejcts that you want to move to a random location, eg after creating some, just Set the Position of the Qualifier in the event editor to the position of the pre-defined creation spots you made.
MMF2 will spread the objects out for you and do the random positioning for you.
Re: Random object placements?
Thank you LB will give it a try.