< Variable Pool .. is this even possible? >

Discussion in 'RPG Maker MV' started by craenk22, Apr 19, 2017.

  1. craenk22

    craenk22 Villager Member

    Messages:
    33
    Likes Received:
    0
    First Language:
    German
    Hey guys simple question, hope you can find a quick solution..
    (I don't want to make thousands of events for my monsters, so I thought of this)

    Monster 01 X = Map X of Event Monster 01
    Monster 01 Y = Map Y of Event Monster 01


    Hero enters Room 01. [ Switch - Room 01 ON ] | [Monster 01 = ON ]
    ► Monster 01 gets killed in Room 01. [Monster 01 = OFF ]
    < Room 01 remembers Monster 01 being dead here>
    Hero leaves Room 01. [ Switch - Room 01 OFF ]

    Hero enters Room 02. [ Switch - Room 02 ON ] | [Monster 01 = ON + teleport to Room 2 ]
    ► Now Monster 01 gets killed in Room 02. [....] because it is dead in Room 01, not Room 02 [Monster 01 = OFF ]
    < Room 02 remembers Monster 01 being dead here, too>
    Hero leaves Room 02. [ Switch - Room 02 OFF ]

    ....and so forth.

    What I want is this "Remember" for the specific Room and the specific monster without having to much of events, switches and variables wasted.
    [...] thought of something like using another Variable as a "Pool Variable" for collecting all the "dead information" in the specific room, but I can't find any solution.

    Can you help me with that?
    I would really appreciate it.
    THANKS!
     
    Last edited: Apr 19, 2017
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,693
    Likes Received:
    6,596
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    you need to use self-switches on the events that pretend to be monsters instead of regular switches. If you do that there is no problem because then the engine will handle everything for you (self-switches are event-dependend, regular switches are project-dependend).

    I suggest you follow the link to the starting point tutorial in my signature and work through some of the eventing tutorials linked there, that will help you make better events.
     
    #2
  3. craenk22

    craenk22 Villager Member

    Messages:
    33
    Likes Received:
    0
    First Language:
    German
    ok I got your point, thanks for the reply!!

    I am using the same enemy over and over again to prevent having thousand of enemy X/Ys and stuff.
    So when I'm self-switching (for example) Monster 01 to A in Room #01 (for dead) it won't appear in Room #02.. because the self Switch is A.

    Or did I misunderstand something here?
     
    #3
  4. Andar

    Andar Veteran Veteran

    Messages:
    28,693
    Likes Received:
    6,596
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    I think we're talking about different things, because the references don't match.

    Are Room 1 and Room 2 different maps or what are they?
    How do you initiate combat? can you give a screenshot of the event?
     
    #4
  5. craenk22

    craenk22 Villager Member

    Messages:
    33
    Likes Received:
    0
    First Language:
    German
    Hey Andar! thanks for the reply again! But you seem right, we talk about two different situations here.

    Room 1 and Room 2 are on the same map, but "kind of seperated" via the map scroll script (like in zelda).
    Likewise a zelda-like combat is initiated as you know it.

    there are too much of events and misunderstandings to solve with making screenshots.
    So maybe you (and also others) give hints how to solve this situation in a way I didn't think of?
     
    #5
  6. Andar

    Andar Veteran Veteran

    Messages:
    28,693
    Likes Received:
    6,596
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    if the enemies are events, the usual way is one event for each enemy, set them to approach (if that is wanted) on the first event page with battle processing, and if enemy is killed use a self-switch to activate a second page that has no sprite and is out f the way.

    I simply don't understand for what reason you want to use switches or variables at all, and to understand that you should post a screenshot of one of the events you made.
     
    #6
  7. craenk22

    craenk22 Villager Member

    Messages:
    33
    Likes Received:
    0
    First Language:
    German
    well as I said: it will be more complicated than before showing you what i've written there.
    you have to see yourself then.

    as soon as I'm releasing a demo, I'll let you know!
    thanks in advance and have a nice day
     
    #7
  8. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,518
    Likes Received:
    3,769
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    It's very hard to understand what you need. But if the enemies are handled by events, and you need to remember their location, use Yanfly's Save Event Locations plugin.
     
    #8
  9. White Flare

    White Flare Villager Member

    Messages:
    20
    Likes Received:
    5
    First Language:
    English
    So if I understand you right you have one big map divided into view-able "Rooms" by how zoomed in you are and a plugin. You want monsters to be able to wonder and move within their "rooms" and be kill able on an instance basis?
    Keep in mind when you make an event then copy and paste that event elsewhere, self switches are unique to every copy, not shared across them all.
    To me this seems like what your trying to accomplish from what little information you have given.
    Monster with a random move route
    On player touch combat happens
    Player defeats monster
    Self switch A turns on
    Page two of event - if self switch A is on erase event
     
    #9
  10. craenk22

    craenk22 Villager Member

    Messages:
    33
    Likes Received:
    0
    First Language:
    German
    thats a very cool plugin you have there!... sadly it's not what I can use for my purpose :(

    Well, the self-switch thingy will work with lots of different events. But I just want few, so I don't need to make thousands of Event X/Y's and common events for checking if they got hit and everything. thats just to much of investment and there has to be a way to make it easier.
     
    #10
  11. SwiftSign

    SwiftSign Veteran Veteran

    Messages:
    184
    Likes Received:
    45
    First Language:
    English
    Primarily Uses:
    RMMV
    If you just want to count how many were defeated, you could take a variable and +1 to it at every event needed.

    If you need to know which have been killed you can use a conditional with "$gameSelfSwitches.value([$gameMap.mapId(ID), EventID, 'A']))" to check. Just replace map ID and event ID with the relevant numbers.

    Self Switches (or individual vars/switches) are the only way to make individual events disappear after being killed, I believe. At least without having parallels running the whole time.
     
    #11
  12. Andar

    Andar Veteran Veteran

    Messages:
    28,693
    Likes Received:
    6,596
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    @craenk22
    Why do you assume that you have to make thousands of eventXY? That is what makes absolutely no sense in your description, because there is absolutely no need for that.

    Please give a screenshot of a single example what you want to use that for, because most likely you're doing it completely wrong - I can't think of any reason for using that because there are better ways.
     
    #12
  13. craenk22

    craenk22 Villager Member

    Messages:
    33
    Likes Received:
    0
    First Language:
    German
    Oh! So is there a new and better way for projectiles hitting an event? Without having those thousands of Event Map X/Y's I mentioned?
    I didn't know that!

    Can you please show me where to find it?

    I just came up with that variable +1 Story a few minutes ago- and this sounds like a nice plan. But with those events I've programmed the only thing possible is to know when a room has no monsters left, and then I can take all those monsters for another room with teleporting them from one to another. But that is absolutely okay with me! :)

    I didn't get the gameselfswitches.value stuff. what are you intending to do with this afterwards?

    yeah, I think you're right with that. And I don't want that
     
    #13
  14. Andar

    Andar Veteran Veteran

    Messages:
    28,693
    Likes Received:
    6,596
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    There are several ways how to handle projectiles - but this is the first time you even mentioned projectiles, before you were only writing about monsters.
    No, even for projectiles you never needed more than two variables no matter how many projectiles or monsters were there, and that is not a new way - it existed even in Ace (and probably in XP and VX as well, those were just before my time).
    But we still can't show you how to do it without getting better descriptions of what you want to do and what you want to happen.
    Because it is not ONE way, it is a principle consisting of several methods that need to be modified to the functions you want.

    But I can tell you that in my game, I have exactly two variables for checking XY, no matter how many thousands of monster or fireball events there will ever be.

    So please, describe what you want to happen in the game - do not use any words of coding at all, but describe what the player will see on the screen. Then we can help you find the correct ways to implement that.
     
    #14
  15. RionFish

    RionFish Villager Member

    Messages:
    20
    Likes Received:
    33
    First Language:
    English
    Primarily Uses:
    RMMV
    I feel like I'm reading what you want a little bit differently from everyone else (and I may be completely wrong in my interpretation).

    From what I'm reading, instead of having 10 separate events to have 10 of the same monster on a large single map divided into rooms, you want to have one event doing the same bit, right? It checks to see which room of the map the actor is in and teleports itself to that room to be killed there,. You want a way to track whether the monster has been 'killed' in a specific room so it doesn't respawn there but can still spawn in the other rooms if it hasn't been killed in those, and you don't want to waste 1000 switches checking this for every map.

    If I'm reading this right, the only way I can see doing it (in my very limited experience) is with Yanfly's Self Switches & Variables. That way instead of using 1000 events or switches you can designate 10 database switches as self switches, called upon by that one event. Then those same self switches can be reused by other events without affecting the previous ones, so you've limited both your events AND your switches.

    Of course the number of self switches you would need to set up would be determined by the maximum amount of times you plan to have to move a MonsterActorX event around a map.
     
    #15
  16. hainsay

    hainsay Villager Member

    Messages:
    25
    Likes Received:
    7
    First Language:
    English
    How's this:

    1. Parallel event checks hero region, compares to previous (May cause 2. to happen), then stores as previous (regions corresponds to rooms)
    2. Comparison showing difference transfers monster to the right room, sets a AliveCheck variable to 1 which is a condition for event page three of the monster
    3. Monster event page 3 (autorun) checks whether current room has been cleared, sets either self switch A activated or not, enabling event page 1 or 2 (alive or dead) and resets AliveCheck to 0.

    To check whether a room has been cleared you would need to have one variable for each room.

    Alternatively you could use one variable (e.g. MonsterDeaths) kind of like binary:

    After defeat of monster in region x:
    MonsterDeaths = MonsterDeaths + 2^(x-1)

    Check for alive in region n:
    if (MonsterDeaths mod 2^(n)) < (2^(n-1))) then AliveEventPage

    You'd only be doing this calculation each time the event is transferred so it wouldn't tax the system much at all.

    I think the whole thing is probably not worth the effort though. For one thing you'd need to make sure you couldn't see the monster in the next room from the previous room, and that would put some pretty big restrictions on mapping, and you'd probably end up with a far larger map than you should for the amount of enemies on it. Maybe not, depending on the order you battle things, depends on your game.
     
    Last edited: Apr 24, 2017
    #16
  17. craenk22

    craenk22 Villager Member

    Messages:
    33
    Likes Received:
    0
    First Language:
    German
    this is by far the best message I've encountered in this post! You really do understand what I want to do. Thank you sir!
    I'll take a look at Yanfly's and will tell you, if this will be the solution for my problem but as you said, it may be limited to an amount which is not much...

    the first idea you had there I also had in mind, but not with region IDs.. but anyway ;D getting used to the new stuff since rpg XP right now.
    I will try that and hope it will be worth the time.
    And for the problem with "couldn't see the monster in the next from the previous room" I just made two "Area Monsters".. Monster 1-5 are in Area 1 and 6-10 are always in Area 2 which are always seperated from each other. This way, I can't "see" which monster got teleported, because none is.
     
    #17
  18. Andar

    Andar Veteran Veteran

    Messages:
    28,693
    Likes Received:
    6,596
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    I also understood that this is what you want to do - however I question the why of "why do you want to use only a single event for the enemy".
    Because as I see it, there is absolutely no reason for that self-imposed limit - on the contrary the entire engine had been optimized in a way that it is easier to use a hundred events for a hundred enemies on a single map than to use a variable and switch structure to check that position when moving a single event around.

    As you found out yourself, it is tedious to do this with a single event and dozens of switches/variables, but it is very easy (and doesn't use up resources) to simply have one different event (and its existing self-switches) for each enemy, even if there are dozens of enemies on the map.
    So why do you want to limit yourself to a single event for that, that is what I don't understand because there is no reason for that limitation.
     
    #18
  19. craenk22

    craenk22 Villager Member

    Messages:
    33
    Likes Received:
    0
    First Language:
    German
    thanks for that informative understandable post right there! I feel understood and think that there are some missing information on how to do things the new way. I'm still treating stuff like I used to as Rpg 2000 was new. I'm having success with my old school stuff but there are a few things I really like to understand to make my life easier with that.

    Do you have some nice understandable tutorial for this specific situation I'm in? that'd be very useful sir!
     
    #19
  20. Andar

    Andar Veteran Veteran

    Messages:
    28,693
    Likes Received:
    6,596
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    I can't point you to a specific tutorial because I'm not exactly sure what you know or why you try it that way.
    However, I collected a lot of links to basic tutorials in my "starting point" tutorial in my signature. Working through all of that would take some time, but has proven helpfull to a lot of users so far.

    However, if you need an answer fast, the two links in the starting point that should be most helpfull to your are the link to the "variables Guide" (a game that tells you how to use variables in a game, while being openable in Ace (trial is enough if you don't own it) to check how the event coding goes.
    The second link would be the link to the list of unencrypted games that could be opened with the correct maker to see how others worked their events - MV games are individually posted near the end of the topic because the first post had not yet been updated, that first post only contains links to games for XP VX and Ace. Again, in all cases the time-limited trial would be sufficient for the games where you don't own the full editor.

    Other than that, just work through the rest of the tutorials as you have time.
     
    #20

Share This Page