I've searched for answers on this but none have really worked..
So, I'm making a minigame where you need to lead a group of sheep into a barn. All I need is for an event to activate when the sheep get close to the barn, Is there any way to do this?
I obviously can't use a normal event trigger, as then the player could go to the barn without the sheep and it would still activate. So basically I could even get away with having the game register that the sheep are near you, but i feel that would be harder to work out.
Any ideas?
You'll need a parallel process checking the positions of the other events
Hmm, I honestly never knew you could do that. How would I go about doing that?
I see what you're saying, but that wouldn't matter much, as I still need a way for the game to 'register' where the sheep are so they can trigger an event when they get to a certain spot...
Sorry if I'm not explaining it right haha.
Parallel process that assigns the coordinates of the events to a variable.
Then after assigning, a conditional branch that checks these variables and if they meet a certain value etc
No, I get that, I'm just quite honestly not at all sure how to store event locations in a variable. Never done it before, I see no options for it.
Control Variable
Make a new variable e.g. SheepX
Using control variable
[IMG]http://i123.photobucket.com/albums/o299/shinmuriel/pic02.jpg[/IMG]
but in this case you want to set it to the Event's Map X.
If there is a set area where you want all the sheep to be, you could paint it with a region tag (I'll use 1 in the example below).
Then create a parallel process event that does this:
Wait 5 Frames (to avoid lag, and we really don't need to do this every frame)Comment: Check where event 1 isControl Variables [001: X] = Event 1's Map XControl Variables [002: Y] = Event 1's Map YGet Location Info: Variable [003: Region] = Region Code on [001: X], [002: Y]Conditional Branch: Variable [003: Region] <> 1 (this is the region code you used) Exit Event ProcessingBranch EndComment: Check where event 2 is(do all the above, but get Event 2's map x and y)...repeat this for each of your sheep events...Comment: If we've reached this point, all the sheep are on the correct regionControl Switches [001: Trigger Event] = ONNow, in a Parallel Process event, Exit Event Processing simply takes you to the bottom of the event command list, and then it starts over from the top.So what the above is doing is looking at your sheep events, one by one. It grabs the x and y coordinates, then checks what region code is on that tile. If it's the special region, it moves on to the next sheep event. If it's not, it skips the rest of the checks and starts over. If all events are on the correct region code, it makes it to the last command, which is to turn on a switch that triggers the event that's been waiting for them. Depending on what that event is, you could just put its commands in your parallel process event (not a fan of having one event turn on a switch, which triggers another event conditioned by that switch and set to autorun). Make sure you add an extra page also conditioned by that switch, so your parallel process event stops running once all the sheep are in.
Thanks everyone for the suggestions!
Ended up working out perfectly the way Shaz explained, thank you.