[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
IceBlinkEngine.com • View topic - Useable Magic Items
Page 1 of 1

Useable Magic Items

PostPosted: Thu Nov 16, 2017 7:30 pm
by Dorateen
I wanted to document the issues I have experienced with the creation of magic items that can be used by characters in combat.

For the example, I made a circlet of blasting that can be activated by the user to fire a mage bolt.

The first issue has to do with trying to use equipped items. In the screenshot below, the character has the circlet equipped on his head slot. But when the player clicks on the item, there is no option to use it, only the box about not being able to equip/unequip during combat. Had it been a weapon or shield item, then clicking would only go to the inventory screen to unequip or swap it, but again no option to use the item.
hearkMIa.jpg
hearkMIa.jpg (220.97 KiB) Viewed 4546 times


Now, it is possible to use the item by keeping it in the party inventory. This means anyone can click on the circlet on their turn, and they will get the option to use the item. The problem here is that sometimes the character can use the item this way, and their turn does not end. Thus they can take another action, or even use the item a second time, before the character's turn ends. In the screenshot below, Greenwood has used the circlet of blasting twice in one turn.
hearkMIb.jpg
hearkMIb.jpg (268.81 KiB) Viewed 4546 times


A third issue has to do with charges that can be assigned to an item's blueprint in the toolset. As shown below, the circlet of blasting has 5 charges. However, working from the inventory, the party was able to keep using the circlet in battle. Everyone on their turn could activate the mage bolt, some even twice in a turn, as noted above. I would say they easily got 10 uses out of the item, despite the property of 5 charges. It seems the only option in the toolset is to destroy an item after one use, like potions. Below is a screenshot of the circlet's blueprint in the toolset.
hearkMIc.jpg
hearkMIc.jpg (127.77 KiB) Viewed 4546 times


At this time, there are some workarounds to make useable magic items. They cannot be equipped (or if they have equipped properties such as resistances, they must be unequipped and back in the party inventory in order to be used). And it would seem best to make an item one use only, being destroyed after activation, if you don't want it to be used indefinitely. It would certainly cause players to consider the right time to expend such a limited use item.

Obviously, this is not the ultimate intention. Wands, rings, staves, etc. ought to have charges to allow multiple uses before disappearing. And it would be nice to make necklaces, or really any kind of item that can be equipped by a character, and give it a useable ability as well. Hopefully this will help illustrate what needs to be functioning so we can have a variety of creative itemization.

Re: Useable Magic Items

PostPosted: Thu Nov 16, 2017 8:05 pm
by youngneil1
That is awesome input and definetly very helpful for debugging (failing to end turn sometimes, no charges consumed) and adding additional functionality (use equipped items). I think we might also add a "useable only when equipped" property while at it.

Re: Useable Magic Items

PostPosted: Fri Nov 17, 2017 7:54 am
by youngneil1
This bug roots deeper than I thought. I will need to do quite a few adjustments for useable items in general... it will take time, but - as always - we will get there :) .

Re: Useable Magic Items

PostPosted: Fri Nov 17, 2017 1:59 pm
by Dorateen
That sounds fine, youngneil1. One thought I had regarding the application of spells used through items: perhaps it has to do with the Spell/Effect section of the item properties. This is where I assigned the mage bolt spell tag in the onUseItemCastSpellTag. That did achieve creating the spell. But note, that potions have their own script such as itRegenSPLight.cs

And that is placed in the onUseItem field of the Scripts properties.

So if we want to design a wand, or whatever, that shoots mage bolts and consumes charges and is treated as an action for a character's turn, perhaps all this needs to be put in a separate script and attached to an item accordingly.

I do like the Spell/Effect system better and hope we can get this method to work, as it is easier to just assign the spell tags to an item's blueprint, no additional coding required.

Re: Useable Magic Items

PostPosted: Sat Nov 18, 2017 9:15 am
by youngneil1
A good observation there. Indeed the code branches differently for spell or script on item use. I agree that we should fully integrate the spell and effect system for the items. Much of this is in already, but there are also quite some omissions so far. E.g. charges are not really used by the code at all (maybe I accidentally deleted/replaced this at some point).

Easiest way for charges is using quantity it seems. This way an item would diretcly display the number of remaining charges/quantity. A difference will be that an item without charges will still exist in inventory (but not be useable anymore), so I have to take that into account.

Re: Useable Magic Items

PostPosted: Sat Nov 18, 2017 4:03 pm
by Dorateen
I wouldn't mind if items get destroyed after using up the last charge, and disappear from the inventory. But allowing 0 charges items to remain does open up the possibilities to re-charge items. Either way is cool.

Re: Useable Magic Items

PostPosted: Mon Nov 20, 2017 9:38 am
by youngneil1
Yes, I was thinking of a recharge script. So, certain specialists like eg the Mage's guild could offer recharging for money or favours.

I am looking into items generally right now and will sort a few properties in the editor, too. Likely I will do a separate tutorial post on item creation in order to make setting them up a bit easier (for myself later on, too).