Here I summarise, how I understand this tutorial. For me it's important, that I understand what I do. I want learn how it works. I don't want copy all. Thank you very much, that you help me in this learning process.
Put a common event on the item use
on the common event:
I connect the common event with an item. This common event works with every item, which I added this common event as a effect.
>check for map ID ->save to variable 1
This command checks on which map I am and save it to variable 1 of this common event.
>check player X coordinate ->save to variable 2
This command checks on which vertical map coordinate I am and save it to variable 2 of this common event.
Conditional Branch -> Character -> Facing right
- Control Variable -> variable 2 +1
If the character looks right on the map, it adds 1 to the variable 2. This is the next space in front (right looking) of the character.
Conditional Branch -> Character -> Facing left
- Control Variable -> variable 2 -1
If the character looks left on the map, it sub 1 to the variable 2. This is the next space in front (left looking) of the character.
>check player Y coordinate -> save to variable 3
This command checks on which horizontally map coordinate I am and save it to variable 3 of this common event.
Conditional Branch -> Character -> Facing down
- Control Variable -> variable 3 +1
If the character looks down on the map, it adds 1 to the variable 3. This is the next space in front (down looking) of the character.
Conditional Branch -> Character -> up
- Control Variable -> variable 3 -1
If the character looks up on the map, it sub 1 to the variable 3. This is the next space in front (up looking) of the character.
>check if Var1= your desired map
This command checks if the saved map ID at the beginning of this common event ist the same like the desired map I am on.
Get Location Info (you can reuse variable 1), Info Type Event ID, Designation with variables.
This command get the location info about the current position of the character in front of him.
Then do a Conditional Branch for that event ID to equal the ID of the NPC you want to be able to give it to.
The conditional branch checks with the event ID of the NPC, if the location info is the same like the position of the NPC.