- 72
- Posts
- 6
- Years
- Seen Jan 24, 2021
Hello, all. I've been having difficulties with a mechanic I wish to add to mining. I wanted to be able to change the probability of discovering certain items depending on location. For example, one map would have a higher chance of the player finding fossils, while another map would have a higher chance of finding shards. I thought I could probably achieve this by checking for the game map
But when I tried that, I got the error
I wasn't really sure what to do, so I added things the below code to class MiningGameScene
But it wasn't any good. I'm not really sure what to do next. Does anyone know what I'm doing wrong? Thank you for any help in advance.
Code:
if $game_map.map_id==7
ITEMS = [...]
else
ITEMS = [...]
end
But when I tried that, I got the error
Code:
Script 'PMinigame_Mining' line 142: NoMethodError occurred.
undefined method 'map_id' for nil:NilClass
I wasn't really sure what to do, so I added things the below code to class MiningGameScene
Code:
attr_accessor :map_id
@map_id = 0
But it wasn't any good. I'm not really sure what to do next. Does anyone know what I'm doing wrong? Thank you for any help in advance.