Scrip calls? in need of a beginner's lesson please!

Hi everyone! 

I'm actually trying to understand the use of script calls using the "script" option of an event in the contents part, so I did a simple test trying to change an event's display priority, but I can't get it to work properly, here is the event window, on the map, I have another event to whom I talk to activate the "mapDepth" switch, to check whether it works or not! 

r82BYqn.png


The weird thing is, turning ON mapdepth does something, but not what I expected it to do, the event suddenly has priority "above" anything else and it so whatever I put in the brackets: (-1) (0) (2) (20)

Whatever goes in the brackets if TRUE, just has the same effect, and gives the event "above" priority... It's my first attempt, I'm sure there's something to learn about how to really use script calls here, but I couldn't figure it out yet! Any help would be greatly appreciated!

By the way, the second part of the condition, if the switch goes back to OFF, this part seems to work just well, as the character becomes once more "same as characters" priority... 

Thanks in advance! =)
$gameMap.event(4).setPriorityType(1)
Thanks a lot Shaz! I'll try this out, I thought I would check all the main js files to find this line, but I only found stuffs like "$gameMap.eventsXxYy(...)" or "$gameMap.events()" which are pretty close to yours, but is there a way you use to find out all the possible script calls elsewhere than the scrit call master list? I very often find it doesn't have what I'm looking for yet..! =)

Anyway, I can always come and ask if I don't find it myself I guess! Thanks again for your help =)

edit: I got the same results with your line, but then, I kept looking around the plugins, and used $gameMap.event(4).screenZ(...) instead, and I got what I wanted, thanks again!
I look in the js files.


There is a pinned thread for Script Call Equivalents for Event Commands that would be a good starting point.


Game_CharacterBase is a class. It contains the functions (.prototype.setPriorityType) you can call on objects that belong to that class. But you need to call the function on an object, not on the class itself, which is what you did.


$gameMap.event(id) gives you the event object.
I got it now!!! Hmmmm^^ Gotta get to learn some more use for those script calls then! I noticed on the forums than one need to be careful because many things don't actually need script calls to get done! 

Thanks for the explanation Shaz! Everything is clearer to me now!

edit:

Gosh, actually, I still get the same results... I thought I had done it, but meanwhile, I had turned the event priority to "below characters" so of course, it looked like it's working..! The priority script calls behaviour is really difficult to understand xD

Original thread: https://forums.rpgmakerweb.com/threads/scrip-calls-in-need-of-a-beginners-lesson-please.50900/