Jump to content

Weirder (and more insane) Inquiry: Storing/Reading NPC's Form ID ?


Recommended Posts

This inquiry is a two-fold inquiry, one regarding reading/storage, the other its detection prior to message rendering.

 

* === * === * === *

 

Picture if you will... a pregnancy / child system.   Now picture if you will an in-game object to store the form ID of the parents into the child's data (or some hidden container like its Umbilical cord).  But along with the parents, picture if you branch further for the grandparents of the child...  A child could possibly see if it and another child may have the same parent and be siblings, One may notice that they have the same grandparents but not parents, and thus they are cousins....

 

Is there a way to obtain the Hex-Code like Form ID from the reference in a script?  And likewise, any easy way to store it (and alternatively) read it? 

 

* === * === * === *

 

Picture if you will... the message system.   Two characters walking up to one another and the conversation is about to start.  But just before the dialog begins, the game system encounters a new script that looks at the characters and retrieves special 'Heritage' data, and applies suitable flags that may alter the greetings, or altered dialog for other systems.

 

Is there any way to perform a called script that can check the status of the two characters prior to the conversation's start? 

 

* === * === * === *

 

If the second feature cannot be accomplished, the first feature is kinda moot... kinda.

 

 

 

Link to comment

Dialogs: normally everything is checked before dialog starts.

If two characters walking up to one another only enemies can stop the dialog. Or a script that can not start earlier ( A distance check: less than xx to the other NPC)

 

I once testet something (different textures ? ) and I load the same save again and again. The save was made as one NPC turned around to walk up to another NPC and start to talk.

And the NPC starts the conversation always with the same dialog. So even the first dialog was set before the NPC reach each other. So everything has been checked.

Only things that could not be checked earlier can alter a conversation start.  Like a script with distance check, or a Lovers Joburg script ( one of the NPC can get horny and starts to stalk the other NPC  .... Hey he first had to get closer to recognize that the other NPC is really hot :lol:  )

Link to comment

If your question about storing the data is still open, look at the initialization of TamagoSetBody (maybe SetBody has a simpler version).  It uses GetRawFormIDString to get a unique key for an NPC that you can use a key in stringmap array.  The caveat is that it can change with load order changes and needs to be updated every game load.  The section in tsbrMainScript that's relevant starts with "arEventRegistered: stores npc refs that were registered to OnActorEquip handler." I think that's the sanitizing part.

 

Off the top of my head, I'd keep a single master stringmap array with hikoyo IDs as keys (using GetRawFormIDString).  Each value stored would be (sub) stringmap array of relatives.  That array would be keyed on relative IDs with values being a string stating the relationship ("Father", "Mother", "Grandfather"...).  I have ZERO idea how dialog and condition checking works in that part of CS.  But if possible, I'd have the source NPC check to see if it's in the master array.  Do the same with target. If both are in the master, check the source's ("relative") sub-array to see if target is in sub-array.  If so, you know their established relationship.  If the target NPC is NOT in the sub-array, you loop through each of the source's relatives to see if it is in the target's sub-array.  If so, do comparisons of how they are related.  Then, for both target and source, store their new established relationship in their respective sub-arrays.

 

Is that along the lines of what you're looking for?
 

Link to comment

I just took a look at Puppy Mill.  Had it for a while, but never looked script-wise until now.

 

Yes, it checks the pedigree nicely. :D  However, it only access that from a script level for our custom menu screens (want to buy a pup or a bitch?) ... but doesn't allow one to access said family tree within either Topic or Conversation dialog.

 

It would be so entertaining to have new dialog between a Hiyoko child and Runs in Circles (an Argonian) where the child begins with "What's happening, Mom?" ... or a brother and sister actually greet one another as such.  So the real issue would be:  How to detect if DIALOG is triggered --- And then Run an edit of the PuppyMillPedigree to apply Flags --- Lastly let the dialog run with applied flags. 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use