Jump to content
LongDukDong

Scripting means to 'load item from mod' and place it straight onto a bookshelf??

Recommended Posts

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
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
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
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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...