Post by christi on May 7, 2005 10:37:45 GMT -5
This is the script I'm using to allow the player use of items outside of battle in a Custom Menu System. You are still, essentially, "simulating" items, but without the use of variables. I've tested this all out and implemented it in my own CMS, and it seems to work fine.
In my CMS, I call a script called [Merchant Items].
[Merchant Items] Script:
Input: Merchant List 1 Items
When you place this line, the Input: Merchant box will come up. It requires you to place at least one item in one of the slots; it doesn't matter which. The important part is the Merchant Script slot. In this, I place a script called [Display Sell List].
[Display Sell List] Script:
Input: Display Sell List
Data: Load Item Info
Script Branch: Sort Variable [Item Number]
Script Branch: Apply If: Number is +1
The number here (+1) corresponds with the item's number in the Item Database.
Input: Display Member List (23, 23)
This allows the player to choose which member the item is used on.
Script Branch: Sort Variable [Member Number]
Script Branch: Apply If: Number is +1
Now, (+1) is corresponding with the member number in the Member Database. I don't use Member #0, as he is glitchy.
Party: Bag: [Fresh Herb] -1
Member Info: [Amaelia] HP +10
Script Branch: To End
Script Branch: Apply If: Number is +2
Repeat for all possible party members.
Data: Variable [Member Number] = [0 (Fixed)]
Script Branch: End
Data: Variable [Item Number] = [0 (Fixed)]
Script Branch: End
It's important to reset these variables each time, or things get awfully buggy...
The size of this script depends heavily on the number of items you plan to make available, as well as the number of party members you plan on having, as each potential item will have to be scripted to work on each potential party member. Calling external Item scripts would definitely save memory here.
The only problem that I see with this script is that it is written to target only the items in the party's Bag. Not a problem for me, as that's all I plan to use, but if an individual party member is carrying an item and the player selects it to use, the intended effect will occur on the party member, but the item won't be subtracted from the member's inventory; just the bag. It could probably be scripted to work both ways, but would require a lot more effort and memory. The way it's set up now works just fine for me.
In my CMS, I call a script called [Merchant Items].
[Merchant Items] Script:
Input: Merchant List 1 Items
When you place this line, the Input: Merchant box will come up. It requires you to place at least one item in one of the slots; it doesn't matter which. The important part is the Merchant Script slot. In this, I place a script called [Display Sell List].
[Display Sell List] Script:
Input: Display Sell List
Data: Load Item Info
Script Branch: Sort Variable [Item Number]
Script Branch: Apply If: Number is +1
The number here (+1) corresponds with the item's number in the Item Database.
Input: Display Member List (23, 23)
This allows the player to choose which member the item is used on.
Script Branch: Sort Variable [Member Number]
Script Branch: Apply If: Number is +1
Now, (+1) is corresponding with the member number in the Member Database. I don't use Member #0, as he is glitchy.
Party: Bag: [Fresh Herb] -1
Member Info: [Amaelia] HP +10
Script Branch: To End
Script Branch: Apply If: Number is +2
Repeat for all possible party members.
Data: Variable [Member Number] = [0 (Fixed)]
Script Branch: End
Data: Variable [Item Number] = [0 (Fixed)]
Script Branch: End
It's important to reset these variables each time, or things get awfully buggy...
The size of this script depends heavily on the number of items you plan to make available, as well as the number of party members you plan on having, as each potential item will have to be scripted to work on each potential party member. Calling external Item scripts would definitely save memory here.
The only problem that I see with this script is that it is written to target only the items in the party's Bag. Not a problem for me, as that's all I plan to use, but if an individual party member is carrying an item and the player selects it to use, the intended effect will occur on the party member, but the item won't be subtracted from the member's inventory; just the bag. It could probably be scripted to work both ways, but would require a lot more effort and memory. The way it's set up now works just fine for me.