Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
636
Reaction score
211
First Language
English
Primarily Uses
RMMV
Hello!

By any chance, could someone help me resolve a long standing issue I've ran into regarding Flacao's MMO Alchemy script?

https://www.rpgmakercentral.com/top...-alchemy-and-extraction-system/#comment-94754

The problem I've ran into isn't to do with the actual alchemy system, but the ingredient harvesting and respawn system also build into the script. With it, you can set a harvestable event to respawn after X in game seconds. Thenonpy issue is this tiner only accounts for time spent in that map in which the event is in.

As such, could someone please help me create an edit or add-on script to allow for this respawn timer to be active anywhere in the game, instead of just the one specific map?

Thank you!
 

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
689
Reaction score
448
First Language
English
Primarily Uses
RMVXA
You could try this:
Code:
class FalcaoExtraction

  def data
    $game_party.ev_extdata
  end
    
  def update_respawn
    data.each_key do |map|
      next if data[map].empty?
      data[map].each do |event_id, event_data|
        next unless event_data[2]
        if $game_system.playtime >= event_data[1]
          $game_map.events[event_id].fading = [:fade_out, 60] if map == $game_map.map_id
          data[map].delete(event_id)
          data.delete(map) if data[map].empty?
        end
      end
    end
  end
 
  def apply_variance
    data[$game_map.map_id] = {} if data[$game_map.map_id].nil?
    event = $game_party.extract_data[7]
    times = event.check_ext("<extract_times: ")
    res   = $game_system.playtime + event.check_ext("<extract_respawn: ")
    if data[$game_map.map_id][event.id].nil?
      data[$game_map.map_id][event.id] = [times, res, false]
    end
    data[$game_map.map_id][event.id][0] -= 1
    if data[$game_map.map_id][event.id][0] == 0
      event.fading = [:fade_in, 60]
      data[$game_map.map_id][event.id][2] = true
    end
  end
 
end

If an event is ready to be respawned and you aren't on the map, it will be there next time you enter the map. Otherwise, it will fade in. I haven't tested it extensively, so let me know how it goes.
 

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
636
Reaction score
211
First Language
English
Primarily Uses
RMMV
Sorry that I'm a bit late with a response. I'm happy to say that it works great for me, although in a somewhat odd way.

If I set up a harvestable event the normal way, it will indeed respawn while I'm off map, but if it does respawn while I'm not in the map, it will never respawn again after I harvest it again.

However, the way I have it set up, I use Shaz's Clone Event script ( https://forums.rpgmakerweb.com/index.php?threads/clone-events.18727/ ), to keep all the events in one place, in case I want to edit them later. And oddly enough, events spawned this way do indeed work perfectly with your script.

In my case, it works perfectly fine, just thought I'd bring it up, since I found it pretty peculiar.
 

Latest Threads

Latest Posts

Latest Profile Posts

unknown.png

A sketch of a character for an upcoming chapter. I am pre-preparing the heck out of this one and future chapters, don't want to spend time figuring the story out again. :blush:
Today *Fix the game UI
RMMZ maxRows make me tired.
The game supports real-time language switching (really interesting).
8laFKAa.png


jBYDFzZ.png


lYbvPth.png

mY99lgU.png

Swag collecting in the new randomly generated area. Now the mini map also shows the randomly generated features... And even illustrates the whole "bubble" system" that I made to manage memory... Though that part's inadvertent. We'll just call that "the fog of war"... Yes, that's what we'll do. Nobody will be the wiser! :kaopride:
not me being not lazy for 5 seconds and drawing another char portrait (her name is hazel)
its_hazel.png
Been a while since the last time I made a song remix. Had a blast making this

Forum statistics

Threads
110,458
Messages
1,053,467
Members
143,550
Latest member
manyattempts
Top