I actually posted the wrong script , Dropbox should contain the right version now.
I had actually added the functions for the Single Seed produce and Growth as I was coding but removed them for testing and posted the testing script.
As to Produce return, The script currently just selects a random Item from the array for that combination, just only include 1 id to make sure its a certain type, and Yes currently it only provides 1 of the return Produce, I'll probably add a config for that when I get the chance.
The script should make more sense now that the produce and Growth functions are re-added, however here's a partial example of a set-up. I can probably do a more in depth at some point if you need one.
I had actually added the functions for the Single Seed produce and Growth as I was coding but removed them for testing and posted the testing script.
As to Produce return, The script currently just selects a random Item from the array for that combination, just only include 1 id to make sure its a certain type, and Yes currently it only provides 1 of the return Produce, I'll probably add a config for that when I get the chance.
The script should make more sense now that the produce and Growth functions are re-added, however here's a partial example of a set-up. I can probably do a more in depth at some point if you need one.
module Garden
#=====
# Database has 5 Seeds (ids 21 to 25) and 9 Produces (ids 9 to 17)
#=====
SEED_IDS = [21, 22, 23, 24] # The Seeds that can be planted with another seed
# IDs of the items in the database that are seeds. Add them into the array in
# the order of value/rarity in your game
#* CAN BE LEFT BLANK (e.g. = []) TO DISABLE DOUBLE SEEDS
SINGLE_IDS = [21, 25]
#* IDs of the items in the database that can be planted by themselves
#* The IDs do not have to be in the SEED_ID Array!
#* CAN BE LEFT BLANK (e.g. = []) TO DISABLE SINGLE SEEDS
def self.growth_rate(seed)
return case seed
#* when ITEM_ID then SECONDS
when 21 then 10
when 22 then 12
when 23 then 15
when 24 then 20
else
10 #* Default Return Value : Set this just in case of Bugs
end
end
def self.growth_rate_Single(seed)
return case seed
# when ITEM_ID then SECONDS
when 21 then 10
when 25 then 12
else
10 #* Default Return Value : Set this just in case of Bugs
end
end
end
# For Seed at position 1 the index is 0
# For Seed at position 2 the index is 1
def self.produce(seed)
return case seed
# when Combined Array Index then Array of Produce Item Ids
when 0 then [9, 10] # Result of 21,21
when 1 then [10, 11] # Result of 22,21
when 2 then [12, 13] # Result of 23,21 or 22,22
when 3 then [13, 14, 15] # Result of 24,21 or 23,22
when 4 then [14, 15] # Result of 24,22 or 23,23
when 5 then [15, 16] # Result of 24,23
when 6 then [17] # Result of 24,24
else
[9,10] #* Default Return Values : Set this just in case of Bugs
end
end
# For Seed at position 1 the index is 0
# For Seed at position 2 the index is 1
# ... etc ...
def self.produceSingle(seed)
return case seed
# when Index then ArrayOfProduce
when 0 then [9,10] # Result of 21
when 1 then [10,11] # Result of 25
else
[9,10] #* Default Return Values : Set this just in case of Bugs
end
end