RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
RMVXA (Script Request) Skip missing resource

0 Members and 1 Guest are viewing this topic.

*
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Rep:
Level 96
&&&&&&&&&&&&&&&&&&&&&&&&&&&
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
I was wondering if a script that just skipped missing resources existed.

Scenario:
"Map 1" has "BGM A"
I delete "BGM A"
When I play "Map 1" the game crashes "Missing BGM A!"

What I'm looking for:
"Map 1" has "BGM A"
I delete "BGM A"
When I play "Map 1" it just doesn't play any music.


Why did they do this? Most games (non-rpg maker) that have a missing file, that file just doesn't load. Why does a missing file just out right crash the game?

ts;dc
Also, this is probably something handled at a level that scripts can't change. I was just hoping that it was possible to change this with a script or something, IDK.
&&&&&&&&&&&&&&&&

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
I'm skeptical that this will be error free due to how quickly I made this little snippet, but this should work:

Code: [Select]
#==============================================================================
# ** Audio
#==============================================================================

class << Audio
 
  [:bgm, :bgs, :me, :se].each { |method|
    alias_method("coz_aud_skmrsc_#{method}_play".intern, "#{method}_play".intern)
    define_method("#{method}_play".intern) { |filename, *args|
      send("coz_aud_skmrsc_#{method}_play".intern, filename, *args) rescue nil
    }
  }
 
end

#==============================================================================
# ** Cache
#==============================================================================

class << Cache

  alias coz_cch_skmrsc_load_bitmap load_bitmap
  def load_bitmap(*args)
    coz_cch_skmrsc_load_bitmap(*args) rescue empty_bitmap
  end

end
« Last Edit: April 16, 2013, 03:09:56 AM by cozziekuns »

*
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Rep:
Level 96
&&&&&&&&&&&&&&&&&&&&&&&&&&&
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
Wow. Thank you.
It works perfectly. I made a test map, set a song, then deleted it. The game just continued on like normal.

I don't know why they didn't just make it this way. >_>

Again, thank you. ^_^
&&&&&&&&&&&&&&&&

***
Rep:
Level 77
RMRK Junior
Maybe make it load an error trap file?