[Papyrus] newb question about properties initialization

Post » Wed Jan 13, 2016 7:16 pm

When a property is declared, how is it initialized? Specifically for reference types, a lot of times I'll see a script has something like:



Keyword Property SomeThingHere auto


RefCollectionAlias Property SomeDudesHere auto mandatory



and then later in a function it's just used, and I can't find where it's initially set.



SomeDudesHere.GetCount() ; why is this not a null reference?

User avatar
~Sylvia~
 
Posts: 3474
Joined: Thu Dec 28, 2006 5:19 am

Post » Thu Jan 14, 2016 2:05 am

They're supposed to be initialised in the Creation Kit. When the script is attached to an object (and so an instance of the script created) that instance of the script can have values set on it's properties via fields associated with the object reference in the CK.



I presume that for Fallout 4 people are setting up those property initial values using FO4Edit, by creating/modifying appropriate records.

User avatar
REVLUTIN
 
Posts: 3498
Joined: Tue Dec 26, 2006 8:44 pm

Post » Thu Jan 14, 2016 8:38 am


Ah, so the engine automatically matches record values to script properties by name? Many things suddenly make sense. Thank you.

User avatar
Josh Dagreat
 
Posts: 3438
Joined: Fri Oct 19, 2007 3:07 am

Post » Thu Jan 14, 2016 7:22 am

Well, I've never looked to see how the engine sorts the association out. For all I know the CK associates the values with the script instance properties by memory offset from reference address :)



But if in FO4Edit it looks like it's by name, then I guess you're right :D



Rather inefficient way of doing it though, I'd have thought :shrug:

User avatar
carley moss
 
Posts: 3331
Joined: Tue Jun 20, 2006 5:05 pm

Post » Thu Jan 14, 2016 3:10 am

No, script properties are set manually and stored in records in VMAD subrecord.

User avatar
Rachel Eloise Getoutofmyface
 
Posts: 3445
Joined: Mon Oct 09, 2006 5:20 pm

Post » Wed Jan 13, 2016 5:59 pm


Gotcha. I see it, now, all the matching names are VMAD.Script.Property entries.

User avatar
Albert Wesker
 
Posts: 3499
Joined: Fri May 11, 2007 11:17 pm

Post » Wed Jan 13, 2016 5:08 pm

xEdit still doesn't allow you much freedom to modify the VMAD subrecord, so if you need a VMAD subrecord with some number of properties to work with a script you've written, you have to use the wbCopyElementToFile and wbCopyElementToRecord functions to copy a VMAD subrecord from another record to the record you're working on. What I did was write that xEdit script in addition to writing another script that outputs the metadata for each VMAD subrecord in the ESM, so if I need a VMAD subrecord that has 1 script and 23 properties, I can just search my spreadsheet for the Form ID and then use that Form ID to copy the VMAD subrecord to my working record.

User avatar
Dustin Brown
 
Posts: 3307
Joined: Sun Sep 30, 2007 6:55 am

Post » Wed Jan 13, 2016 10:27 pm


Oh, is this you?



https://github.com/fireundubh/xedit-scripts



Can I convince you to post those scripts to that repo? I haven't gotten that far, yet, but that's ultimately where I'm trying to go. Seeing if I can sneak a custom script into the game before the CK drops, because that seems fun.

User avatar
Liv Brown
 
Posts: 3358
Joined: Wed Jan 31, 2007 11:44 pm

Post » Wed Jan 13, 2016 7:44 pm


Posted to the all folder. Instructions in the main readme.

User avatar
Enny Labinjo
 
Posts: 3480
Joined: Tue Aug 01, 2006 3:04 pm

Post » Wed Jan 13, 2016 5:07 pm


Thanks! Grabbed it and the dubhFunctions.pas dependency. I haven't touched Pascal since, uh, 1994. Maybe time to refresh.

User avatar
luke trodden
 
Posts: 3445
Joined: Sun Jun 24, 2007 12:48 am

Post » Thu Jan 14, 2016 2:23 am


You need mteFunctions, too, but you might already have that.

User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am

Post » Thu Jan 14, 2016 9:22 am


Got it, thanks.



Is there a secret place all of you guys hang out to talk about scripting, xEdit, best practices, and etc...? I want to learn the secret handshake. Never modded TES games, before, so I'm basically learning by reverse-engineering stuff, but I feel like there's a decade of knowledge I'm missing.

User avatar
El Khatiri
 
Posts: 3568
Joined: Sat Sep 01, 2007 2:43 am

Post » Thu Jan 14, 2016 7:21 am


I learned Delphi through trial and error with some assistance from Zilav.



I learned xEdit mostly from http://www.creationkit.com/TES5Edit_Scripting_Functions and, recently, from helping Zilav, hlp, and Sharlikran decode the FO4 plugin format.



Zilav, Mator, and I have written a ton of xEdit scripts, so you can put them all in one place and use https://www.mythicsoft.com/agentransack to search through them for examples of how things work.



The only "secret place" I frequent is Gibbed's IRC channel where I'm the only one who uses Delphi.

User avatar
adam holden
 
Posts: 3339
Joined: Tue Jun 19, 2007 9:34 pm

Post » Thu Jan 14, 2016 8:04 am

So that's why Delphi is top 12 language right now and will soon return into top 10, keep it up B)


http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

User avatar
Euan
 
Posts: 3376
Joined: Mon May 14, 2007 3:34 pm


Return to Fallout 4