i have a script I've been editing and I'm trying to select a key item then check if that item has the note tag <seed 1> if it does take the number after seed and pass it along otherwise throw a message to the player that the item wasn't a seed.
here is some of the script:
here is some of the script:
Code:
module FARM_PARAMS
SEED = 21
end
Plant = {
#turnip
1 => {:item => [:item,17,[1,4]],
:level => 1,
:timer => 1,
:base_chance => 75,
:max_chance => 100,
:chance_mod => 5,
:graphic => ["$Turnip",0],
:sound => ["Jump1",75,1,3]},
:persist => "false",
}
class game_event
def plant_id
if FARM_PARAMS::SEED != nil
return seed_to_plant #part i'm having trouble with.
end
end
def farm_data
return Plant[plant_id]
end
def farm_start
$game_message.item_choice_variable_id = FARM_PARAMS::SEED
if farm_data != nil
#code goes here using "farm_data"
end
end
class RPG::Item
def seed_to_plant
seed = $data_items[FARM_PARAMS::SEED]
if seed.note =~ /<seed (.*)>/i
return $1.to_i
else
$game_message.add("This item isn't a seed")
return nil
end
end
end
end