- 163
- Posts
- 8
- Years
- Seen Feb 15, 2025
Hi everyone!
My problem this week is the following.
I am using the ACHIEVEMENT SCRIPT of Mega Mewthree (I find it on Relic Castle). It turns out that I install it in my V.17 and everything works fine in my saved game, but when I start a new game I get the following error ...
Does anybody know what is it due to? Apparently it has to do with the number of steps, because the error appears just when I move the character for the first time.
I tried to ask RELIC CASTLE, but I have been waiting for months for my verification email to sign up : D
here the script
My problem this week is the following.
I am using the ACHIEVEMENT SCRIPT of Mega Mewthree (I find it on Relic Castle). It turns out that I install it in my V.17 and everything works fine in my saved game, but when I start a new game I get the following error ...
![[PokeCommunity.com] Achievement Script Problem [PokeCommunity.com] Achievement Script Problem](https://i.ibb.co/VH8gf05/ERROR-01.png)
Does anybody know what is it due to? Apparently it has to do with the number of steps, because the error appears just when I move the character for the first time.
I tried to ask RELIC CASTLE, but I have been waiting for months for my verification email to sign up : D
here the script
Spoiler:
Code:
####################################################################################
############# PLACE THIS IN A NEW SCRIPT SECTION RIGHT AFTER WALK_RUN! #############
####################################################################################
module Achievements
# IDs determine the order that achievements appear in the menu.
@achievementList={
"STEPS"=>{
"id"=>1,
"name"=>"Tired Feet",
"description"=>"Walk around the world.",
"goals"=>[10000,50000,100000]
},
"POKEMON_CAUGHT"=>{
"id"=>2,
"name"=>"Gotta Catch 'Em All",
"description"=>"Catch Pokémon.",
"goals"=>[100,250,500]
},
"WILD_ENCOUNTERS"=>{
"id"=>3,
"name"=>"Running in the Tall Grass",
"description"=>"Encounter Pokémon.",
"goals"=>[250,500,1000]
},
"TRAINER_BATTLES"=>{
"id"=>4,
"name"=>"Battlin' Every Day",
"description"=>"Go into Trainer battles.",
"goals"=>[100,250,500]
},
"ITEMS_USED"=>{
"id"=>5,
"name"=>"Items Are Handy",
"description"=>"Use items.",
"goals"=>[250,500,1000]
},
"ITEMS_BOUGHT"=>{
"id"=>6,
"name"=>"Buying Supplies",
"description"=>"Buy items.",
"goals"=>[250,500,1000]
},
"ITEMS_SOLD"=>{
"id"=>7,
"name"=>"Seller",
"description"=>"Sell items.",
"goals"=>[100,250,500]
},
"MEGA_EVOLUTIONS"=>{
"id"=>8,
"name"=>"Mega Evolution Expert",
"description"=>"Mega Evolve Pokémon.",
"goals"=>[250,500,1000]
},
"PRIMAL_REVERSIONS"=>{
"id"=>9,
"name"=>"Primal Power",
"description"=>"Primal Revert Pokémon.",
"goals"=>[250,500,1000]
},
"ITEM_BALL_ITEMS"=>{
"id"=>10,
"name"=>"Finding Treasure",
"description"=>"Find items in item balls.",
"goals"=>[50,100,250]
},
"MOVES_USED"=>{
"id"=>11,
"name"=>"Ferocious Fighting",
"description"=>"Use moves in battle.",
"goals"=>[500,1000,2500]
},
"ITEMS_USED_IN_BATTLE"=>{
"id"=>12,
"name"=>"Mid-Battle Maintenance",
"description"=>"Use items in battle.",
"goals"=>[100,250,500]
},
"FAINTED_POKEMON"=>{
"id"=>13,
"name"=>"I Hope You're Not Doing a Nuzlocke",
"description"=>"Have your Pokémon faint.",
"goals"=>[100,250,500]
}
}
def self.list
return @achievementList
end
def self.fixAchievements
if !$achievements.is_a?(Hash)
$achievements={}
end
@achievementList.keys.each{|a|
if $achievements[a].nil?
$achievements[a]={}
end
if $achievements[a]["progress"].nil?
$achievements[a]["progress"]=0
end
if $achievements[a]["level"].nil?
$achievements[a]["level"]=0
end
}
$achievements.keys.each{|k|
if [email protected]? k
$achievements.delete(k)
end
}
end
def self.incrementProgress(name, amount)
if @achievementList.keys.include? name
if !$achievements[name].nil? && !$achievements[name]["progress"].nil?
$achievements[name]["progress"]+=amount
self.checkIfLevelUp(name)
return true
else
return false
end
else
raise "Undefined achievement: "+name.to_s
end
end
def self.decrementProgress(name, amount)
if @achievementList.keys.include? name
if !$achievements[name].nil? && !$achievements[name]["progress"].nil?
$achievements[name]["progress"]-=amount
if $achievements[name]["progress"]<0
$achievements[name]["progress"]=0
end
return true
else
return false
end
else
raise "Undefined achievement: "+name.to_s
end
end
def self.setProgress(name, amount)
if @achievementList.keys.include? name
if !$achievements[name].nil? && !$achievements[name]["progress"].nil?
$achievements[name]["progress"]=amount
if $achievements[name]["progress"]<0
$achievements[name]["progress"]=0
end
self.checkIfLevelUp(name)
return true
else
return false
end
else
raise "Undefined achievement: "+name.to_s
end
end
def self.checkIfLevelUp(name)
if @achievementList.keys.include? name
if !$achievements[name].nil? && !$achievements[name]["progress"].nil?
level=@achievementList[name]["goals"].length
@achievementList[name]["goals"].each_with_index{|g,i|
if $achievements[name]["progress"] < g
level=i
break
end
}
if level>$achievements[name]["level"]
$achievements[name]["level"]=level
self.queueMessage(_INTL("Achievement Reached!\n{1} Level {2}",@achievementList[name]["name"],level.to_s))
return true
else
return false
end
else
return false
end
else
raise "Undefined achievement: "+name.to_s
end
end
def self.getCurrentGoal(name)
if @achievementList.keys.include? name
if !$achievements[name].nil? && !$achievements[name]["progress"].nil?
@achievementList[name]["goals"].each_with_index{|g,i|
if $achievements[name]["progress"] < g
return g
end
}
return @achievementList[name]["goals"][@achievementList.length-1]
else
return 0
end
else
raise "Undefined achievement: "+name.to_s
end
end
def self.queueMessage(msg)
if $achievementmessagequeue.nil?
$achievementmessagequeue=[]
end
$achievementmessagequeue.push(msg)
end
end