So after finally getting back to this, I have finished (most of) the usables functions. All that’s left is UI for quickslots but that will be completed when skills/abilities are finished. For right now, the usables are activated through the inventory. I think the quickslot(s) will be for health potions only. Not sure yet.
First off, you’ll see that I updated the drop slider. It now works along the entirety of the slider. Also, the ‘X’ and the check mark are images instead of characters.
Each usable will create its own effect on the character who used it. Starting at about 1:15 you can see some of the usables. These are very modular functions. The health, mana, and stamina use the same code with variation based on the actual effect. Note that these are effects over time, not instant effects. Each effect’s visual particle will also be colored to differentiate it from other usable effects. Health, for example, is red. Mana is blue, stamina is greenish yellow, and experience (not shown for a later mentioned reason) is cyan. Hybrid consumables (water = health & stamina, hybrid potion = health & mana) will have a color for each effect. This is shown in the video. One thing I made sure to do was to check if a usable is activated before spawning the particle. This would prevent any knucklehead from trying to spawn millions of particle systems by using infinite health potions at once. Only one particle system for each effect can be active however many of the same effect can be active at once. Basically, if 10 health potions are used, 500 (10 x amount healed) hp will be healed back but only one red particle system is spawned.
Also, the experience usable will be done later. It works right now on the usable side but the experience/leveling code will be done later with the quests and combat.
Not featured in this video is the cooldown for usables. This is only active in combat. When in combat, a cooldown is applied to usables to prevent a player from spamming health potions over and over. A small dialogue pops up when the player attempts to use an item when usables are on cooldown. Super exciting stuff.