Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
635
Reaction score
210
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
635
Reaction score
210
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 Profile Posts

Kind of relieved that I had medibang installed when I need to edit Sprite I was about to download gimp but I remember I had medibang installed lol
Voting for the first round of the Map Madness Tournament is now live! Vote for your favorite in each matchup!

Finally started working on Grim Trigger episode 2 today :LZScat: it's half comic/half visual novel!

GfY3Rwj.png
Is it interesting to get more backstory on villains? A key moment in their past, their childhood, or maybe something that shows they've always been that way? To see or not to see?
"Everything tastes like chicken until it's chicken, then it doesn't taste like chicken."
Context: chicken samosas do not taste like chicken. I thought it was veggie samosas.
Just another ordinary evening.

Forum statistics

Threads
110,365
Messages
1,052,623
Members
143,397
Latest member
RainingLamppost
Top