Can I change player character's priority?

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
Hello,

I'd like to temporarily change the player's priority to Below Characters, so that events will walk right over the player. I know I could instead change the priority of all the moving events to Above Characters, but I don't want to do that for other reasons. Is there a way to change the player character's priority?

Thanks!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If it's the player, $gamePlayer.setPriorityType(0) will make the player Below Characters.

If it's one or more followers, it'll be $gamePlayer.followers()[n].setPriorityType(0) where n is the follower number. Use 0 instead of n for the first follower, 1 for the second, and 2 for the third.

You might need to add $gameMap.requestRefresh() afterwards.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
no

depending on what exactly you want you might set the player to through, or set the events to through instead - but that disables all passability checks.

if you give us a description of what you want to do (ingame terms) instead of how you want to do it, we might be able to point you to another solution

EDIT: ninja's, didn't know the script command
 

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
If it's the player, $gamePlayer.setPriorityType(0) will make the player Below Characters.
Thanks, Shaz, but that doesn't seem to work. I'd like to be able to walk under events that have a priority of "Same as Characters". I tried using that command in the regular Advanced > Script section, and then tried it in the Set Movement Route > Script section, and neither worked for that. I also tried it using a fresh game with no plugins whatsoever.

if you give us a description of what you want to do (ingame terms) instead of how you want to do it, we might be able to point you to another solution
I'm doing a stealth mechanic where the player briefly turns into a "shadow", so that events walk right over him. Everything works just fine, except that events will instead just walk around him, which doesn't make sense story-wise. Also, I know that normally events do not walk over other events set to "Below Characters", but I'm using Yanfly's Core Engine, which, so far, has taken care of that. I don't want to set anything to "Through", as that would make the player or events able to walk through walls and stuff.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
What DOES happen? Is it that your player can't go through those events, or when they go through, they're not showing under them?

Changing the priority will not allow a player to go through an event if the event is not set to through.

The alternative is to just change the events' priority to be above characters. You could do this by turning on a switch, and giving all events an additional page conditioned by that switch, with the same image, but Above Characters.
 
Last edited:

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
What DOES happen? Is it that your player can't go through those events, or when they go through, they're not showing under them?
Basically nothing different happens. It behaves just as it would if the player and the event were both set to "Same as Characters". The event won't move over me, it still goes around me, and I can't go under it either, I still "bump against" it, like normal.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I did explain that changing the player's priority will not suddenly allow them to go through events, unless the events, or the player, are set to Through.

I also added an edit to say you could just change the priority of the events rather than the player. That might be a better option.
 

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
I also added an edit to say you could just change the priority of the events rather than the player. That might be a better option.
Yes, I see that now, and thanks. I think I might be able to make that work. But, just for general knowledge for future reference, does changing the player's priority have any effect at all? I mean, they put the script call in there, it must do something, right? (But then again, maybe not, haha.)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
So, when you posted your request, I thought you were only asking for a way to ensure the player's sprite showed below an event's. I assumed you had already taken care of where everyone could go (in fact I didn't even think about it to be honest).

Priority is used for two things. It's used to determine what image gets displayed on top when two objects are on the same tile. It's also used to determine whether objects CAN go onto the same tile. The snippet I gave you only takes care of the first, not the second.

There's quite a bit of coding around where events can and can't go, and what makes a player interact with an event. It works on the assumption that the player is always going to be 'Same as Characters' priority and that events can't move onto a tile where the player is or where another event is, unless one of the two is set to through.

So to change that, you'd probably need a full, proper plugin, rather than just a code snippet to change the appearance. There are also quite a few plugins out there that do manipulate this a bit, so anything that was written for you would run the risk of being incompatible with others.
 

JDevain

Veteran
Veteran
Joined
Oct 21, 2018
Messages
121
Reaction score
46
First Language
English
Primarily Uses
RMMV
@Shaz

I see. I always thought it was kind of weird that the player could move over events that are "Below Characters", but events that had a priority of "Same as Characters" couldn't. Then I installed Yanfly's Core Engine, which fixes that. I say "fixes" because it seems like that would logically be the expected behavior.

Making a game is itself a game. A very complicated puzzle game that seems to never end. I wish I could just finish this damn thing already.

EDIT: I just noticed that when I used the word D-A-M-N, it got changed to "DAYUM".

Seriously?
 
Last edited:

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,864
Messages
1,017,056
Members
137,573
Latest member
nikisknight
Top