Author Topic: Convert PC (bic) to NPC (blueprint). Impossible?  (Read 821 times)

Legacy_HipMaestro

  • Hero Member
  • *****
  • Posts: 2849
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« on: August 28, 2013, 09:28:42 pm »


               Now this may have been investigated on the legacy boards but if so, I missed it. '<img'>

Is there a way to convert the info in the bic files, from say, all those in the local vault folder, to a form (a blueprint, I suppose) that can be spawned into a module like any other creatures WITHOUT manually building a blueprint for each?  

Though I've never used it (IIRC, it is laying around on a dusty DVD somewhere), I was wondering if Leto had this functionality.  TBH, I've never been able to read a bic out-of-game and the only reader script available (if it works as it claims) requires me to venture into .NET framework version jostling which I will not even consider a viable alternative, not on this machine anyway.

Wasn't sure whether this question would be script-oriented, toolset, utility or ~other~.  Any pointers would be greatly appreciated.

As usual,
TIA 
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #1 on: August 28, 2013, 11:21:24 pm »


               Leto doesn't. Letoscript probably does, though I've never done filetype conversions. You might want to have a look at the sticky in the scripting forum on datamining and mass editing your mod. It doesn't cover looping a servervault there, there that's definitely possible (I just forget the syntax). The script in there to look at would be the last, which shows how acaos uses letoscript to do our journal entries - similar to what you're trying to do. I suspect the process would involve using one dummy .utc, and just saving it as another name in a loop, to generate the utc per character you're looking for. You'd then just copy over the stats, etc as regular field gets and sets. Pretty complex, but the only way I can think of to do what you're wanting.

Funky
               
               

               
            

Legacy_HipMaestro

  • Hero Member
  • *****
  • Posts: 2849
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #2 on: August 28, 2013, 11:39:46 pm »


               Muchos gracias, Funky. '<img'>

I figured if it could be done at all, it would require some intricacy, but once I've figured out the procedure it will save quite some time over the toolset interface.

 'preciate it! 

Now, off to the study hall...
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #3 on: August 29, 2013, 12:44:57 am »


               I'll see if I can remember how to loop a vault. If you do figure out how to do what you want, I'd appreciate a post in that thread, because it involves doing a few things I haven't yet worked out. '<img'>

Funky
               
               

               
            

Legacy_Shia Luck

  • Hero Member
  • *****
  • Posts: 560
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #4 on: August 29, 2013, 12:54:09 am »


               *Reading Funky's answer* ....

*opening bottle of wine*

Nope.. still way beyond me... Mind you, doing a lot of things on a computer was way beyond me until NWN forced me to for one reason or another.

I can't help thinking tho that OMB's henchie hak was turning PCs into henchies (and back again) and if it's a henchie perhaps the file you want is created by that?  (Just a thought, might be a step too far out of the box (of wine) *grin*)

Have fun '<img'>
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #5 on: August 29, 2013, 01:26:52 am »


               That is database storage.  Save the PC as a database object and then retrieve it at will.
               
               

               
            

Legacy_HipMaestro

  • Hero Member
  • *****
  • Posts: 2849
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #6 on: August 29, 2013, 04:16:44 am »


               

WhiZard wrote...
That is database storage.  Save the PC as a database object and then retrieve it at will.

I'll buy that, WhiZard.  Are we talking NWNX or some other utility to accomplish that? Remember you guys, I know just about enough scripting to be dangerous, so it's usually trial 'n error until something clicks for me.  And even when it does work, it ain't pretty.  Server side management is, unfortunately, a total mystery to me.

I'd also need to become comfortable coding Letoscript before I can expect to see results, having never touched that before either.  Not asking anyone to devise any code set exactly, just pointing to a path of likely resolution is fine. I still enjoy learning/experimenting new coding languages and once absorbed there is always the knowledge base still here (you guys/gals) to keep any attempt I might make on course.

@Shia:  Funny. '<img'>  That was exactly why I asked the question.... OMB's BG-like party system works pretty slick and with minimum effort.  Now, if only those henchies could be spawned into a module like any other creature... that's my goal.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #7 on: August 29, 2013, 05:18:29 am »


               

HipMaestro wrote...

 
I'll buy that, WhiZard.  Are we talking NWNX or some other utility to accomplish that? Remember you guys, I know just about enough scripting to be dangerous, so it's usually trial 'n error until something clicks for me.  And even when it does work, it ain't pretty.  Server side management is, unfortunately, a total mystery to me.

 


he is talking about the nwn scripting function.  StoreCampaignDBObject.


So start a module and store the pc into the DB.   Just a few things to look at.   

First the PC does not have a tag.   You can give get that by copying the PC object and  giving them a tag with the function during the copying.  

