Hi all, looking for some of your wisdom!
I recently added moving monsters that appear on the map to my game, but I do not want them to be able to freely move into certain areas -
Example:
Man eating plants are to be restricted to a forest climate but the event I currently have has no movement restrictions so it will wander all over any passable tile on the map.
Any ideas and thoughts will be appreciated I already took a look at a couple of scripts and either couldn't get them to do what I wanted or my head was bashed off a wall for trying to make sense of things a newb to scripting like me shouldn't have.
Any hand-holding help will be much appreciated! Thanks for your time!
Help! Keep a moving event within a region.
● ARCHIVED · READ-ONLY
-
-
I'm a newb myself but here is just an idea. Use a loop to check if an enemy is a certain distance away from a particular position. If the enemy gets far enough you could use path finding to bring it back (don't know how that would work though). Or maybe you could check if an enemy moves in a particular direction (say 2 times), they would turn around and move a few steps in the opposite direction. That way it would at least gravitate towards a specific point. I'm not sure if that's possible without some scripting though. I'm new at this but maybe that gave you some ideas.
-
go to the master script list and look for Yanfly's "move restrict region" script.
The original script links are currently dead, but on top of the master list there is another link where you can get all of yanfly's scripts, you just need the original link for the description.
If yanfly's script is one you already had problems with (shouldn't be as it's relatively simple for a script), then please tell us what you didn't understand from it, and we'll show you how it's used. -
Yes I did try his script but it seemed to be map specific not event specific,go to the master script list and look for Yanfly's "move restrict region" script.
The original script links are currently dead, but on top of the master list there is another link where you can get all of yanfly's scripts, you just need the original link for the description.
If yanfly's script is one you already had problems with (shouldn't be as it's relatively simple for a script), then please tell us what you didn't understand from it, and we'll show you how it's used.
As in if I applied it to the maps note tags it would effect all of my events despite some being restricted to different locations. I couldn't figure out a way to bypass this. -
That is basically correct - but you'll have that problem in almost all cases, because the program, can't differ between events.As in if I applied it to the maps note tags it would effect all of my events despite some being restricted to different locations. I couldn't figure out a way to bypass this.
Can you give us a description on what kind of events you want to be restricted to a region, and what other kind you want to have unrestricted? Sometimes the solution is to only simulate the randomness, or use a patrol script for simple movements... -
The Events in question are randomly moving monsters on the world map - please see attached - sorry if this is the incorrect way to attach images. I do not use forums much X_x

I like that the monsters move randomly I just would like them to stay within logical regions - Ice wolves - Ice areas - Plants - Forest or Plains etc -
unrelated, but you could just use one wait of 180 instead of 3 of 60...
anyway, I think the "seems random but isn't" aproach is better for what you want... -
How would I employ a seems random but isn't approach across every enemy in my game wouldn't that become massively painstaking especially for a larger game>unrelated, but you could just use one wait of 180 instead of 3 of 60...
anyway, I think the "seems random but isn't" aproach is better for what you want... -
Yes, you may have to put them in one by one...
Alternatively, as another thread reminded me, you could make an empty event barrier, events can't pass through others unless forced through. -
Really? That script applies movement restriction to EVERYTHING on the map? That's surprising to me. I have thought a number of times about making a script that uses regions to restrict movement per event
-
Then I don't see why you couldn't use yanfly's script.The Events in question are randomly moving monsters on the world map
I like that the monsters move randomly I just would like them to stay within logical regions - Ice wolves - Ice areas - Plants - Forest or Plains etc
If you use the region code to make the borders between the different forms of regions (ice regions, forest and so on) the enemies still stay in their region.
The only limit would be that you can't have an enemy that is allowed in two regions and can move between them -for example if you have an ice forest, a regular forest and a non-forest ice region, then it would be a problem.
@Shaz:
Yanfly's script is rather simple, you can make one region code that prevents all events from moving into that region, one region code to prevent player moving there, and one code if both are forbidden to move there.
There is nothing that checks for special event tags, it's flat for all events. -
Then I don't see the problem with using it. You just need to make a "cage" of the event-blocking one around the areas you want the events to walk around.@Shaz:
Yanfly's script is rather simple, you can make one region code that prevents all events from moving into that region, one region code to prevent player moving there, and one code if both are forbidden to move there.
There is nothing that checks for special event tags, it's flat for all events.
Same as the idea I gave with events, just... you know, not wasting computer memory with events. -
Sorry guys I am completly confused, if i have multiple enemy events on the world map how can i contain them all to their individual regions with yanflys script?
Quote from Waterguy
"Alternatively, as another thread reminded me, you could make an empty event barrier, events can't pass through others unless forced through."
What do you mean exactly? -
bump
-
Seraphoenix, please do not bump your topic unless it has been 72 hours later since your last post. You can review our forum rules here. Thank you.
You draw around each containing area with the region.
Ignore the suggestion about the empty event barrier. It is a bad idea and will cause your map to lag. -
Yes, it was a relic from the 2k/3 times, when we were not able to use scripts. Now that there is a beter option, there is no reason not to use it.
-
Sorry to be a bother Waterguy can you re explain what you mean here as a solution I don't understand how its viable because region IDs cant overlap? That's if I am understanding what you mean -.-Then I don't see the problem with using it. You just need to make a "cage" of the event-blocking one around the areas you want the events to walk around.
Same as the idea I gave with events, just... you know, not wasting computer memory with events. -
well, from what was said you can use anfly's script ro block just events. And your events will be separated by areas.
So, just surround the areas you want to stop them from leaving with the event-blocking region. Not inside, around. -
Got it working thanks very much everyone! Sure I'll be back soon enough with more questions :p
-
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.