please give a link to the website where you got the reset self switch script from.
no one can help you without a link to that website
It's not very long:
#--------------------------------#
# Dramatic Lightning Co Presents:
# Self Switch Reseter
#--------------------------------#
# You can reset your Event's Self Switches with this script!
# Create a Comment in the first line of your Event page and
# place <resetss: 0abcd> there. abcd are the letters of the
# self switch you want to reset.
#--------------------------------#
# By default, you only need to place the notetag in the first
# page and it'll reset the self switches regardless of what
# page you're on. You can put 0 (zero) in the notetag so that it'll
# only affect the first page. Alternatively, you can place the
# notetags in each other page.
#--------------------------------#
module DL
module Renew
Regex = /<resetss:\s*(\w+)\s*>/i
end
end
module RPG
class Event::page
def reset_ss
bob = ""
@list.each {|cmd|
if cmd.code == 108 && res = cmd.parameters[0].match(DL::Renew::Regex)
bob = res[1].to_s
end
}
return bob
end
end
end
class Game_Event < Game_Character
alias dl_renew_initialize initialize
def initialize(map_id, event)
dl_renew_initialize(map_id, event)
renew_self(map_id, event)
refresh
end
def renew_self(map_id, event)
bob = ""
bob = @event.pages[0].reset_ss if @event.pages[0]
bob = @page.reset_ss if bob == "" or bob.include? "0"
$game_self_switches[[map_id, event.id, "A"]] = false if bob.include? "a"
$game_self_switches[[map_id, event.id, "B"]] = false if bob.include? "b"
$game_self_switches[[map_id, event.id, "C"]] = false if bob.include? "c"
$game_self_switches[[map_id, event.id, "D"]] = false if bob.include? "d"
end
end
Ignore the uncapitalized p really, it was something I ended up changing before using the code tag because the forum interpreted it as a tongue-in-cheek emoji... other than that though, what could I do? Not sure I understood what I can change with the first paragraph.
A script that's even shorter?
I'm using it to respawn enemies. What's strange, though, is that the error occurs where there are no such events.
Yep, seems to have fixed it, thanks.