Hi.
I need you to help me with the Map Id script, I use this script:
$ gameMap._mapId
But I need the same but specific, for example, the map number I need is map 1 (001: Tests), here attached example
$ gameMap._mapId (1)
$ gameMap._map (1)
$ gameMap ._ (1)
but this script does not recognize me, so I come to you.
I also have a problem, when they hurt you and you go to another map, you regenerate your whole life without using posions or anything.
Thank you
Script Map ID $gameMap._mapId
● ARCHIVED · READ-ONLY
-
-
I think you misunderstood a few things.
The MapID (either by script or by control variable command, the latter is usually easier) is always the ID of the current map. That is because other maps do not exist at any moment, only one map is loaded.
So if you want to check if you are on map 1, then you load the map ID into a variable and compare that with the number 1 (or whatever other number you want).
If that is not what you want, please give a better description of what you want to do and we can tell you how to do this. -
@Andar
If it was needed to save each map in a variable, since I wanted to do it was that when it is on the fire map it will take away life progressively, and if it has a fire clothes, it will stop hurting, which will do everything , but what you do not do is pass the Map Id and save it in a variable. -
You should also be careful to type exactly what you put in your game. All of your commands have lots of spaces, and if you actually put that in your game, it will generate errors.
Control Variables > Game Data > Other will put the id of the current map into a variable. Then you use a conditional branch to see if that variable is equal to whatever the "fire" map id is.
If you have a common event that's set to parallel process so it's always running, you should put the map id into the variable right at the start of the common event, so you get the correct number each time the common event loops. -
@Shaz
sorry I do not generate error, but this space is a problem of the Google translator, since I am Latin and here I write in Spanish, so I translate it to English, so it is separate, but I put everything without space...
But what really causes me doubt, is that when I leave a map, example was in the publo and I fight against an enemy and I defeat him, but I take 200 life, to go to the map of the castle, to enter I see that my life I regenerate completely, is that a mistake? because that's what potions are for and it does not make sense to regenerate the character without anything -
if that happens, then yes you have made a mistake in whatever event is responsible for the healing.
Please post a screenshot of the event and tell us what it is supposed to do, then we can tell you where your error is. -
@Andar
This is an example, so I am on map 1, this will heal me every 2 seconds.
https://gyazo.com/446f478d44f4fc9fe4ff52ac7a4d4d12 -
Andar has already said $gameMap.mapId(1) is not valid. It does not take an argument and return true or false if the map id is the same as the argument you passed. You can use control variables and conditional branch to test if you're on a certain map.
Code:Wait 120 Frames Control Variables: [0005: Current Map] = Game Data > Other > Map Id If Variable [0005: Current Map] is equal to 1 Control HP: Entire Party + 1 End -
no, it will always heal you by 1 per second.
the correct way to do the event would be (completely without any script):
control variable ###: Map ID = (game data - Map ID)
if variable = 1
heal HP+1
wait(120)
edit: ninja'd -
If I have to put every 120 frames, it heals, because every 1 second does not let me and the FPS goes down, so it works for me at 120 Frames.
And I'll use that variable thank you very much @Shaz
about the other you were right, it was a mistake since the character is not added to the map, and will be added until the Epilogue ends, so I put an event that adds it, and therefore it regenerates when I create a new one. -
In this way I do it? because the problem is that as you know that MapaID is from each map, I see that it is really not easy to identify each map, to do it as a common-parallel event, besides a derivation the scrip that @Shaz left me does not fit, so I will have to leave it, it would have been a good idea, but what endre do to do by region, serves me more.
https://gyazo.com/001edd78820443afa1ef021d595570cd -
[closed]IgnoreMe[/closed]
-
Reopened for clarification.
-
@Shaz @Andar
Thank you for opening the thread and that you can help me @mlogan
unfortunate as I did not find the solution I deleted all the code, since in the same way it would not be understood since it is an event I did it in a parallel way, so if what you asked me the Id Map is not equal to the X specific map, no It is like the region ID, which as you showed in the photo, you specify the Region ID that will hurt you if you are on it, instead using the map is not the same, as the map data could use it in the GameOver, which, when losing a battle, redirects me to another map and shows me the options to continue or go to the title, and if I continue, it directs me to the specific MapaID.
I'm sorry if it seems strange what I ask, but what I was trying to do was a style of Zelda OOT, which if I die on X map, it sends me to the beginning, if I touch the ground that hurts me it kills me and leaves me in a specific place or at the beginning of a temple.
Photo of first problem (I ask for harmful or mapaId regen)
https://i.gyazo.com/becb37d98c6df3e9f552d9713ab57693.png -
I am referring to the screenshot you posted just before the thread was closed.
The issue here is that you are correctly putting the "current map ID" into a variable, and then you are overwriting it with a static number.
This is what your event should look like - move the Wait 120 Frames to the very top, and remove the other 3 Control Variables commands.
This is what is going to happen ...
The event will wait 2 seconds, then get the current map ID. Then it will check if the current map is #1, and if so, will add some HP.
The "code" I gave you before is not a script and does not need to be "inserted" anywhere. It is the list of event commands that should be in your parallel process common event.
However, if what you're REALLY trying to do is get sent to a certain map when you have 0 HP, none of anything we have said in this thread will help you, because you asked for something different. Always good to explain what you're trying to achieve, just in case there's an easier way.
I believe there is a plugin that will take you to a specific map instead of the gameover screen. Unfortunately I don't know what it's called, but if you search the plugin list for "gameover" you might find it. -
@Shaz
Well first I wanted to do that, that when I was on a specific map this would give me life (fairy temple), so I believe the above, but by having a MapId and not specifying what ID is, it gives me life on any map , since before uploading my Thread do what you tell me, and gave me life on all the map which was, so I did not use and asked for help from you, but I saw that it was the same thing that I just added 3 lines that did not work. -
So you got it working the way you wanted it then? It gives you extra HP only on that map?
-
Through RegionId I did it and it works for me, now I'm doing the Game over, thank you very much @Shaz
-
@Nacura the screenshot with the errors that were corrected by shaz suggests that you don't fully und erstand how variables work. I suggest you follow the link "starting point" in my signature to a tutorials called the "variables guide".
That is a game that teaches people how the control variable command works and can be used.
The game itself is written in VXA, not MV, but there is no difference between VXA and MV in that area and everything thaught in that game applied to MV as well. -
@Nacura the screenshot with the errors that were corrected by shaz suggests that you don't fully und erstand how variables work. I suggest you follow the link "starting point" in my signature to a tutorials called the "variables guide".
That is a game that teaches people how the control variable command works and can be used.
The game itself is written in VXA, not MV, but there is no difference between VXA and MV in that area and everything thaught in that game applied to MV as well.
actually using the variables friend, only I think you do not understand what I wanted to do, because what I really wanted was a script and we ended up in variables, since I needed a script that would give me the specific map ID, which the event does not do because it is limited in the script instead, in the common events I have many items using variables, I even use the variables + event to show me the damage that a skill will cause, by going to the menu and see the skill is showing you how much damage it will do, so do not worry about using them, what is not using the script, so I ask for help, and ask for specific things, which if you can not I'll look for them in another way, Even the last photo you leave, you will see that you use the variables and parallel events to use them with the Region ID. Like many thanks to all who helped me here, likewise if I need help I'll do another thread and be more specific hahaha.:hwink: