LongDukDong Posted February 21 Share Posted February 21 This is a fun puzzle, and not sure if it is fully possible..... There is the ever popular command known as GetFormFromMod which I use quite often for many a features. And one can place contents from such calls into containers, be they chests or NPCs themselves. However, these items do not physically appear within the game until taken out of said container. What I want is to be able to acquire the form (as in above), and be able to place the form (or reference thereof) on a shelf. For example, if I was to make a Tamago-based mod and the player had installed and activated a copy of my TamagoGuide.esp in their game, I would like said mod detect the book and visually place it on a bookshelf as I so prescribe. This, only working if TamagoGuide is detected, and the mod not hampered if it were not. Link to post
Akor Posted February 22 Share Posted February 22 20 hours ago, LongDukDong said: There is the ever popular command known as GetFormFromMod which I use quite often for many a features. And one can place contents from such calls into containers, be they chests or NPCs themselves. However, these items do not physically appear within the game until taken out of said container. What I want is to be able to acquire the form (as in above), and be able to place the form (or reference thereof) on a shelf. You can spawn objects in the world with PlaceAtMe and then position them with SetPos. Link to post
LongDukDong Posted February 23 Author Share Posted February 23 On 2/22/2021 at 2:23 PM, Akor said: You can spawn objects in the world with PlaceAtMe and then position them with SetPos. I attempted to use PlaceAtMe as you suggested, but with no joy. PlaceAtMe appears to only accept the creation and placement of items from the actual Database list and not to reference objects such as loaded objects which is the actual intent. I can grab the "BlankSheet" item from the Books database. But if I tried to use a reference object that is drawn on a map, it will not work. And with that, neither will a reference object loaded using the GetFormFromMod command. EXAMPLES: PlaceAtMe Book4RareSpiritoftheDaedra, 1, 256, 1 ( This is just fine. But the item is from the database ) let MyBook := GetFormFromMod "LoversPrimaBooks2.esp" "002A2A" ;; Lady Sauria PlacaAtMe MyBook, 1, 256, 1 ( Error Message: Item 'MyBook' not found for parameter ObjectID Compiled script not saved ) Thank you for the consideration. Link to post
Akor Posted February 24 Share Posted February 24 6 hours ago, LongDukDong said: let MyBook := GetFormFromMod "LoversPrimaBooks2.esp" "002A2A" ;; Lady Sauria PlacaAtMe MyBook, 1, 256, 1 ( Error Message: Item 'MyBook' not found for parameter ObjectID Compiled script not saved ) Thank you for the consideration. I think the error message you get is because you don't have MyBook defined in the script? I wrote a test script and I can compile it without errors. I haven't tested it in game yet, will do that later I'm currently at work, but I'm pretty sure it should work this way. scn lksCoreGameLoadedKinkyCollarsFunc ref formRef string_var formID ref objRef Begin Function {} let formID := lksKinkyCollarQuest.LoadCollarID PrintC "LKS-DEBUG|lksCoreGameLoadedKinkyCollarsFunc|formID|%z" formID let formRef := GetFormFromMod "LoversKinkyStalker.esp" $formID PrintC "LKS-DEBUG|lksCoreGameLoadedKinkyCollarsFunc|formRef|%n" formRef let objRef := Player.PlaceAtMe formRef, 1, 256, 1 End Link to post
LongDukDong Posted Monday at 08:35 PM Author Share Posted Monday at 08:35 PM Alas, no. And there was a misunderstanding. I certainly had a MyBook reference defined within my code. I merely gave the main content within the funciton block. Let's assume this alteration of your code: let formID := "002A2A" PrintC "LKS-DEBUG|lksCoreGameLoadedKinkyCollarsFunc|formID|%z" formID let formRef := GetFormFromMod "LoversPrimaBooks2.esp" $formID PrintC "LKS-DEBUG|lksCoreGameLoadedKinkyCollarsFunc|formRef|%n" formRef let objRef := Player.PlaceAtMe formRef, 1, 64, 1 And lets assume this change is meant to grant me access to one of the books in my Prima Book mods, "Lady Sauria" that describes Ocheeva's rise within the Dark Brotherhood thanks to a secret weapon. Yes, I do receive the message: "LKS-DEBUG|lksCoreGameLoadedKinkyCollarsFunc|formID|7C002A2A" And yes, I do receive the message: "LKS-DEBUG|lksCoreGameLoadedKinkyCollarsFunc|formRef|Lady Sauria" So both debug messages do recognize my string and refernce objects. However, the book does not appear. And at the time, I am in the expansive foyer of Castle Chorrol. I have also tried the variants of: let objRef := PlaceAtMe formRef, 1, 64, 1 and PlaceAtMe formRef, 1, 64, 1 Both to no avail. Again, my belief is that PlaceAtMe only functions properly with objects from the current database (the database for the mod itself) and not loaded objects. So while I could use PlaceAtMe within the PrimaBook2 mod to move Lady Sauria around, or have a mod that had PrimaBook2 as a dependent, it appears non-functional here. Link to post