- Joined
- Apr 26, 2020
- Messages
- 62
Came up wit a neat Backpack system while ago. Since I saw it is a very asked system so I'm postin' it here. 
My handy simple Backpack Inventory! Just in one pocket-size trigger using de backpack unit and its custom value.
Introduction
Most rpgs need extra storage space for them' player to collect items. Backpack system provides additional carry-along item storage for da Adventurer. On your journey u would open Backpack to grab/drop some items and put it back to move on. Our's is safe and light and shouldn't mess wit your smooth gameplay. Easily compatible.
- Backpack Unit
You'll need an invulnerable Backpack Unit created wit Inventory and Perma Invisibility abilities. Set the classifications of unit to "Worker, Ward"
Recommended: Hide minimap-display, Remove shadow image, Set all movement values to (0), Set maximum pitch and roll angle to (0.00) and change the unit model and icon as desired. (e.g. Item Chest model)
Now place the Backpack Units under your Player- Start Location somewhere in the map. Cause we can not use variables for selection event we gonna use preset units. Also remember to change the map's "Advanced> Game Interface> Icon- Idel Worker" to desired icon.
- Backpack Trigger
Note: Multiple events doesn't mean they should be cast all at once. It triggers whether any of the events fires.
Custom Value (0) marks the backpack as currently out and closed.
- ya should have set your backpacks to a Unit Group variable in Map Initialization:
Also deselects tha Backpack automatically.
- How it works
By clickin' on the Backpack Inventory (aka Idle Worker) icon, de Backpack will be transfered to the location of your hero, infront of his feet. Then you can exchange items and when finished just run away and backpack will be moved back to your Player- Start Location.
The Full Trigger:
For saving/loading form map to map just store all de Backpacks in tha Gama Cache one by one. Then load dem like this:
* Set any of preseted backpacks' (not to be confused wit restored backpacks) owner to either Player's ownership for havin' access to them from de beginnin' or to "Neutral Passive" and then while loading, check if a upgrade is done by player, then set their owner back to Player.
-- Hope this works properly! If ya know better systems link dem below so we all can use'em.
Note: If u know 'bout Unit Indexer systems, they would interfere wit dis, if used any.
Edit: attached a map wit da code for eazy test and use.

