Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
614
Reaction score
204
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
686
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
614
Reaction score
204
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

Just a reminder. One expectation of being a new member is that you read the rules. You can find them here: https://forums.rpgmakerweb.com/index.php?threads/forum-rules.90/

Looking to identify this particular Keygen song used in a YTP
I'm currently in the mood to write horror.
Someone do something scary. (orange)
I have an idea, I am making low polygon 3D resources for a package in itch. but it occurred to me that I could export these as images and make MV / MZ compatible tilesets. What do you think of this?
I hate seeing threads where less-experienced user's ask for an opinion of their project, and the thread is full of negative feedback by others who are clearly not the target audience. I feel bad for the OP, and I hope they understand that no game can appeal to everyone. :frown:

Forum statistics

Threads
109,091
Messages
1,041,941
Members
141,577
Latest member
dreaptix
Top