Region common events

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
331
Reaction score
90
First Language
English
Primarily Uses
N/A
^ Includes screenshots.


Shaz told me to do the following: "Have a parallel process event on the map that turns on a new switch then erases itself.  Set your common event to parallel process and condition it by that switch.  Do the test for the button press, and then use Get Location Info to get the player's region into a variable.  Finally, test whether that region is any of the ones you want to know about."


But when I hit the button, the common event just repeats itself.


I don't know how to use get location info or variables, though.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
show your event.


Of course the common event repeats itself.  It is supposed to - that's what common events do when you set them to parallel process.


Maybe you should actually take the time to explain what you are trying to achieve. I've seen a lot of posts from you saying things don't work, but not one have you said what you are trying to do.  It may be that none of these approaches are right for you, or it may be that something small needs to be adjusted for your particular requirements.


You might benefit by doing some beginner tutorials.  Get Location Info is a useful command for something like this, and variables will come in handy when developing your game.  Check out Andar's starting point for new users, linked in my signature.
 
Last edited by a moderator:

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
331
Reaction score
90
First Language
English
Primarily Uses
N/A
show your event.


Of course the common event repeats itself.  It is supposed to - that's what common events do when you set them to parallel process.


Maybe you should actually take the time to explain what you are trying to achieve. I've seen a lot of posts from you saying things don't work, but not one have you said what you are trying to do.  It may be that none of these approaches are right for you, or it may be that something small needs to be adjusted for your particular requirements.


You might benefit by doing some beginner tutorials.  Get Location Info is a useful command for something like this, and variables will come in handy when developing your game.  Check out Andar's starting point for new users, linked in my signature.
What I want to do is, instead of putting a bunch of events on the map, to just have a common event for examining things on the map.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Not much of an explanation - can you provide more?  Mechanics?  What's wrong with it looping?  Isn't that what you want it to do?  Or do you only want to be able to find one single thing and then nothing else?


