- Joined
- Jan 26, 2014
- Messages
- 1,281
- Reaction score
- 106
- First Language
- Irish
- Primarily Uses
- N/A
As I was making a tweak on making items, I have something in mind. So basically, when you make an actor / party gain an item, you would do:
$game_party.gain_item($data_items[1], 2)where 1 is the item id and 2 then amount. Now, I remember Tsukihime mentioned me about using a loop. I thought of making a loop inside the array where it gets at least 1 or more item ids. What I did was:
foods = [1,2,3,4,5]$game_party.gain_item($data_items[foods[0..foods.size]], 2)You will find it crazy as to gain item somehow only accepts an integer over an array. I have a question about this then, how can I make sure that I can gain all the items of the item id I indicated on foods? Is there a more functional way of gaining an item except making use of the gain_item command via game party? Or I have to make tons of gain item?
$game_party.gain_item($data_items[1], 2)where 1 is the item id and 2 then amount. Now, I remember Tsukihime mentioned me about using a loop. I thought of making a loop inside the array where it gets at least 1 or more item ids. What I did was:
foods = [1,2,3,4,5]$game_party.gain_item($data_items[foods[0..foods.size]], 2)You will find it crazy as to gain item somehow only accepts an integer over an array. I have a question about this then, how can I make sure that I can gain all the items of the item id I indicated on foods? Is there a more functional way of gaining an item except making use of the gain_item command via game party? Or I have to make tons of gain item?