Second the PC does not have any event scripts.   You can get them by dominating the copy of the PC.  That will give him the AI scripts from states.2da.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #8 on: August 29, 2013, 03:32:50 pm »


               Correct, Lightfoot, though the "DB" within that command indicates that it is a wrapper for StoreCampaignObject(), and I tend to think this wrapper is unnecessary.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #9 on: August 29, 2013, 04:11:29 pm »


               

WhiZard wrote...

Correct, Lightfoot, though the "DB" within that command indicates that it is a wrapper for StoreCampaignObject(), and I tend to think this wrapper is unnecessary.



umm,  umm,  uuu...'Posted
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #10 on: August 29, 2013, 06:06:18 pm »


               

HipMaestro wrote...

Now this may have been investigated on the legacy boards but if so, I missed it. '<img'>

Is there a way to convert the info in the bic files, from say, all those in the local vault folder, to a form (a blueprint, I suppose) that can be spawned into a module like any other creatures WITHOUT manually building a blueprint for each?  

Though I've never used it (IIRC, it is laying around on a dusty DVD somewhere), I was wondering if Leto had this functionality.  TBH, I've never been able to read a bic out-of-game and the only reader script available (if it works as it claims) requires me to venture into .NET framework version jostling which I will not even consider a viable alternative, not on this machine anyway.

Wasn't sure whether this question would be script-oriented, toolset, utility or ~other~.  Any pointers would be greatly appreciated.

As usual,
TIA 


Isn't this what the OHS by OldMansBeard does?

http://nwvault.ign.c....detail&id=2568

I'm sure you could rip the necessary components out.
               
               

               


                     Modifié par Pstemarie, 29 août 2013 - 05:08 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #11 on: August 29, 2013, 09:07:16 pm »


               

Pstemarie wrote...

Isn't this what the OHS by OldMansBeard does?

http://nwvault.ign.c....detail&id=2568

I'm sure you could rip the necessary components out.


The OHS was already mentioned by Shia above, to which I added that this was database storage per the OHS description.

There is provision for keeping your companions in a database so you can
develop the party as you move on from module to module and story to
story.


To be specific no creature template file is ever created, rather the creature is stored as an object on a database.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #12 on: August 29, 2013, 10:16:39 pm »


               Missed that reference. My bad...
               
               

               
            

Legacy_HipMaestro

  • Hero Member
  • *****
  • Posts: 2849
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #13 on: August 31, 2013, 04:05:31 pm »


               Trying to grasp the scope discussed here, so far...

Funky's suggestion addresses the ability to generate uti versions of the data found within a list of bics using a loop procedure of sorts, at least that is my rough interpretation.  The main hurdle for me is making sure all the necessary components are installed to process a letoscript file.  Still working on this.  (Funky, plz chk ur mesg center for some peripheral guidance by me regarding letoscript.)

The alternative WhiZard proposes seems actually less involved although there is an issue of populating some default fields like event scripts, appearance, description, CR... essentially all values that are not normally associated with a PC profile (bic).  I would expect that saving the DB object would need to be interrupted (or redirected temporarilty)  to a file that contains the default values while those fields are filled in.  The procedure itself would likely be: load a module with the conversion-intended PC, run the conversion script, then quit, possibly rename the resultant object  (not sure if the object created uses an existing ID or a default name), reload module with the next bic, and then rinse and repeat until the entire local vault has been converted.  Am I even close to the basic mechanics of this alternative?   Would the resultant DB object be a uti or some other file format?

In any case, thanks to all who have provided direction up to this point. '<img'>
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Convert PC (bic) to NPC (blueprint). Impossible?
« Reply #14 on: August 31, 2013, 04:24:13 pm »


               All database data is stored in .dbf, .cdx, and .fpt files (you can open these with Microsoft Excel).  The dbf only has descriptive information about the variable (variable name, type of variable, player ID, and timestamp)  while the other two have in depth detail of the object (except they are in code form rather than a human language).

You are correct that creating NPCs out of an entire local vault would require starting the module once for each PC to store it.  While a few things need to be updated (e.g. event scripts) there is a significant amount of data transfer (all local variables are copied, as well as the entire inventory).

Nevertheless, like CopyObject(), there are some unfixable problems (except through a 3rd party utility such as leto).  For example a Great Strength I feat adds one strength to a creature when it spawns.  If a spawned creature or PC is copied or saved to a database, then causing the copy (or retrieved object) to spawn would add another point of strength to the copy.   If, as a PC, I had great Intelligence X then the process to copy event scripts and data would mean that the final retrieved NPC would have 20 more intelligence than I had.  If I saved that creature as a henchman from module to module (like OHS does), I could have the henchman's stats go way off the charts due to the number of times it was copied.
               
               

               


                     Modifié par WhiZard, 31 août 2013 - 03:42 .