Parallel Process won't consistently set event location?

inkhana

Warper
Member
Joined
Apr 24, 2016
Messages
2
Reaction score
0
First Language
english
Primarily Uses
I have a problem when trying to set an event location via parallel process.


The intended purpose of my script is to test the player's location, then, if the player is standing within a certain range, place an arrow icon to indicate a nearby area of interest.  When the player leaves the location, the arrow returns to its prior location.  I set this up with a series of conditional branches inside my parallel process, each one for a set location.  


Here's the odd thing.  The arrow only moves when there's more than one branch inside the process, and if there are multiple conditions, it will only move for the LAST one in the sequence.  So if I have an arrow set to appear at (10, 10), (29,15), and (3,7), only the one at (3,7) will appear, and when it does appear, it will also correctly move back when the player leaves.  If I delete the one at (3,7), then the one at (29,15) begins to work. As far as I can tell, the branches are identical to each other (copied and pasted) except for the coordinates involved.  So, I tested to see if the branches were being executed by applying a sound effect to be played for each testing area.  The sound effects play correctly as expected (only one sound in each location, and each location has a unique sound), but for some reason, the "set event location" command right next to it is ignored?  Why might that happen?


I have removed all extra scripts from the script editor (it had no effect), and have never altered anything else there.  There is another event too, but it only shows text when you approach it.  If anyone thinks it might be related somehow, I'll post a pic of that event page as well.


I can think of other ways to execute the idea, but I'm stumped as to why this is occurring and I feel like I have a misunderstanding about how the process is working here, and would like to learn the right way so I can avoid the problem in the future.  Thanks in advance for any help you can give me.


Images:

My parallel process:


1.jpg


The part of the branch you can't see:


4.jpg


The actual arrow's page (nothing to it, but better to be safe than sorry):


3.jpg
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
It's because your conditions are not nested. 


Walk through the logic of your event.  Let's say the player is at 30, 9.


The first condition is checked, the player is within the range, so the arrow is moved to 31,10.


Then the second condition is checked, the player is not within the range, so the arrow is moved to 28,10.


Then the third condition is checked, the player is not within the range, so the arrow is moved to 28,10 (which is where it already is).


Your conditions should be nested, so if the player is within any of the ranges, it moves the arrow to the appropriate place and then stops checking further locations.  It will then only move the arrow back to the default position if the player is not within any of the ranges:

Code:
If (player is within range 1)
  move arrow to location 1
Else
  If (player is within range 2)
    move arrow to location 2
  Else
    If (player is within range 3)
      move arrow to location 3
    Else
      move arrow to default position
    End
  End
End
 

inkhana

Warper
Member
Joined
Apr 24, 2016
Messages
2
Reaction score
0
First Language
english
Primarily Uses
Ah, so stupid of me!  Thanks so much, that makes perfect sense.
 

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,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top