Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
en:authors_main:task_editor:advanced:inventory [2026/06/15 21:31] 127.0.0.1 внешнее изменение |
en:authors_main:task_editor:advanced:inventory [2026/06/15 21:40] (current) |
||
|---|---|---|---|
| Line 13: | Line 13: | ||
| ===== How to Display the Inventory on a Level ===== | ===== How to Display the Inventory on a Level ===== | ||
| - | 1. In the task text (in **"Source"** mode), insert an HTML container where the inventory list should be rendered: | + | - In the task text (in **"Source"** mode), insert an HTML container where the inventory list should be rendered: |
| <code HTML> | <code HTML> | ||
| <div id="inventory_container">Loading inventory...</div> | <div id="inventory_container">Loading inventory...</div> | ||
| </code> | </code> | ||
| - | 2. In the task script field (at the bottom of the level settings), add the JS call: | + | - In the task script field (at the bottom of the level settings), add the JS call: |
| <code JavaScript> | <code JavaScript> | ||
| showInventoryItems('inventory_container'); | showInventoryItems('inventory_container'); | ||
| Line 26: | Line 26: | ||
| ==== Adding an Item to the Inventory ==== | ==== Adding an Item to the Inventory ==== | ||
| Adding items is linked to solving level bonuses (or spanning bonuses). | Adding items is linked to solving level bonuses (or spanning bonuses). | ||
| - | 1. Create a bonus on the level (e.g., "Find a hammer"). | + | - Create a bonus on the level (e.g., "Find a hammer"). |
| - | 2. In the **"Text after solution"** field of that bonus, in **"Source"** mode, write: | + | - In the **"Text after solution"** field of that bonus, in **"Source"** mode, write: |
| <code HTML> | <code HTML> | ||
| <script> | <script> | ||
| Line 42: | Line 42: | ||
| ==== Removing an Item from the Inventory (Usage or Loss) ==== | ==== Removing an Item from the Inventory (Usage or Loss) ==== | ||
| To remove an item from a team (e.g. when giving it to a character or using it to unlock a door): | To remove an item from a team (e.g. when giving it to a character or using it to unlock a door): | ||
| - | 1. Create a bonus that is solved during the game. | + | - Create a bonus that is solved during the game. |
| - | 2. In its **"Text after solution"** field, in **"Source"** mode, write: | + | - In its **"Text after solution"** field, in **"Source"** mode, write: |
| <code HTML> | <code HTML> | ||
| <script> | <script> | ||