Aller au contenu

Photo

Convert PC (bic) to NPC (blueprint). Impossible?


  • Veuillez vous connecter pour répondre
20 réponses à ce sujet

#1
HipMaestro

HipMaestro
  • Members
  • 1 515 messages
Now this may have been investigated on the legacy boards but if so, I missed it. :(

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 

#2
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
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

#3
HipMaestro

HipMaestro
  • Members
  • 1 515 messages
Muchos gracias, Funky. ;)

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

#4
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
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. :)

Funky

#5
Shia Luck

Shia Luck
  • Members
  • 953 messages
*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 :)

#6
WhiZard

WhiZard
  • Members
  • 1 204 messages
That is database storage. Save the PC as a database object and then retrieve it at will.

#7
HipMaestro

HipMaestro
  • Members
  • 1 515 messages

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. ;)  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.

#8
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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.

#9
WhiZard

WhiZard
  • Members
  • 1 204 messages
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.

#10
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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 Image

#11
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

HipMaestro wrote...

Now this may have been investigated on the legacy boards but if so, I missed it. :(

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 .


#12
WhiZard

WhiZard
  • Members
  • 1 204 messages

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.

#13
Pstemarie

Pstemarie
  • Members
  • 2 745 messages
Missed that reference. My bad...

#14
HipMaestro

HipMaestro
  • Members
  • 1 515 messages
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. ;)

#15
WhiZard

WhiZard
  • Members
  • 1 204 messages
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 .


#16
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

HipMaestro wrote...

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

I accepted the friend request, but I see no messages. The thread I mention
in the Scripting forum, linked
here,
explains every step in installing all that you need to run letoscript
files using Moneo.


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?


Actually, that way seems a LOT more
involved, though my way means puzzling a few things out up front. It
also doesn't really do what you were asking, and I didn't read Whiz as
actually suggesting it.

Some other clarifications. Most bioware
file formats are variations on gff files (for generic file format, or
general, I forget). utis are for items, not creatures, those are stored
in utcs. I think of the 'ut' as universal template, like a resref,
though I forget if that's what it actually stands for. The i at the end
of uti is for item, however, the c in utc for creatures, p in utp for
placeable, t in utt for trigger, w in utw for waypoint, and so on - that
may help you to remember.

Maybe you should tell us why you want to do what you asked how to do - it's a little hard to tell if a database-based approach would even work for you.

Funky

#17
OldMansBeard

OldMansBeard
  • Members
  • 152 messages
Sorry if I have come late to the party.

Converting your bic files via the OHS to make henchmen you can embed in a module, would certainly be possible with a bit of extra scripting. You could take the RecallHenchmen() function in ohs_i0_commands as a guide. You would just need some extra scripting to put each henchman in the right place to start the module.

But that's a silly way to do it :D

Leto does convert bic files to utc files and embeds them in an erf for you to import into a module in the toolset. At least, the version of Leto that I have does that. I'm looking at Leto Hotu 4.7.5.70 as modified by Kaliea which is on the NWVault but that's many years out of date and you might want to use this one instead.

#18
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

OldMansBeard wrote...

Leto does convert bic files to utc files and embeds them in an erf for you to import into a module in the toolset. At least, the version of Leto that I have does that. I'm looking at Leto Hotu 4.7.5.70 as modified by Kaliea which is on the NWVault but that's many years out of date and you might want to use this one instead.


Whoa, nice. Learned something. Still, one-at-a-time...eh, depends on what you want to do it for, I guess.

Funky

#19
werelynx

werelynx
  • Members
  • 628 messages
Why don't you save game with the .bic and then change the extension of the .sav (?) file to .mod?\\
Afterwards open in toolset make blueprint and export..

#20
Thayan

Thayan
  • Members
  • 244 messages
Ok - need a little help here. So I have figured out (I think) how to use Leto to create an erf with the bic file saved as a utc. But when I import that into the module, it doesn't show up in any of the palettes (likely because the creature was never assigend one, I suppose). If I reimport the erf, it says teh creature resource is already there, but even if i try to create it programtically using CreatObject with the resref for the converted PC as it shows using NWNExplorer, I still can't create it.

The same thing also happens if a convert a sav to a mod and open it in the toolset - no PC 'creature' to be found.

So how does one go about getting these converted bic-to-utc files in either case?

Modifié par Thayan, 07 septembre 2013 - 03:10 .


#21
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Use Alia, another app by dragon song (on his leto sourceforge page), or you can use moneo/letoscript, to set the palette id to whatever you need. You can also download Alia here:

Funky's Dropbox Alia link from the Scripting forum tutorial on mass edits and datamining

LMK if you need more help. You can find the appropriate palette number by looking at it in NWNExplorer, or just by grabbing a creature in the current palette in the category you want, and looking at in in Alia.

I generally copy files out of my module before using leto/alia/etc on them, by the way, so I have a second copy, and I make another backup if I'm intending to edit the copy and put it back in the module, as a failsafe.

We use the cep, but have our own custom palettes in the custom hak. For us, Special/Custom 1 is PaletteID 0, and Special/Custom2 is 1, just by way of example.

Funky