BTW...
...I wrote a namespace, containing all variables, arrays and functions, and 3 scripts (2 FFC, 1 ComboData),
which can read and write in the namespace to interact with each other.
The 3 Sripts handle everything , shown in the preview video:
https://www.purezc.n...78262&p=1074084
The 1st is the FFC, placed on the market stall.
1) FFC: MarketStall
- if the player's close enough, facing the ffc and pressing "A", it save's the current DMap, Screen, X-/Y-Coordinates and player's Direction
- it fades out the current screen, before warping to a certain ShopScreen, on the Shops' DMap (declared in the FFCs D[0-7] Arguments)
I added this fade out for extra smooth and soft crossing
- can display 1 of 3 Inventory Icons, by checking certain flags of the FFC
OPTIONAL FEATURE:
- can be used to declare iventory-specific shops: weapons, armors, utilities / or just to show if a shop sales special items)
- if unwanted, don't check any of the related FFC flags
I'm gonna add a variable message and a dialogue string (view stall? "yes/no"), to introduce the interaction.
2) COMBODATA: ShopTypes
- sets Shop- Items and Prices
- place it on a Screen, on layer 0 covered by other layers and it sets 8 items and 8 prices,
by reading its own Attribytes and Attrishorts
- can display the Shop Name, instead of a DMap Title
...
I'm going to add flexible ways to create 2 types of Shop Puzzles
Change: This will either change entire Inventory or just single Items + Prices.
Refuse: Will either refuse to sell certain items or refuse to trade entirely.
Theese features can be set by ScreenData Flags (General Purpose) to declare the screen as a "Puzzle Shop".
The puzzle Type and Solution can be defined by the Combo's Flagset
...for example...
PUZZLE TYPE FLAGS 0 & 1:
-Flag[0] = TYPE: Change, Flag[1] = TYPE: Refuse
SOLUTION TYPE FLAGS 2+:
Flag[2] = checking Screen Secrets, Flag[3] = checking certain Item, Flag[4] checking certain Counter,
Flag[5] checking if the player's on a certain Screen Flag, (etc)
If the solution flag is Flag[3] or bigger (so checking for Items, Counter Values, Screen Flags under the Player),
the individual solution Item ID, Counter ID and Value, or Screen Flag number is set by the Combo's Attributes.
2) FFC: Shop64
The actual Shop Screen Script
The FFC handles the entire trading interaction sequnce.
- it plays an individual Intro and outro Message
- it displays all Items, Dialogue Strings + Cursor
- It starts and breaks the NPC Animations (btw the NPC is an LWeapon instead of an FFC, because of easier extending and
graphical flexibility.
- it does, what a shop code should do... checks if you've got engough money for the selected item and if so it adds it adds the item
and adds Amount & Max Increase to the related DCounter ...and drains the Rupee Counter.
- After trading, it fades out the current shop screen and warp to the saved, previous DMap, Screen and Coordinatesand restores
the previous direction.
Edited by Bagu, 25 July 2023 - 06:23 AM.