I'm creating a new crafting system. The idea is you go through a series of menus, selecting what weapon you want to create and what metal to use, etc, and at the end, it spawns the chosen item, adds various properties depending on what material you used, and gives it an appropriate name and description. The material options all have a "text appears when" condition so you only get that option when you have the right materials in your inventory.
This all works as expected.
However, I decided to an some extra options for cosmetic enhancements. E.g. if you have a ruby in your inventory, you can choose to give it a ruby-studded hilt, and the description will contain a line saying "The hilt contains a large <name of gem>".
But this isn't working, in two ways.
Problem 1:
First of all, my scripts for checking that you have the right gem aren't working.
Example:
This was created using the wizard, and is identical to the scripts used for checking if you have (e.g.) an iron bar (apart from the item tag of course). But when I use it as the "text appears when" condition for a PC speech option, that option doesn't appear.
Problem 2:
Secondly, I'm using this code to get the name of the gem to add to the description:
sDesc = sDesc + " The hilt contains a large " + GetName(GetItemPossessedBy(oPC,sGem));
where sDesc is the string I create my descripion from, and sGem is the gem tag.
The final description should end up: "This is a <metal> <weapon> created by <player name>. The hilt contains a large <gem name>. <default description>."
But the gem name gets left blank. I know that sGem is being correctly read, as when I change the code to add that to the description instead, it works. (As does my code to check if you sGem is a light gem, and if so add an the appropriatly coloured light property).
Problem 3:
Not something that doesn't work, rather something I'd like to do if possible but can't see how:
Is it possible to increase the gold value of an item?
(I want to GetGoldPieceValue the gem, and then add that to the value of the item being created).
PS: one final question:
What is the difference between GetItemPossessedBy and HasItem?
Is it just that HasItem is quicker to type?