ScreamMyName 100 Posted May 29, 2016 Share Posted May 29, 2016 Hi. Does anyone know how to get an item vnum via python? Is there any function? I had a look through source but couldn't find one. I want to get and display item vnum when I hoover over an item in my inventory. Link to comment Share on other sites More sharing options...
Developer PACI 927 Posted May 29, 2016 Developer Share Posted May 29, 2016 player.GetItemIndex(slotPos) However, the uiToolTip.ItemToolTip.AddItemData() already receives an item vnum, so you must only print it. 1 when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
ScreamMyName 100 Posted May 29, 2016 Author Share Posted May 29, 2016 3 minutes ago, PACI said: player.GetItemIndex(slotPos) However, the uiToolTip.ItemToolTip.AddItemData() already receives an item vnum, so you must only print it. I already tried vnum = player.GetItemIndex(slotPos) self.AppendTextLine(vnum, self.POSITIVE_COLOR) but it don't work for some reason. Link to comment Share on other sites More sharing options...
Developer PACI 927 Posted May 29, 2016 Developer Share Posted May 29, 2016 Just use the function I said, and should work properly. 1 when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
ScreamMyName 100 Posted May 29, 2016 Author Share Posted May 29, 2016 10 minutes ago, PACI said: Just use the function I said, and should work properly. How? I'm not very good at python. I've added Self.AppendTextLine(vnum) to AddItemData but it don't work Link to comment Share on other sites More sharing options...
Developer PACI 927 Posted May 29, 2016 Developer Share Posted May 29, 2016 Try it like that: self.AppendTextLine("[%d]" % itemVnum) 1 when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
ScreamMyName 100 Posted May 29, 2016 Author Share Posted May 29, 2016 7 minutes ago, PACI said: Try it like that: self.AppendTextLine("[%d]" % str(itemVnum)) self.AppendTextLine("[%d]" % (itemVnum)) Works! Thank you. 1 Link to comment Share on other sites More sharing options...
Developer PACI 927 Posted May 29, 2016 Developer Share Posted May 29, 2016 Yeah I wrote it wrong, then I saw the error, and edited my post, but glad that you did what you wanted 1 when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now