- Joined
- Mar 19, 2017
- Messages
- 37
- Reaction score
- 6
- First Language
- English
- Primarily Uses
- N/A
Hi, I'm pretty basic in scripting, so here is a problem i encounter last night,
so i decided to make two(or more) main character in my game and will tells their story respectively. and of course it need a separated inventory.
the way i am doing it is by collecting all the item that gotten so far from the inventory and save it to variables (a lot of variables) and subtract all the item in my inventory by the amount of their own value so it will erase them (giving 0 value). and whenever i need it, i will just add all the item by the amount that saved in the variables.
my problem is: the way i am doing item save is using a loop and increase in variable. err.. maybe i will show you the event script instead
So by the logic i use there,
Variable 24 = 22
Variable 25 = 1
So they will add variable 24 and 25 by 1 as long as variable 24 is less than 24(value)
and the script will results in as far as i know
$game_variables[22] = $game_party.item_number($data_items[1]);
$game_variables[23] = $game_party.item_number($data_items[2]);
and so on.
*variable 22 and 23 is variables to save the amounts of certain item. on above, i uses it to save Potion and Hi-Potion.
but somehow when i play test it, it will return
My real question is:
1. Am i doing it wrong on implementing my logic into the above script?
2. Is the script box use default concatenation or it read each line as different line? since the script was like:
line n: $game_variables[$game_variables[24]] =
line n+1: $game_party.item_number($data_items
line n+2: [$game_variables[25]])
3. Is there any efficient way to implement lots of inventory save, inventory delete, or inventory add?
Any help is appreciated.
so i decided to make two(or more) main character in my game and will tells their story respectively. and of course it need a separated inventory.
the way i am doing it is by collecting all the item that gotten so far from the inventory and save it to variables (a lot of variables) and subtract all the item in my inventory by the amount of their own value so it will erase them (giving 0 value). and whenever i need it, i will just add all the item by the amount that saved in the variables.
my problem is: the way i am doing item save is using a loop and increase in variable. err.. maybe i will show you the event script instead
So by the logic i use there,
Variable 24 = 22
Variable 25 = 1
So they will add variable 24 and 25 by 1 as long as variable 24 is less than 24(value)
and the script will results in as far as i know
$game_variables[22] = $game_party.item_number($data_items[1]);
$game_variables[23] = $game_party.item_number($data_items[2]);
and so on.
*variable 22 and 23 is variables to save the amounts of certain item. on above, i uses it to save Potion and Hi-Potion.
but somehow when i play test it, it will return
My real question is:
1. Am i doing it wrong on implementing my logic into the above script?
2. Is the script box use default concatenation or it read each line as different line? since the script was like:
line n: $game_variables[$game_variables[24]] =
line n+1: $game_party.item_number($data_items
line n+2: [$game_variables[25]])
3. Is there any efficient way to implement lots of inventory save, inventory delete, or inventory add?
Any help is appreciated.