Retrieve the UIName of an entity that doesn't exist
Posted: Sat Jul 04, 2015 9:00 am
hello there.
I am puzzled, because, for my crafting script, I am trying, for the info panel, to show the UIName of an object .
this is part of the code below:
my recipes are stored in a table (Item).
calling Item.comp1 returns me a string storing the name of the needed component.
I tried to get the UIName from this string, but has this object is not created yet, I can't call a findEntity, for example.
I tried all matters of
component1.go.item:getUiName(), with all variations on this subject, to no avail.
I think the problem is that the game doesn't identify this string as the name of an object.
Any ideas please ?
I am puzzled, because, for my crafting script, I am trying, for the info panel, to show the UIName of an object .
this is part of the code below:
Code: Select all
local component1 = Item.comp1
local componentNumber1 = Item.compnum1
local component2 = Item.comp2
local componentNumber2 = Item.compnum2
local component3 = Item.comp3
local componentNumber3 = Item.compnum3
local skillLevel = cromlibrary.script.checkSkillLevel(craftrequired)
local skillLevelName = cromskills.script.translateLevel(skillLevel)
local itemcraftingexpertise = ""
local bonus = 0
local itemKnowledgeVar = itemtocraft.."_craftXP"
if cromvar.script.getVar(itemKnowledgeVar) == nil then
cromvar.script.setVar(itemKnowledgeVar,0)
--print(itemKnowledgeVar)
else
bonus,itemcraftingexpertise = returnCraftingExpertise(itemtocraft)
end
local craftingSummaryText = "Craft a "..itemName..";Difficulty = "..difficulty..";Skill level= ".. skillLevelName .. " ".."Item Knowledge= "..itemcraftingexpertise.."; Major Attribute= "..majorAttribute..";Minor Attribute= "..minorAttribute.." ".."Need: "..componentNumber1.." ".. component1calling Item.comp1 returns me a string storing the name of the needed component.
I tried to get the UIName from this string, but has this object is not created yet, I can't call a findEntity, for example.
I tried all matters of
component1.go.item:getUiName(), with all variations on this subject, to no avail.
I think the problem is that the game doesn't identify this string as the name of an object.
Any ideas please ?