Jump to content

Autofill property with RefID?


scrivener07

Recommended Posts

By "they don't have a ref name" you mean the editor ID field is empty? If that is the case the easiest would be to go into actors\actor, sort by editor ID, this will cause them all to end up on top, and delete the bunch. Then save, exit, go into tes5edit, and do an 'undelete and disable references'.

 

Not sure if I'm understanding you correctly though.

 

You could also find them with the formID, if your plugin is the only one loaded in CK the should all start with 01000 I think, so sorting by formID in actors\actor would also cause them to come up on top.

Edited by acidzebra
Link to comment
Share on other sites

I forgot about getters :)

 

In situations where you can give a Reference a REF name you can normally make it the same as the editor ID and the property will autofill its self. Take Ralof for example.

Actor property RalofRef auto

This will autofill to the game world reference on the properties window.

 

But what if bethesda didnt give Ralof a REF name and the form only had an ID?

 

actor property	NamelessREF
actor function get()
	actor actorRef = Game.GetForm(0x0002BF9E) as actor
	return actorRef
endFunction
endProperty

event oninit()
NamelessREF.disable()
endevent


This is the work around. :psyduck: Seems like it might cause extra overhead but it sure beats my personal overhead of keep track of these nameless refs as my scripts get moved around at this point.

Link to comment
Share on other sites

The creation kit wiki gives this warning for game.getform: Scripts should always be blind to the contents of data files, and rely on properties as the interface through which they access data from data files. As such, this function should only ever be used for debugging purposes.

Maybe getformfromfile? (blithely ignoring the advice just given :thumbsup:)

 

http://www.creationk...FromFile_-_Game

The ID for a form changes based on the load order of the file it loaded from. So a form which shows up as 0101ABCD in the editor may show up as 0401ABCD in game depending on how many other files load before it. This function lets you blindly grab a form based on the lower bytes of its ID and the expected file which created the form.

 

...which may be the problem you are having.

Edited by acidzebra
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...