dylbill Posted April 22, 2022 Share Posted April 22, 2022 What specifically are you using this for if I may ask? There may be another way to achieve what you need. As far as getting forms, what I've done is using GetFormFromFile() as Sphered suggests, with the papyrus extender stringToInt function. For your example you would do: Form akForm = GetFormFromFile(PO3_SKSEFunctions.StringToInt(0x0009CD), "Modname.esp"). Although forms that start with FF are usually objectreferences created in game at runtime, so it might not work for that. Link to comment Share on other sites More sharing options...
dizietemblesssma Posted April 24, 2022 Author Share Posted April 24, 2022 I'm doing a new playthrough with LOTD and on a multiple occasions I've had issues with being unable to activate objects to pick them up into my inventory. I had to resort to writing a spell that used AddItem() that I gave myself ingame and got the item that way. I figured I'd write a tiny mod that would allow me to input the object id and this would happen without the need to write a spell. However, the only input I can find for use in MCM is SkyUILib, which returns a string. So whereas in my little spells the script would have a line:player.additem(ff0009cd,1) and 'ff0009cd' works, I cannot take the string ff0009cd and insert it into a line using Additem(), the StringToInt() function has been confirmed by PO3 as not working for stings that result in going beyond signed integers.It's no big deal, I can go on writing spells if I get stuck again with a non-activatable object. diziet Link to comment Share on other sites More sharing options...
dylbill Posted April 25, 2022 Share Posted April 25, 2022 Can you still see the objects in game? If so I can think of a simpler solution. You can use in your spell: Game.GetPlayer().AddItem(Game.GetCurrentCrosshairRef()) ;requires SKSE. Or if that doesn't work you can just use the console to do Player.AddItem(FormID). Link to comment Share on other sites More sharing options...
dizietemblesssma Posted April 25, 2022 Author Share Posted April 25, 2022 I've read that Player.AddItem(FormID) doesn't work for Objectreferences in the console, only baseobjects? The crosshair idea may be the way to go, though it wouldn't have helped when I had the Nelacar's Staff of Arcane Authority bug, soon as the staff was visible, my game froze:) That was why I wrote the first spell! But, as I write it has just occurred to me, I've also read that Bethesda didn't put anything into the game whose objectreferenceID was over 0x7FFFFFFF, which means I could have two methods, once for crosshair and one for things like the staff. The whole point is that this would be a tool for emergencies, I would still have to do some legwork on researching the ids of things ike the staff.I shall try the crosshair route and also test the lower value integers with StringToInt. diziet Link to comment Share on other sites More sharing options...
dylbill Posted April 26, 2022 Share Posted April 26, 2022 Ah, I just tested and you're right, using AddItem for objectreferences in the console doesn't work. Instead, you can still click on the item in the console, then use consoleUtil in your spell like so: game.GetPlayer().AddItem(ConsoleUtil.GetSelectedReference()) Link to comment Share on other sites More sharing options...
dizietemblesssma Posted April 26, 2022 Author Share Posted April 26, 2022 Ah, that's a useful thing that consoleutil provides, I didn't know about that, thankyou:) diziet Link to comment Share on other sites More sharing options...
dylbill Posted April 26, 2022 Share Posted April 26, 2022 No problem. Link to comment Share on other sites More sharing options...
PeterMartyr Posted April 27, 2022 Share Posted April 27, 2022 ;Converts string to int. Returns -1 for out of bound values. int Function StringToInt(String asString) global native dude let not call it an int but an DecimalInteger, do see where it all going wrong? Your try to get hexadecimal out of a function that returns a DecimalInteger. That is out scope for the function your using. Link to comment Share on other sites More sharing options...
PeterMartyr Posted April 27, 2022 Share Posted April 27, 2022 Make your own it not hard, string to hexadecimal Link to comment Share on other sites More sharing options...
PeterMartyr Posted April 27, 2022 Share Posted April 27, 2022 there also BinaryInteger but that does not get used in skyrim Papyrus Edit Just had a thought, if Papyrus does not accept a Hexadecimal as a Primitive? This is never going to work, since it easy to enter a hard coded Hexadecimal, on a GetForm Function. However you need it as a variable Primitive return from a string using a function. Hopefully you will find a framework that does it for you. Link to comment Share on other sites More sharing options...
Recommended Posts