I'm trying to set up a common event that, when you use an item it looks for map location and region I'd and if they are in region 7 then the boat is transferred to the square in front of the character if that square is shallow water, all my region 7 squares are next to shallow water bit the play in some cases can be in region 7 but facing land. How would I go about doing this I've been trying for a week now, any help would be great.
Finding a region id and transfering boat to the square in front of character
RPG Maker MV SupportWe would check which Region is infront of the Player. I hope that should solve the Problem?
I mean Paint Region7 into the shallow Water. If other problems or bugs pop up, we can help fix them.
I copy pasted some Eventcode for your common Event, it should work.
If Statements are Conditional Branch Event Commands.
Let us know if you have Questions.
I mean Paint Region7 into the shallow Water. If other problems or bugs pop up, we can help fix them.
I copy pasted some Eventcode for your common Event, it should work.
If Statements are Conditional Branch Event Commands.
Let us know if you have Questions.
Code:
◆If:Player is facing Down
◆If:Script:$gameMap.regionId($gamePlayer.x, ($gamePlayer.y + 1)) === 7
◆Text:None, Window, Bottom
: :We did it, i used the Item, and iam looking down
: :and Region 7 is there.
◆Comment:Exit Event Processing Skips to the End of the Eventpage.
◆Exit Event Processing
◆
:End
◆
:End
◆If:Player is facing Left
◆If:Script:$gameMap.regionId($gamePlayer.x - 1, $gamePlayer.y) === 7
◆Text:None, Window, Bottom
: :We did it, i used the Item, and iam looking left
: :and Region 7 is there.
◆Exit Event Processing
◆
:End
◆
:End
◆If:Player is facing Right
◆If:Script:$gameMap.regionId($gamePlayer.x + 1, $gamePlayer.y) === 7
◆Text:None, Window, Bottom
: :We did it, i used the Item, and iam looking right
: :and Region 7 is there.
◆Exit Event Processing
◆
:End
◆
:End
◆If:Player is facing Up
◆If:Script:$gameMap.regionId($gamePlayer.x, ($gamePlayer.y - 1)) === 7
◆Text:None, Window, Bottom
: :We did it, i used the Item, and iam looking up
: :and Region 7 is there.
◆Exit Event Processing
◆
:End
◆
:End
◆Text:None, Window, Bottom
: :The Boat can't reach us here.
you don't even need scripts for that - although the script has the advantage of making it a single line.
In pure eventing you'll use several control variables and get location info commands to find out the region ID of the square in front of the player.
In pure eventing you'll use several control variables and get location info commands to find out the region ID of the square in front of the player.
I am going to try this script when i get home today, i would like more info on the get location info command, is it in a editor menu or is is a command, and thanks all for the help.
it is an event command like all other event commands in the window that opens when you doubleclick in the content area. It can't be used alone as it fills a given variable with the data selected (either from a fixed position or from a variable position on the same map) and after that you'll need other commands to check that variable.
And if you don't know about get location info, have you at least seen the game data window of the control variable command? That is used to get database info...
And if you don't know about get location info, have you at least seen the game data window of the control variable command? That is used to get database info...
Get Location Info is an Eventcommand but its not used in the above example.
It uses the Scriptline Feature in the Eventcommand "Conditional Branch".
It uses the Scriptline Feature in the Eventcommand "Conditional Branch".
how do i get the boat to appear in the region 7 afteri run the common event
you need to use the "set vehicle location" command on that map position.
I strongly suggest you take some time off your game making to learn the engine if you don't even know what commands exist on the event command window. Learning that now will drastically speed up your later game development because you no longer have to ask basic questions and wait hours or days for answers.
If you follow the link to the "starting point" in my signature you'll find tutorials that guide you through this learning as fast as possible, but it will take some time.
I strongly suggest you take some time off your game making to learn the engine if you don't even know what commands exist on the event command window. Learning that now will drastically speed up your later game development because you no longer have to ask basic questions and wait hours or days for answers.
If you follow the link to the "starting point" in my signature you'll find tutorials that guide you through this learning as fast as possible, but it will take some time.
Ah i forgot about the Boat 😅.
Since i do not want to introduce more Script snippets, i copy pasted the 100% Evented way as Text example:
Since i do not want to introduce more Script snippets, i copy pasted the 100% Evented way as Text example:
Code:
◆Control Variables:#0044 Var44 Current MapId = Map ID
◆Control Variables:#0045 Var45 Hans X = Map X of Player
◆Control Variables:#0046 Var46 Hans Y = Map Y of Player
◆If:Player is facing Down
◆Control Variables:#0046 Var46 Hans Y += 1
◆
:End
◆If:Player is facing Left
◆Control Variables:#0045 Var45 Hans X -= 1
◆
:End
◆If:Player is facing Right
◆Control Variables:#0045 Var45 Hans X += 1
◆
:End
◆If:Player is facing Up
◆Control Variables:#0046 Var46 Hans Y -= 1
◆
:End
◆Get Location Info:Var47 Region Infront Hans, Region ID, ({Var45 Hans X},{Var46 Hans Y})
◆If:Var47 Region Infront Hans = 7
◆Set Vehicle Location:Boat, {Var44 Current MapId} ({Var45 Hans X},{Var46 Hans Y})
◆
:Else
◆Text:None, Window, Bottom
: :The Boat can't reach us here.
◆
:End
Thanks bex, I used your script and added the set vehicle stuff and got it to work last night.
Andar I dont learn that way I learn by doing so there's that. And the info that bex and a few others on driftwood gaming discord gave me I was able to figure it out so thank for being an ass. Figured every community as a few glad to know I found one.
Andar I dont learn that way I learn by doing so there's that. And the info that bex and a few others on driftwood gaming discord gave me I was able to figure it out so thank for being an ass. Figured every community as a few glad to know I found one.
if I were an ass I would not have spent hours to write those tutorials for others.
What I told you is simply based on experience.
For example I don't know of anyone who ever finished their first project. Even those who continued their first story had to scrap and restart their project for telling that story at least once, because of the mess they created when simply storming ahead without knowing how the engine works, and a lot of them admitted later that it would have been easier if they had taken the time to learn what they should do.
As for your "I learn by doing" - that is exactly what everyone needs to do, just not as aimlessly as storming on.
If you had taken the time to follow the link you would have read that one of the very first tips I gave is that simply reading through a tutorial is always a waste of time for everyone.
What you need to do is to work through the tutorials - every step they mention is something you need to do yourself in a tutorial project that will be scrapped after you finish working through the tutorials.
Because as I said above, your first project (and most probably your second and third) WILL be scrapped, and it's better if the scrapped project is a useless tutorial project that forcing you to scrap your dream game.
Original thread: https://forums.rpgmakerweb.com/threads/finding-a-region-id-and-transfering-boat-to-the-square-in-front-of-character.118118/