GisleAune Posted February 14, 2012 Share Posted February 14, 2012 (edited) I want to have a scripting challenge where the mechanic I hate isn't hardcoded (like the nonsense potion values), namely the fact that filled soul gems retain their unfilled counterpart's value, doesn't stack and may lose their soul when placed in a or taken out of a container. I am familiar with the basics of Papyrus and am somewhat adept at C++, so I do have some ideas already. Here's my questions. 1. How to get the item type of item added to container? (Idea 1 for testing, checking how I can convert a player-filled soul gem to one found filled)(Edit) How to find out what soul the gem contains, the class SoulGem has no functions, neither does Form or ObjectReference? (Edit 2) Does it have something to do with keywords? 2. Where is the Actor function "bool Function TrapSoul(Actor akTarget) native" defined for the player and followers? Edited February 14, 2012 by GisleAune Link to comment Share on other sites More sharing options...
Cipscis Posted February 14, 2012 Share Posted February 14, 2012 From where are you trying to get the type of an item? So long as you can get a handle on the reference itself, you should be able to use GetBaseObject to find its base object, although I'm not sure how that would work with filled soul gems. I believe those base objects may be generated by the engine in-game, which is probably why they're fundamentally different to filled soul gems that are found. It's possible that they maintain the same base type, and when they change inventory and a copy is made (if I remember correctly, that's how it works) they are restored to their previous state. Native functions don't have a definition in Papyrus - they are handled by the engine itself. Cipscis Link to comment Share on other sites More sharing options...
GisleAune Posted February 14, 2012 Author Share Posted February 14, 2012 Well, that shows how much power they've given us. Can I simply get the name as shown in the inventory for items added and iterate through the entire misc section of the inventory? If so, I could just check for "Petty Soul Gem (Petty)" or whatever they're called exactly and then if value is 10, delete it and add a found soul gem. I could find the base effect for soul trap and add my script when effect ends or something. Link to comment Share on other sites More sharing options...
Cipscis Posted February 14, 2012 Share Posted February 14, 2012 As far as I know there aren't any functions for looking within an inventory unless you know exactly what you're looking for. As with previous games, you'll need to wait for the script extender before you'll be able to iterate through an inventory. Cipscis EDIT: Generally, if it didn't need to be done via script in Skyrim, there won't be a native function for it. Anything involving the internals of inventories would have been handled straight be the engine, so there was never a need for a native Papyrus function to walk through inventory items in a container. Cipscis Link to comment Share on other sites More sharing options...
GisleAune Posted February 14, 2012 Author Share Posted February 14, 2012 (edited) I understand that, but not why Bethesda would make so much nonsense stuff hardcoded. This and the potion pricing makes no sense. But at the very least, can I have a container that would fix the incomming soul gems? Using the OnItemAdded() event. Does the ObjectReference akItemReference contain the title of the item as it's shown in the inventory? Edited February 14, 2012 by GisleAune Link to comment Share on other sites More sharing options...
GisleAune Posted February 14, 2012 Author Share Posted February 14, 2012 (edited) Bump. How can I get the name of a ObjectReference, like the name shown in the inventory? Edit: I know how to get the base id, and a player-filled one has the same ID as the unfilled. Any way to check what soul it contains through a script? Or is that hardcoded too? Edited February 14, 2012 by GisleAune Link to comment Share on other sites More sharing options...
Recommended Posts