This was hard to name but I am trying to make a system for my map script. It shows when you have found all the collectables on the current map. In this case, it's one of the same collectable that is the same item given. It needed to be linked to the map itself and another id for which collectable. so I tried making a system that the dev could just add to the game system itself is their way for me to get this script call to work $game_system.collectable_add(map_id, "collectable_name", amount)
Code:
class Game_System
attr_accessor :collectable
attr_accessor :collectablename
alias jake_MAP_gamesystem initialize
def intitilize
$collectable = []
$collectable[] = Array.new()
@collectablename = ""
jake_MAP_gamesystem()
end
def collectable_get(id,collect)
return if @collectable == nil
p($collectable[id][collect])
end
def collectable_add(id, collect, val)
p($collectable[id][collect])
return if $collectable[id][collect] == nil
$collectable[id] = Array.new() if $collectable[id][collect] == nil
$collectable[id][collect] += val
p($collectable[id][collect])
end
I also am trying to get my map script to read this in an if command has well.
def collectable_set(id, collect ,val)
$collectable = []
$collectable[id] = Array.new()
$collectable[id][collect] = val
end
def collectable
$collectable
end
end