I would like to create a brand new 2DA file with a bunch of data that is specific to some new functionality I am making. Is it possible to do this? I can make the GDA file via GDApp, but how do I get the game to load it? All the 2DA script functions query tables by an ID in 2da_constants_h so I would need to assign my new table an ID somehow, and I can't figure out how to do that.
I tried the wiki. Either there is no info about this or it is hidden somewhere that my searches cannot find.
Would be real cool if there was a script function that said "Load this 2DA and give it this ID".
Possible to create new 2DA files?
Débuté par
FalloutBoy
, déc. 12 2009 10:02
#1
Posté 12 décembre 2009 - 10:02
#2
Posté 12 décembre 2009 - 10:07
Yep, I did that for the test version of my UI mod. Create a new XLS file called M2DA_base_[yourprefix] so e.g., M2DA_base_FalloutBoy.xls (the actual worksheet name itself is more important than the XLS file name I believe, but you might as well be consistent here). Then add your entries (new rows *only*, as that's the beauty of M2DA files) as you would see them in the M2DA_base worksheet in the source file 2DA_base.xls. For your new file, you only need one worksheet called M2DA_base_[yourprefix].
So things stay compatible, I strongly urge you to check out the reserved 2DA ranges. I staked a claim, and I see that BioWare recently staked theirs as well.
So things stay compatible, I strongly urge you to check out the reserved 2DA ranges. I staked a claim, and I see that BioWare recently staked theirs as well.
Modifié par FollowTheGourd, 12 décembre 2009 - 10:13 .
#3
Posté 12 décembre 2009 - 11:00
FalloutBoy wrote...
Would be real cool if there was a script function that said "Load this 2DA and give it this ID".
There is. You're thinking of the GetM2DA* functions family.
It allows you to get whatever you want from customs 2DA, be it by declaring like FollowTheGourd said, or by giving the function the name of the sheet. (the latter should be avoided, according to the functions brief)
#4
Posté 13 décembre 2009 - 07:54
Works great! Thanks for the help.
I didn't realize that you can just add your new worksheet right into the existing 2da_base or var_placeable or whatever. When I do that it seems to fix the issues I was having trying to process OpenOffice files. I think that's probably what the wiki was suggesting, but it didn't make sense to me when I read it.
Anyway, I'm rolling now. Thanks.
I didn't realize that you can just add your new worksheet right into the existing 2da_base or var_placeable or whatever. When I do that it seems to fix the issues I was having trying to process OpenOffice files. I think that's probably what the wiki was suggesting, but it didn't make sense to me when I read it.
Anyway, I'm rolling now. Thanks.
#5
Posté 13 décembre 2009 - 10:47
Phaenan wrote...
FalloutBoy wrote...
Would be real cool if there was a script function that said "Load this 2DA and give it this ID".
There is. You're thinking of the GetM2DA* functions family.
It allows you to get whatever you want from customs 2DA, be it by declaring like FollowTheGourd said, or by giving the function the name of the sheet. (the latter should be avoided, according to the functions brief)
Yeah, I wonder about this disclaimer because if you look at the core scripting, they get 2DA's by string name all the time
One thing I am curious about is this - Do I not need to modify the M2DA_base.GDA to add my own worksheets?
For instance, ifI just dump a custom GDA in my override directory, will I be able to access it by string reference if I wanted to, or does it only get compiled into the game at run time if it starts with a recognized prefix?
#6
Posté 13 décembre 2009 - 11:15
I would love to know that too.
#7
Posté 13 décembre 2009 - 11:25
I don't think you can get around it for some things; I've got my Warden class done as M2DA's and i'm getting to the point where I need to start writing scripts for it to function once I get past the character generation screen.





Retour en haut






