I'm curious if this can even be done.
Essentially, I want to be able to retrieve the data stored in the CombatInfo struct on the PC.
A simple way to retrieve things like base AB modifier would be extremely useful for certain things, like a properly calculated disarm check.
An ability to write directly to the struct would be even better. but just read access to it would be a nice start.
Does anyone know of a way to go about this?
Retrieving a struct from an object
Débuté par
Failed.Bard
, août 30 2011 05:25
#1
Posté 30 août 2011 - 05:25
#2
Posté 30 août 2011 - 05:55
How is the data that populates the struct stored? In my understanding, you can not store a struct on an object, but rather you have to store all the pieces as ints, floats, strings, or objects. If I am wrong I would be very happy to hear it. Once you load this data into the struct however it is easy to return the struct entire from a function.
So as to your question I assume that it is this particular struct you are trying to access. To do so I think you need to find the functions buried in the scripts that were written to organize the struct in the first place. As to that I don't know where they are.
You could however create your own version of the same struct, and write your own custom functions to populate it.
So as to your question I assume that it is this particular struct you are trying to access. To do so I think you need to find the functions buried in the scripts that were written to organize the struct in the first place. As to that I don't know where they are.
You could however create your own version of the same struct, and write your own custom functions to populate it.
#3
Posté 30 août 2011 - 06:08
henesua wrote...
How is the data that populates the struct stored? In my understanding, you can not store a struct on an object, but rather you have to store all the pieces as ints, floats, strings, or objects. If I am wrong I would be very happy to hear it. Once you load this data into the struct however it is easy to return the struct entire from a function.
It's not on the object so much as it is on the bic save character file. I have no clue on how to access it.
#4
Posté 30 août 2011 - 06:30
The numbers stored in that struct in the bic seem to be the ones displayed on the character sheet, which would mean they're stored somewhere the engine can rapidly access them.
I suppose someone might be able to trace the functions that run when the character is initially loaded to find what reads them, and where they're stored, but that's well beyond what I know how to do.
I suppose someone might be able to trace the functions that run when the character is initially loaded to find what reads them, and where they're stored, but that's well beyond what I know how to do.
#5
Posté 30 août 2011 - 06:34
Why not just make your own struct and set of functions? Is there any data that you are unable to access? It seems to me that with regards to PC stats every one is accessible by standard functions. You could pull all this off and fill your own struct. Additional modifiers can be determined by a sweep through PC feats correct?
Or am I missing the point in that you didn't want to have to recreate the wheel?
Or am I missing the point in that you didn't want to have to recreate the wheel?
#6
Posté 30 août 2011 - 06:58
Checking an existing int is almost always going to be more efficient than recalculating what went into it to begin with.
It's a similar issue with things like GetMetamagicFeat(). It's data either stored on the PC, or on the module but in a way directly referencing the PC. A way to access and manipulate these "hidden" data types would open up a huge number of scripting possibilities.
It's a similar issue with things like GetMetamagicFeat(). It's data either stored on the PC, or on the module but in a way directly referencing the PC. A way to access and manipulate these "hidden" data types would open up a huge number of scripting possibilities.
#7
Posté 31 août 2011 - 08:05
Check the list of functions in nwnx_funcs. Only NWNX can access this data, so if there are such functions, they'll be in nwnx_funcs.





Retour en haut






