Several problems with an item that can be located

So, I have some item that when used, you put it down on the map. Like a building system.
It works in a way that when the item is used, it triggers a common event, and the common event moves an event from outside the map to the player location (via variables)
There is also a variable that the common event increases every time it's used (and a conditional brunch, that depends on the variable number moves different event) so it won't move the same event from place to place, but bring a new event each time the player put one.
(When the item is used, variable changes to 1. When variable is 1, event 1 moves to player location. When used again, variable changes to 2, etc.)

First problem is that the player can only put the object in a specific map, because unfortunately events can't be moved to other maps. Temporary solution is a conditional brunch that allows to put the object only when the player is in the map where the "object-events" are.

Second problem is that even only in the map, the objects put when using the item won't stay after re-entering the map. I tried to make it so the object events will have a page that moves them to the player location if the variable is their number, or use a seperate switch for every event that tells him to move. In both options, when re-entering the map, the objects disappear and return to their original hidden location, even though their switch\variable is still ON.

I managed to solve the second problem, but it replaced with another problem instead.
I made it so when the variable increased to 1, object number 1 turned a self switch instead of directly moving. After doing so, the objects will stay when re-entering the map, however, for some odd reason, when I put the second object, the first one disappears, when I put the third one, the second object disappears, etc.


I've been stuck on these problems for hours now and I'm really clueless. What am I doing wrong? I also tried using pictures instead of events, but they don't stay in one location in the map and aren't interacted like events...
Help will be very much appreciated.

Code of the Common Event:

Code:
◆Control Variables:#0018 PlayerLocationID = Map ID
◆Control Variables:#0019 PlayerLocationX = Map X of Player
◆Control Variables:#0020 PlayerLocationY = Map Y of Player
◆If:PlayerLocationID = 33
  ◆If:WhichBottleToPut = 0
    ◆Control Switches:#0042 Bottle1 = ON
    ◆Play SE:Jump1 (90, 100, 0)
    ◆Control Variables:#0023 WhichBottleToPut = 2
    ◆
  :Else
    ◆If:WhichBottleToPut = 2
      ◆Control Switches:#0043 Bottle2 = ON
      ◆Play SE:Jump1 (90, 100, 0)
      ◆Control Variables:#0023 WhichBottleToPut = 3
      ◆
    :Else
      ◆If:WhichBottleToPut = 3
        ◆Control Switches:#0044 Bottle3 = ON
        ◆Play SE:Jump1 (90, 100, 0)
        ◆Control Variables:#0023 WhichBottleToPut = 4
        ◆
      :Else
        ◆If:WhichBottleToPut = 4
          ◆Control Switches:#0045 Bottle4 = ON
          ◆Play SE:Jump1 (90, 100, 0)
          ◆Control Variables:#0023 WhichBottleToPut = 5
          ◆
        :Else
          ◆If:WhichBottleToPut = 5
            ◆Control Switches:#0046 Bottle5 = ON
            ◆Play SE:Jump1 (90, 100, 0)
            ◆Control Variables:#0023 WhichBottleToPut = 6
            ◆
          :Else
            ◆If:WhichBottleToPut = 6
              ◆Control Variables:#0023 WhichBottleToPut = 6
              ◆Erase Event
              ◆
            :End
            ◆
          :End
          ◆
        :End
        ◆
      :End
      ◆
    :End
    ◆
  :End
  ◆
:Else
  ◆Text:None, Window, Bottom
  :    :Use your bottles only in a confusing place!
  ◆Change Items:Green Bottle + 1
  ◆
:End
you went about it the wrong way.

There are two fact that are too deep inside the engine to be solved easily by eventing - they need plugins to add functionality before they can be solved.

Considering that I usually argue against using plugins for everything this should tell you something...

1) event positions reset whenever the map is reloaded.
That is why the events go back to their original position by default. And while there are ways to circumvent that by events it will not be done easily as you've found out yourself.

To solve this there are a few plugin that add code to allow the engine to keep position changes even on reload. You can search for them yourself, I think one of them is from Shaz and called "Remember event position" or something similar.

2) events can't be moved between maps.
That will remain fact, but there is a slightly different way to handle this.
There are "clone event" plugins that allow you to copy an event from another map. That will create a new event on the current map that has the same data as the event copied from another map, you'll just need one master map for samples of events to copy.

As said it is possible to do both things with events, but that is extremely restrictive and complex and this is one of the few cases where plugin use is always better.
Well then, thank you. I had the feeling this problem can be solved without using plugins, because there are cases when event won't reset to it's original state, because a switch is activated. Guess it doesn't work if the switch is trying to change a location.

Anyways thank you for the relpy Andar, now I feel ok to use a plugin for that.
switches are stored outside the map by default, event positions are not.
you can trick around that by having a switch activate a page that changes the event position on load, but that has very specific requirements like a known second position. a variable position would block several variables for each event and be even more complex to handle that way.

as I mentioned above it is theoretically possible to event around the limitations, but it is a lot of problems that are easier solved by plugin.

Original thread: https://forums.rpgmakerweb.com/threads/several-problems-with-an-item-that-can-be-located.119309/