inventory

Introduction
Most great games has inventories and loot systems. 
More about diagnosis drawing. http://stencyl-nator.blogspot.com/p/diagnosis-drawing.html

Solution. Engine.engine.getGameAttributre("loot_penels") is a list game Attribute that needs to be cleared when saving the game otherwise the game will crash. This game attribute it is used to communicate between 2 loot and inventory panels with different behaviors. Alternatively, adding actors to behaviors will do which is a longer and more demanding. 

This feature has 4 behaviors involved 
- loot panel
- loot slot
- off-screen inventory panel 
- off-screen inventory slot 

This Stencyl tutoral/information excludes
Utility(on screen inventory) and chests/storages.   

For sub-Inventory panels,   
panel and button creation.  Alternatively, no code has to be used here. 

closing panels. 



Diagnosis drawing (optional for debugging purposes)

Prevents interactions from the objects/actors behind. 

Emptying slot

For the inventory slot,
initialisation

public vars
Advantage: Faster when creating a lot of variables with closely similar names. Access to whatever Stencyl does not provide such as Int.   
Disadvantages: Code required when using it each time. Does not produce blank (behavior page) on its own. 

check detector. Only applies to adding items to the inventory

 Unhover, mouse pointer exits the inventory panel

Drawing showing amount and the item code and some diagnosis data. 

 Killing item display. Yes, Stencyl can reduce the demand of any actors by selecting "cannot move" via physics and remove collision relationships via Settings > Groups. 

Clicking on the slot. Releasing the mouse will have the game attribute = false. 

 releasing. The long part of this mouse release has to do with scene data with unlimited rendering. The unlimited scene rendering http://stencyl-nator.blogspot.com/p/scenes-with-infinite-dimensions.html was overhauled due to save system cannot save data in list[negative int]http://stencyl-nator.blogspot.com/2022/05/saves-cannot-save-data-with-negative-ids.html. This explains the why delay of this topic being released. The only that remained therein is loot_actors for they cannot be saved.  

 arbitary code for custom events for.
Taking items from inventory panel.
Inserting items to inventory panel.

Remodata, removes loot data form the unlimited scene render loot data.

loot panel
public vars. Optionally using Array <String> in first 4 of them. Most of them have to do with unlimited scene renderer.   

Intialisation. 
Script.engine.scene.sceneHeight is a "shortcut" of Get Scene Height snippet
Script.engine.scene.sceneWidth is a "shortcut" of Get Scene Width snippet
Both snippets above can be found in the Scene > World section. 
"Shortcuts" are used to increase performance and efficiency of the game.  


Kills the loot panel if the mouse is clicked outside the panel. 

When an item is from inventory to the loot panel.

interaction control 


Public function refr (). Refreshes the entire panel and its slots. 

The trigger relo()

For the loot slots.
initialisation. lastCreatedActor is a shortcut to get Last Created Actor in both code and design mode. . 
public function getLastCreatedActor():Void
{
   return lastCreatedActor; 
}


  Mouse interaction controls. 


Drawings on selected slot. 

interaction control. 






No comments:

Post a Comment