(and please don't quote me every single time you reply - just reply.  It makes the thread hard to read when everyone quotes the person immediately above them).
 
Last edited by a moderator:

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
331
Reaction score
90
First Language
English
Primarily Uses
N/A
Not much of an explanation - can you provide more?  Mechanics?  What's wrong with it looping?  Isn't that what you want it to do?  Or do you only want to be able to find one single thing and then nothing else?
Map has multiple rocks you can examine, but making each rock an event slows the game down, so I'm using a comment event.


Looping means the text box never ends, so the game is stuck on it. You can't exit the text box after reading it because it just repeats.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I'd question how you're making your events.  Unless you have hundreds of them on the map, they shouldn't slow your game down at all.  That is exactly what events are for, and that is the standard/best way to do it.  Having a parallel process common event that's running for the entire time you're on the map just waiting for you to interact with something uses more processing power than individual events that are set up correctly.


Having parallel process common events can slow your game down just as much as map events.  It's not what the events are, it's what's in them.  To get rid of the looping text box, add a Wait right at the start of your common event.


Do you see how explaining everything right from the start would save so much time?  I do not think the region common events script OR a parallel process common event is the way to go here.  I would stick with individual events.  If they are slowing the game down, chances are you've designed them incorrectly, or you just have way too many of them.  I suggest posting one or two of them so we can see what you were doing.  It may be that it wasn't the events slowing the game down at all, and something entirely different.
 
Last edited by a moderator:

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
331
Reaction score
90
First Language
English
Primarily Uses
N/A
I'd question how you're making your events.  Unless you have hundreds of them on the map, they shouldn't slow your game down at all.  That is exactly what events are for, and that is the standard/best way to do it.  Having a parallel process common event that's running for the entire time you're on the map just waiting for you to interact with something uses more processing power than individual events that are set up correctly.


Having parallel process common events can slow your game down just as much as map events.  It's not what the events are, it's what's in them.  To get rid of the looping text box, add a Wait right at the start of your common event.
I do have a hundred or so events on the map. It's a big map with a lot of rocks.


Shouldn't the parallel process event being erased not slow the game down?


The Wait did the trick!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
No, because Erase Event does nothing in an autorun/parallel process common event.  It is only meaningful for map events.
 
Last edited by a moderator:

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
331
Reaction score
90
First Language
English
Primarily Uses
N/A
No, because Erase Event does nothing in an autorun/parallel process common event.  It is only meaningful for map events.
But it's a map event, like you said.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I think things are getting very confusing.  The parallel process event on the map is only to turn on a switch that controls the common event.  I suppose you could do all the processing in the map parallel process event rather than the common event - in that case you would not need a switch at all, and you would NOT want to erase it - doing so would stop the whole process.


If you would show your events, like I originally asked, at least we'd be on the same page and I'd know what you were trying to do.



I sure hope you didn't have your rocks set to parallel process triggers?
 

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
331
Reaction score
90
First Language
English
Primarily Uses
N/A
For some reason, around the rocks, only the top region id works - the side and bottom region ids do not. I'm gald I rechecked to see if this was all working.


I want so, no matter what region id you touch, you get the same message, but the message only appears when you touch the top region id.

REGION.png
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
That IS a common event.


I'm not sure why you added the self switch to the map event - I didn't say to.  As you have it, that event would never erase, because you've got the Erase Event on a new page triggered by action button, with no sprite.  That would only ever be executed if the player walked onto that event and pressed space.  However, even if it worked, it's not doing what you think it's doing.  To stop the common event running you would need to turn off the switch that controls it, not erase the event that turned it on.  But then that'd stop all the checking for exploration, which isn't what you want.


You know what?  It might be better to actually not do this as a common event at all - that way you don't have to worry about the switch or erasing events, and you can keep the event shorter by just restricting the options to the map you're on.  If you want to go that way, just set up a parallel process on each map that only has one page, no self switches, no erase command, no conditions, and copy/paste the code from the common event into it - then get rid of all the processing for the maps that aren't this map.  That should make it run faster as it's not checking for every single map.  Then you can get rid of the common event altogether.


As for your regions ... you don't need to put region 1 everywhere you don't have a region.  You could just leave it blank.  I can see a few issues where you could be standing facing one thing, but your event will trigger the text for an object that's behind you - check out that region 6 at the bottom of the object to the right of "the others do nothing" text.  If you're standing on that tile and facing up, you'll get the right text, but if you're facing down, you should get the text for region 12, but you'll get the text for region 6 instead.  What you could do to avoid that is to put the region ON the object being investigated rather than surrounding it, and instead of using $game_player.region_id to check the region, use this: $game_map.region_id($game_map.x_with_direction($game_player.x, $game_player.direction), $game_map.y_with_direction($game_player.y, $game_player.direction) - this will get the region id of the tile in front of the player, adjusted for their facing direction.  It's a long script line though so I'm not sure if it will fit in the conditional branch.  If it doesn't, and you want to use it, let me know, and I'll give you a script to add that will provide a much-shortened form.


As far as why it won't work on those other tiles - I can't think of any reason, apart from timing.  Are you just pressing and releasing the key?  Are you holding it down?  You've got a 60 frame wait there - that's a whole second.  You could change it to 5 frames and still not have the lag issues.
 

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
331
Reaction score
90
First Language
English
Primarily Uses
N/A
That IS a common event.


I'm not sure why you added the self switch to the map event - I didn't say to.  As you have it, that event would never erase, because you've got the Erase Event on a new page triggered by action button, with no sprite.  That would only ever be executed if the player walked onto that event and pressed space.  However, even if it worked, it's not doing what you think it's doing.  To stop the common event running you would need to turn off the switch that controls it, not erase the event that turned it on.  But then that'd stop all the checking for exploration, which isn't what you want.


You know what?  It might be better to actually not do this as a common event at all - that way you don't have to worry about the switch or erasing events, and you can keep the event shorter by just restricting the options to the map you're on.  If you want to go that way, just set up a parallel process on each map that only has one page, no self switches, no erase command, no conditions, and copy/paste the code from the common event into it - then get rid of all the processing for the maps that aren't this map.  That should make it run faster as it's not checking for every single map.  Then you can get rid of the common event altogether.


As for your regions ... you don't need to put region 1 everywhere you don't have a region.  You could just leave it blank.  I can see a few issues where you could be standing facing one thing, but your event will trigger the text for an object that's behind you - check out that region 6 at the bottom of the object to the right of "the others do nothing" text.  If you're standing on that tile and facing up, you'll get the right text, but if you're facing down, you should get the text for region 12, but you'll get the text for region 6 instead.  What you could do to avoid that is to put the region ON the object being investigated rather than surrounding it, and instead of using $game_player.region_id to check the region, use this: $game_map.region_id($game_map.x_with_direction($game_player.x, $game_player.direction), $game_map.y_with_direction($game_player.y, $game_player.direction) - this will get the region id of the tile in front of the player, adjusted for their facing direction.  It's a long script line though so I'm not sure if it will fit in the conditional branch.  If it doesn't, and you want to use it, let me know, and I'll give you a script to add that will provide a much-shortened form.


As far as why it won't work on those other tiles - I can't think of any reason, apart from timing.  Are you just pressing and releasing the key?  Are you holding it down?  You've got a 60 frame wait there - that's a whole second.  You could change it to 5 frames and still not have the lag issues.
Ohhh...that's MUCH easier than what I got! :) Thanks Shaz!
 

Burgerland

Veteran
Veteran
Joined
Sep 26, 2015
Messages
331
Reaction score
90
First Language
English
Primarily Uses
N/A
When I check a rock, the message box just keeps looping again.


Here's the parallel process map event, got rid of the processing for other maps and got rid of the common event.

Capture.PNG
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
you didn't add the Wait 5 frames right at the top  :)
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top