Random map appearances (Encounters and collectibles)

● ARCHIVED · READ-ONLY
Started by LuvLuvSP 7 posts View original ↗
  1. Hello!

    New to all of this and having trouble setting up something in the system. I’m trying to set up a system where when you enter a map screen, on screen enemy encounters and foragable items are randomly generated. Beating my head against a brick wall currently and I am not sure what I’m doing wrong,

    I set an event on the map where page 2 is an autorun page with a control variable and conditional loop. If the variable is within a certain range it will set a self switch on, if not it will erase the event. Page 1 will run the item collection or battle encounter, turn the self switch off and erase event. Page 2 has no image set, page one has a sprite set.

    The problem is none of this will spawn any enemies or foragable items, even if I’ve set the random number to always generate something with the guidelines of turning the self switch on.

    I’ve searched many posts and nothing quite answers the question. If Anyone has any suggestions or can point out what I’m doing wrong that would be greatly appreciated.

    Thanks so much!
  2. Page 2 will always prioritize over Page 1 (RM prioritizes higher pages) so if your Page 1 is the one with self switch and Page 2 is the autorun, your page 1 will never be used sonce Page 2 will always be active.

    What you need to do is make page 1 the autorun, and Page 2 be the page that needs self switch to be ON
  3. Ok, so you have two different topics here, I'll focus on one for now so we don't get mixed up.

    Some general questions to help you focus:
    On-map Enemies
    • How will the battles be triggered?
      • Enemy will chase player and try to touch them?
      • Player goes up to enemy and presses Enter?
      • Player steps into enemy "line of sight" like in Pokemon?
    • When you defeat an enemy, are the enemies defeated forever, or only until the next time the player goes to the map?

    Next, please show us screenshots of your events (all pages). Make sure to include the entire event window with all of the information. Without seeing your events, it's very hard to assist.
  4. Engr. Adiktuzmiko said:
    Page 2 will always prioritize over Page 1 (RM prioritizes higher pages) so if your Page 1 is the one with self switch and Page 2 is the autorun, your page 1 will never be used sonce Page 2 will always be active.

    What you need to do is make page 1 the autorun, and Page 2 be the page that needs self switch to be ON

    I think I got my head wrapped wrong around the order of pages and when I was setting up the way I read in another thread I reversed the pages, cause I was trying to work backwards. Thank you so much that problem is solved!

    Addendum though, the enemies and foraging items are always there once they’ve been activated once, unless defeated or collected, then the random chance is calculated again. Is there anyway to reset the events so that if I don’t pick something up or defeat the enemy, that it would have a chance not to spawn if I leave and re-enter the map? Would that require me to set up extra switches in every entrance and exit to the map? Or is there a simpler way of doing that?
  5. You'd need to reset their self switches when you go out of the map for that.. You would need to do it via script call though since you cant normally access self switches of other events via the normal commands.

    Not sure for MV but back in Ace it was

    $game_self_switches[[mapid,eventid,selfswitch]] = true/false
  6. you could try this piece of code:

    $gameSelfSwitches.setValue([map_id, event1_id, 'A'], false)
    or
    $gameSelfSwitches.setValue([map_id, event1_id, 'A'], true)

    ...in a script call command event...
  7. You might want to fade out first on your map transfer out of the map though before you do the reset since the graphical update might make the events disappear before you transfer which might look weird