My handy simple Backpack Inventory! Just in one pocket-size trigger using de backpack unit and its custom value.
Introduction
Most rpgs need extra storage space for them' player to collect items. Backpack system provides additional carry-along item storage for da Adventurer. On your journey u would open Backpack to grab/drop some items and put it back to move on. Our's is safe and light and shouldn't mess wit your smooth gameplay. Easily compatible.
- Backpack Unit
You'll need an invulnerable Backpack Unit created wit Inventory and Perma Invisibility abilities. Set the classifications of unit to "Worker, Ward"
Recommended: Hide minimap-display, Remove shadow image, Set all movement values to (0), Set maximum pitch and roll angle to (0.00) and change the unit model and icon as desired. (e.g. Item Chest model)
Now place the Backpack Units under your Player- Start Location somewhere in the map. Cause we can not use variables for selection event we gonna use preset units. Also remember to change the map's "Advanced> Game Interface> Icon- Idel Worker" to desired icon.
- Backpack Trigger
-
Events
-
Unit - Backpack 0001 <gen> Is selected
-
Unit - Backpack 0002 <gen> Is selected
-
Unit - Backpack 0003 <gen> Is selected
-
Unit - Backpack 0004 <gen> Is selected
-
Note: Multiple events doesn't mean they should be cast all at once. It triggers whether any of the events fires.
-
Conditions
-
(Custom value of (Triggering unit)) Equal to 0
-
Custom Value (0) marks the backpack as currently out and closed.
-
Actions
-
Unit - Order Hero to Hold Position
-
Unit Group - Pick every unit in Backpacks and do (Unit - Move (Picked unit) instantly to (Player 3 (Teal) start location))
-
Unit Group - Pick every unit in Backpacks and do (Unit - Set the custom value of (Picked unit) to 0)
-
- ya should have set your backpacks to a Unit Group variable in Map Initialization:
-
Set Backpacks = (Units owned by Player 3 (Teal) of type Backpack Unit)
-
Unit - Move (Triggering unit) instantly to ((Position of Hero) offset by 100.00 towards (Facing of Hero) degrees), facing ((Facing of Hero) - 180.00) degrees
-
Unit - Set the custom value of (Triggering unit) to 1
-
If ((Triggering unit) Equal to Backpack 0001 <gen>) then do (Game - Display to Player Group - Player 3 (Teal) for 0.50 seconds the text: |cffffcc00Backpack (1)|r is loaded.) else do (Do nothing)
-
If ((Triggering unit) Equal to Backpack 0002 <gen>) then do (Game - Display to Player Group - Player 3 (Teal) for 0.50 seconds the text: |cffffcc00Backpack (2)|r is loaded.) else do (Do nothing)
-
If ((Triggering unit) Equal to Backpack 0003 <gen>) then do (Game - Display to Player Group - Player 3 (Teal) for 0.50 seconds the text: |cffffcc00Backpack (3)|r is loaded.) else do (Do nothing)
-
If ((Triggering unit) Equal to Backpack 0004 <gen>) then do (Game - Display to Player Group - Player 3 (Teal) for 0.50 seconds the text: |cffffcc00Backpack (4)|r is loaded.) else do (Do nothing)
-
Wait until ((Current order of Hero) Not equal to (Order(hold position))), checking every 0.75 seconds
-
Unit - Move (Triggering unit) instantly to (Player 3 (Teal) start location)
-
Unit - Set the custom value of (Triggering unit) to 0
-
Selection - Remove (Triggering unit) from selection
Also deselects tha Backpack automatically.
- How it works
By clickin' on the Backpack Inventory (aka Idle Worker) icon, de Backpack will be transfered to the location of your hero, infront of his feet. Then you can exchange items and when finished just run away and backpack will be moved back to your Player- Start Location.
- If ya mon wanted to for example open Backpack (3) you should click the icon 3-times repeatly. Waitin' long between repeats will open up the Backpack (1) again.
- Instead of clickin' on icon you can use the Idel Worker hotkey which I believe it is (~) or (F8) too.
The Full Trigger:
-
Backpack Inventory
-
Events
-
Unit - Backpack 0001 <gen> Is selected
-
Unit - Backpack 0002 <gen> Is selected
-
Unit - Backpack 0003 <gen> Is selected
-
Unit - Backpack 0004 <gen> Is selected
-
-
Conditions
-
(Custom value of (Triggering unit)) Equal to 0
-
-
Actions
-
Unit - Order Hero to Hold Position
-
Unit Group - Pick every unit in Backpacks and do (Unit - Move (Picked unit) instantly to (Player 3 (Teal) start location))
-
Unit Group - Pick every unit in Backpacks and do (Unit - Set the custom value of (Picked unit) to 0)
-
Unit - Move (Triggering unit) instantly to ((Position of Hero) offset by 100.00 towards (Facing of Hero) degrees), facing ((Facing of Hero) - 180.00) degrees
-
Unit - Set the custom value of (Triggering unit) to 1
-
If ((Triggering unit) Equal to Backpack 0001 <gen>) then do (Game - Display to Player Group - Player 3 (Teal) for 0.50 seconds the text: |cffffcc00Backpack (1)|r is loaded.) else do (Do nothing)
-
If ((Triggering unit) Equal to Backpack 0002 <gen>) then do (Game - Display to Player Group - Player 3 (Teal) for 0.50 seconds the text: |cffffcc00Backpack (2)|r is loaded.) else do (Do nothing)
-
If ((Triggering unit) Equal to Backpack 0003 <gen>) then do (Game - Display to Player Group - Player 3 (Teal) for 0.50 seconds the text: |cffffcc00Backpack (3)|r is loaded.) else do (Do nothing)
-
If ((Triggering unit) Equal to Backpack 0004 <gen>) then do (Game - Display to Player Group - Player 3 (Teal) for 0.50 seconds the text: |cffffcc00Backpack (4)|r is loaded.) else do (Do nothing)
-
Wait until ((Current order of Hero) Not equal to (Order(hold position))), checking every 0.75 seconds
-
Unit - Move (Triggering unit) instantly to (Player 3 (Teal) start location)
-
Unit - Set the custom value of (Triggering unit) to 0
-
Selection - Remove (Triggering unit) from selection
-
-
For saving/loading form map to map just store all de Backpacks in tha Gama Cache one by one. Then load dem like this:
-
Actions
-
-------- Restore Backpacks --------
-
Game Cache - Restore Backpack[1] of Character from GameCache[0] for Neutral Passive at (Player 3 (Teal) start location) facing 0.00
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
-
Hero - Give (Item carried by (Last restored unit) in slot (Integer A)) to Backpack 0001 <gen>
-
If ((Integer A) Equal to 6) then do (Unit - Remove (Last restored unit) from the game) else do (Do nothing)
-
-
-
Game Cache - Restore Backpack[2] of Character from GameCache[0] for Neutral Passive at (Player 3 (Teal) start location) facing 0.00
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
-
Hero - Give (Item carried by (Last restored unit) in slot (Integer A)) to Backpack 0002 <gen>
-
If ((Integer A) Equal to 6) then do (Unit - Remove (Last restored unit) from the game) else do (Do nothing)
-
-
-
Game Cache - Restore Backpack[3] of Character from GameCache[0] for Neutral Passive at (Player 3 (Teal) start location) facing 0.00
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
-
Hero - Give (Item carried by (Last restored unit) in slot (Integer A)) to Backpack 0003 <gen>
-
If ((Integer A) Equal to 6) then do (Unit - Remove (Last restored unit) from the game) else do (Do nothing)
-
-
-
Game Cache - Restore Backpack[4] of Character from GameCache[0] for Neutral Passive at (Player 3 (Teal) start location) facing 0.00
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
-
Hero - Give (Item carried by (Last restored unit) in slot (Integer A)) to Backpack 0004 <gen>
-
If ((Integer A) Equal to 6) then do (Unit - Remove (Last restored unit) from the game) else do (Do nothing)
-
-
-
-------- * if a custom backpack upgrade is reaserched for player-3 then set owner of backpack0002/0003/0004 to player-3 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Then - Actions
-
Else - Actions
-
-
* Set any of preseted backpacks' (not to be confused wit restored backpacks) owner to either Player's ownership for havin' access to them from de beginnin' or to "Neutral Passive" and then while loading, check if a upgrade is done by player, then set their owner back to Player.
-- Hope this works properly! If ya know better systems link dem below so we all can use'em.
Note: If u know 'bout Unit Indexer systems, they would interfere wit dis, if used any.
Edit: attached a map wit da code for eazy test and use.
Attachments
Last edited: