Aller au contenu

Photo

How to export extra object with a PC character


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

#1
wolfzhu

wolfzhu
  • Members
  • 12 messages
 Hi,

I'm wondering if it's possible to export some objects (such as a big quantity of items beyond the character can take in his / her backpack). Anyone have some ideas?

#2
CalSailX

CalSailX
  • Members
  • 56 messages
If it's your own module going to another of your own modules you could hook into the henchmen export/import functions. They have their limitations, but that's how I've planned on getting hench/love interest from the first of my modules into the next and preserve the level up choices among other things that make the investment in having them for company worth while.

Going that route not for pack rats, but because the relationships in the party should be reflect those that the last module ended with.

Anyway.. not sure how helpful you'll find my reply, but yea depending on circumstances it's possible to do what you ask if both modules hook into the functions.

#3
wolfzhu

wolfzhu
  • Members
  • 12 messages
Thanks CalSailX. However what I want is to export more items with my PC character. Don't know if SetLocalObject to the skin works, anyway I'll try it.

#4
henesua

henesua
  • Members
  • 3 878 messages
Please be more specific about what you are trying to achieve.

It is possible to export game objects to a database. But this is a very different thing than setting a local object.

Modifié par henesua, 23 octobre 2013 - 07:48 .


#5
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
I think he basically wants to take more inventory pages with him. Long story short, you can't, unless you're taking it to another module that shares the same campaign database/database. Like henesua says, we need to know more specifically what you're attempting to do - going between different OC modules?

Funky

#6
wolfzhu

wolfzhu
  • Members
  • 12 messages
OK, in short, I want to create a tower for a single player wizard, and make all items in this tower going with him when the player exports the character, that he'll see those items in the tower when he establishes a new game.

#7
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
To answer the original question, No you can not export extra items with a player.

So without being able to do it that way, It sounds like you are asking for something like persistent housing.

#8
wolfzhu

wolfzhu
  • Members
  • 12 messages
Yes, I was asking for a kind of persistent housing. You are right. But I don't understand why it's impossible to export extra items with a player, in a dumb way, an item can be encoded with its all properties into a string and set as local string to the skin of the character. I just wonder if there is more efficient way to do it.

Modifié par wolfzhu, 24 octobre 2013 - 01:47 .


#9
henesua

henesua
  • Members
  • 3 878 messages
Perhaps one way to do this is simply to create a module for yourself that uses a database linked with persistent storage.

When you finish a module, save your character. Then start a new game with that character in your tower module. Put your character's things in the persistent storage. Ensure that the persistent storage is saved to the database - this will depend on how you script this. Save your character. Then quit the module. You will not need to save the module.

Each time you complete a module you can do an inventory dump in your tower module. And when you want to start a new module, you can enter the tower, optimize your character's equipment, and save the character again.

#10
wolfzhu

wolfzhu
  • Members
  • 12 messages
The tower is not only in a single module -- I saved it as a persistent object in the override folder, and created a corresponding spell to teleport in/out of it. So this tower is a persistent housing for the very character.

-- But not including the items in it -- each time I start a new module the items in the tower cannot be held. So something should be done to backup the items when I save the character, and restore them after a new module is open.

Modifié par wolfzhu, 24 octobre 2013 - 02:15 .


#11
henesua

henesua
  • Members
  • 3 878 messages
The key to what you want is the persistent stoage. You'll need to write scripts for that.

#12
HipMaestro

HipMaestro
  • Members
  • 1 515 messages
Been following this topic for a few days as a novice scripter at best.

Question:  Can a familiar or companion be assigned an inventory?

#13
henesua

henesua
  • Members
  • 3 878 messages
Familiars and Companion's do have an inventory, but when they are unsummoned everything in it is destroyed.

So again the solution is to store the inventory in a database.

#14
Baaleos

Baaleos
  • Members
  • 1 330 messages
This might be too techi for the topic: but a while ago- I did experiments with storing items to MySQL database via nwnx, then exporting them to the physical hdd of the server as individual items.
(MySQL provides methods for saving blob info to files)
Then I was able to call a MySQL command to load the file back into the database and then rematerialize it in game.
What this proves is that the items can be serialized to binary / byte array form.
Byte information can also be represented as text.
Depending on what encoding is used: some info might not make it through the translation from byte array to string.
However....
It might be possible to have the byte array values turned into their actual byte values as strings.

Eg: 0xfe 0xfd 0x1a. Etc could be
Fe|fd|1a

If the SetLocalString character length allows for it, you could in theory determine what an items byte information is represented as in textual form, then store it on the player in one or more local strings.
The player could in theory have a script read that information, store it to MySQL database, and then call RetrievePersistentObject from nwnx odbc to materialize the item information as an ingame item.
This would all depend on whether local strings can contain enough info.
If they can- or there is no limit: then yes: you could in theory store the information about each item as a local string : then deserialize that raw info into a usable object.


Not knowing how much data could be held in a local string: I can however say that each stored item would be at least 10kb in size or more.
10 kb is roughly 10,000 bytes. ( a single byte being something like FE or 1A etc)
So since each byte is a double character space length- you would need to hold roughly 20000 characters of info in a local string.
Of course--- the limit - if it exists could be avoided by spanning the info over multiple local strings.

Geek rant finished

#15
Baaleos

Baaleos
  • Members
  • 1 330 messages
Duplicate

Modifié par Baaleos, 26 octobre 2013 - 09:07 .


#16
Baaleos

Baaleos
  • Members
  • 1 330 messages
Duplicate

Modifié par Baaleos, 26 octobre 2013 - 09:07 .


#17
Baaleos

Baaleos
  • Members
  • 1 330 messages
Sorry for triple post: iPad post didn't seem to refresh page: if a mod can delete the spares? Much appreciated

#18
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
The max length for a local string on a character is in theory 4 Gb. In theory because the max size of the object that it is on is also 4 Gb.

#19
HipMaestro

HipMaestro
  • Members
  • 1 515 messages

Baaleos wrote...
Sorry for triple post: iPad post didn't seem to refresh page: if a mod can delete the spares? Much appreciated

(sh)It happens.  But I wouldn't hold my breath waiting for admin service.  Alternatively, edit the duplicates yourself,removing the entire text body, perhaps noting what happened.  At least we won't go scroll-blind unnecessarily trying to follow the thread. 

Hang loose, bro! ;)

P.S. I like your solution, even in triplicate.