Author Topic:  [Blueprint] Inventory Presets  (Read 287 times)

0 Members and 1 Guest are viewing this topic.

muD

  • Legendary Member
  • *****
  • Posts: 1177
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members Day 1 w/25+ posts (4/12/13) 2 years on site Former MotM winners 1 year on site
    • View Profile
    • Awards
[Blueprint] Inventory Presets
« on: December 31, 2014, 09:01:14 AM »
Inventory Presets

Examples of pre-set inventories.
Used for quickly equipping players with pre-defined items.

For Avatars:
This version is designed to equip different avatars with different inventories.
Useful at the start of adventure/rpg worlds where the players can choose a character.



The Script

This scriptwork can be replicated into your Creative world.

Spoiler for Script:
Inventory/Preset/Avatars
-Run when scriptblock is powered On

Code: [Select]
1. Inventory [player] [clear]
2.
3. If
4.   IsAvatar [boy] [true]
5. Then
6.   Inventory [player] [add] [pizza]
7.   Inventory [player] [add] [stick]
8. Endif
9.
10. // To add more character support: Copy & paste lines 3-8, then edit the avatar & item names.
11. // Example:
12.
13. If
14.   IsAvatar [girl] [true]
15. Then
16.   Inventory [player] [add] [itemshop]
17.   Inventory [player] [add] [goldpieces] [1000]
18. Endif

The script clears the players inventory first so it doesn't matter how many times they mash the button. But because it clears their inventory before restocking, it is recommended to use this script only at the start of the world; Otherwise players will lose their inventory.
If you want to give particular avatars a set of items without having to clear their inventory, either include a history mark in the script to query, or use iChest's
.

Suggestions:
-Add waypoints to direct the different characters to the place they should start their quest.
-Add a History mark so other scripts can query which character the player originally chose, and whether or not they are currently using it.



For Admins:
Make some quickly accessible scripts for admins to run, so they can quickly equip themselves with set inventories.

Spoiler for Admin scripts:
1/Battle
-Saved script. Run by admin.
Code: [Select]
1. Inventory [player] [clear]
2. Inventory [player] [add] [titaniumsword]
3. Inventory [player] [add] [titaniumshield]
4. Inventory [player] [add] [titaniumarrow]
5. Inventory [player] [add] [elvenbow]
6. Inventory [player] [add] [fish] [100]

1/Build
-Saved script. Run by admin.
Code: [Select]
1. Inventory [player] [clear]
2. Inventory [player] [add] [sledgehammer]
3. Inventory [player] [add] [marker]

Edit & add to suit.