HyFlask
Hyflask adds a new potion to the game that is not consumed upon use. Instead, it operates on a charge system that can be
replenished by sleeping through the night. By collecting scrolls dropped from slain monsters, you can upgrade your
potion to hold more charges or grant different effects when consumed.
Always open to critique or ideas!
Obtaining Your Flask
Currently, the flask can be crafted at the Alchemy Workbench.
Usage
You can use the flask like any other potion. However, instead of consuming the potion itself, you consume a charge bound
to your player. This means you cannot have multiple flasks or use another player's flask to gain additional uses. To
replenish your charges, you must sleep through the night.
Effects
The flask starts with the lesser health potion effect, but you can learn new effects by using effect scrolls. Use a
scroll to learn a new effect, which can then be equipped at the Flask Cauldron. The Flask Cauldron is crafted at the
Workbench.
Currently, only effects that already exist in the game as potions are available.
Ideas for future updates
- [ ] Adding unique effects
- [ ] The ability to mix effects. Instead of having only one effect active at a time, you could choose multiple
effects. To balance this, every effect has a cost and the flask has a maximum capacity. With new scrolls or other
means, the player can increase the maximum capacity, allowing more or more costly effects to be active. - [ ] Improve visuals of the effects, scrolls and flask
- [ ] If possible, change the model of the flask to display the rough number of charges left (Full, Half, Empty)
- [ ] HUD for the potion when held in hand, displaying the current effect and the number of charges left
Commands
The root command is hyflask. Explanation of the available subcommands can be found in Hytale with the command ui or using --help.
Credits
- Flask Model was done by my friend Haruka
Required Plugins
Modding
You can add your own effects to the game if you are familiar with modding the game through assets.
Config
After your started your world while the plugin is active, it will create a config file in the mod folder. Whenever a player uses a flask, flask cauldron or any of the commands for the first time, it will use the config information to set the learned effects and currently active effect. By default the player will only get the Heal Lesser effect.
{
"StartingEffect": "FlaskEffect_Heal_Lesser",
"StartingAvailableEffects": [
"FlaskEffect_Heal_Lesser"
]
}
Interactions
Here is a list of all the interactions added by Hyflask.
ModifyChargesInteraction
Allows the modification relating to the number of charges the player currently has or their maximum amount.
| Field | Description |
|---|---|
| CurrentCharges | Given number will be added to the current amount of charges the player has. Negative numbers will result in removing charges from the player. Can't go below 0 or above the maximum number of charges by default. |
| MaxCharges | Given number will be added to the maximum amount of charges the player has. Negative numbers will result in removing charges from the player. Can't go below 0. |
| ExceededMaxCharges | Boolesch value that if set to true, will allow to modify the current amount of charges above the maximum of the player. |
| ChargesShouldReplenish | Boolesch value that if set to true, will set the current amount of charges back to the maximum, after all changes were done. |
| Next | This will happen as the next step. |
| Failed | There is no fail-state, so this won't happen. |
Examples
{
"Type": "HyFlask_ModifyCharges",
"CurrentCharges": 1,
"MaxCharges": 1
}
LearnEffectInteraction & ForgetEffectInteraction
With this you can add or remove an effect from the list of available effects that the player can choose from at the
Flask Cauldron.
| Field | Description |
|---|---|
| EffectItem | Item-ID of the effect that should be learned of be forgotten. What is an Effect-Item? |
| Next | This will happen when the effect was successfully learned or fogotten |
| Failed | This will happen when the effect couldn't be learned, because they already know the effect, or can't forget it, because they didn't have it. |
Examples
{
"Type": "HyFlask_LearnEffect",
"EffectItem": "FlaskEffect_Heal_Greater"
}
HasChargeInteraction
This is a simple interaction that checks if the player has at least one charge left and will then execute Next or
Failed.
| Field | Description |
|---|---|
| Next | This will happen when the player has at least one charge left. |
| Failed | This will happen when they player has zero charges left. |
ConsumeChargeInteraction
This will consume one charge from the player and notifies them, how many charges they have left.
| Field | Description |
|---|---|
| Next | This will happen as the next step. |
| Failed | There is no fail-state, so this won't happen. |
ApplyEffectInteraction
This is the interaction that will fetch the current selected effect from the player, fetches the effect item,
clones the secondary interaction and executes it.
| Field | Description |
|---|---|
| Next | This will happen when the effect was found and will be executed. |
| Failed | This will happen when the item couldn't be found or was configured incorrectly. |
Effect-Item
All effects are defined as asset items and contain the effect that should be executed when the player successfully
consumes the flask. Doing that, we can easily add new effects to the game, including a name,
description, icon, model and the to be executed effect. You can define what should happen when the player consumes the
effect by adding an interaction to the item. It has to be a secondary interaction, otherwise it won't be executed!
Example
This is the example of the lesser healing effect, which has the exact same interaction as the lesser healing potion,
after all the condition checks. The model of the item shouldn't be relevant, because the effect is not an item planned
to be acquired in the game. But the name, description and icon are important, because that is what the player will see
in the Flask Cauldron.
{
"TranslationProperties": {
"Name": "server.items.FlaskEffect_Heal_Lesser.name",
"Description": "server.items.Potion_Health_Lesser.description"
},
"Quality": "Common",
"ItemLevel": 10,
"Categories": [
"Effects"
],
"Icon": "Icons/Items/FlaskEffect_Heal_Lesser.png",
"IconProperties": {
"Scale": 0.6,
"Rotation": [
22.5,
150,
22.5
],
"Translation": [
-9,
-12
]
},
"PlayerAnimationsId": "Block",
"Model": "Items/Consumables/Scrolls/EffectScroll.blockymodel",
"Texture": "Items/Consumables/Scrolls/EffectScroll_Textures/Heal_Lesser.png",
"Interactions": {
"Secondary": {
"Interactions": [
{
"Type": "EffectCondition",
"EntityEffectIds": [
"Potion_Health_Greater_Regen"
],
"Match": "None",
"Next": {
"Type": "Serial",
"Interactions": [
{
"Type": "ApplyEffect",
"EffectId": "Potion_Health_Instant_Lesser"
},
{
"Type": "ApplyEffect",
"EffectId": "Potion_Health_Lesser_Regen"
}
]
},
"Failed": {
"Type": "Simple"
}
}
]
}
},
"Utility": {
"Compatible": false
},
"Consumable": false,
"Tags": {
"Type": [
"Effect"
]
},
"MaxStack": 1,
"DropOnDeath": true
}

