The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: thanatos2k1 on June 16, 2011, 06:55:02 AM

Title: Items that only work on the world map.
Post by: thanatos2k1 on June 16, 2011, 06:55:02 AM
For instance a tent, should only be usable on the world map.. do we need a script for this?
How about items that only work in dungeons?
Title: Re: Items that only work on the world map.
Post by: pacdiggity on June 16, 2011, 07:42:09 AM
You can link the item to a common event to carry out its function. Have a variable constantly link to the map ID. Next, check in the item's common event if the variable == the map ID that you want it to be usable on, then in that conditional carry out the function of the event. In the else branch, if you don't want the player to lose the item because they used it in the wrong map, command it to add the item in question.
Title: Re: Items that only work on the world map.
Post by: thanatos2k1 on June 16, 2011, 11:23:55 PM
This may seem slightly ignorant of me.. but how do I set the map ID variable?  I see it on the bottom, but I don't see where to put it in.  I'm using VX, just noticed I may be in the wrong thread.
Title: Re: Items that only work on the world map.
Post by: thanatos2k1 on June 17, 2011, 02:55:16 AM
Alright, I've tried for nearly three hours to get this to work..  How do I get a variable to check the map ID? ANd if the Map ID is not the world map.. not use an item such as a tent..  Im so stuck on this, and I'd hate to give up.
Title: Re: Items that only work on the world map.
Post by: pacdiggity on June 17, 2011, 08:05:46 AM
There's an option near the bottom of the control variables option screen that lets you choose map ID, there's a scroll-down menu from which it can be selected.
And in the conditional branch in which you are checking the variable, make sure else is checked and do that function in there. Else is the checkbox that says "Make branch for when conditions are not met" or something, it's at the bottom of the conditional branch screen.
Title: Re: Items that only work on the world map.
Post by: thanatos2k1 on June 17, 2011, 03:38:16 PM
Well, I already knew how to get the option.. my problem is i can't get it to work..  how does the variable know that the map id is not the world map?

This is what I have and it definetly doesn't work..

Common Event 002 Tent is set up like this

@>Conditional Branch: VAriable [0006] ==[0005]
 @>(Fade out screen, inn scene)

Else:
     Text You have no tent.


I have no idea how to make 0006 and 0005 variables work.. 
 How do I make it check the map id?  If you can show me step by step, of how to make the events work.. id appreciate it.

I have a parallell process event running
Control Variable 0005 = MapID
 Thats running on my world map..

I am so lost, and its becoming tiring trying these things, and ive searched the tuts and they dont explain how to make map id work..  What am I doing Wrong?? :(

Do I have to use two variables?
Title: Re: Items that only work on the world map.
Post by: pacdiggity on June 17, 2011, 03:48:42 PM
Attached is a screenshot showing you how to make a variable equal the current map ID. The else section of the branch is for when you are not on the wanted map. So, you should set up the variable as I've shown you here, then use the conditional branch to see if the variable is the number you want it to work for.
@>Control Variables: [0007: MAPID] = Map ID    (as shown below, in the screenshot)
@>Conditional Branch: Variable [0007: MAPID] == 1    (or the ID of your world map)
  @>Here you would carry out the tent event proper. Fade out screen, inn, whatever.
  @>
: Else
  @>Here you would display a message that says that they aren't on the correct map                      to use the tent or something like that.
  @>
: Branch End
@>
Title: Re: Items that only work on the world map.
Post by: thanatos2k1 on June 17, 2011, 03:54:55 PM
My lord! I got it to work!  I'm going to make a tutorial for this so other people don't have the same problem as me.. I couldnt find anything on this.. stay tuned. :)