hi. i have this code trying to access a 2DA called test2da_fh.xls. the worksheet is called test2da_fh and the second column is called Label and stores strings. i've made another file called 2DA_base_fh.xls to try and get an ID for my first 2DA so i can use that id whith GetM2DAstring. i've put both of those files in the override directory of my full_heal module. when i compile the code below i get the error: undefined identifier from GetM2DAstring. not sure what's wrong.
string s2DA;
s2DA = GetM2DAstring(43000, "Label", 3);
DisplayFloatyMessage(stEvent.oTarget, s2DA, FLOATY_MESSAGE,16777215, 10.00);
using GetM2DAstring to access my own 2DA
Débuté par
gordonbrown82
, févr. 08 2010 02:05
#1
Posté 08 février 2010 - 02:05
#2
Posté 08 février 2010 - 03:00
Hm. Should work.
Maybe it's because you extended 2DA_Base and not M2DA_Base ? Not sure since I never tried the former myself as there's a note in the source 2DA_base sheet saying we shouldn't.
On a side note, you can also access your custom 2DA tables by specifying the sheet name directly :
GetM2DAstring(-1, "Label", 3, "test2da_fh");
According to the function comment that's not ideal, but the lazy me has been doing it quite a lot nevertheless.
Maybe it's because you extended 2DA_Base and not M2DA_Base ? Not sure since I never tried the former myself as there's a note in the source 2DA_base sheet saying we shouldn't.
On a side note, you can also access your custom 2DA tables by specifying the sheet name directly :
GetM2DAstring(-1, "Label", 3, "test2da_fh");
According to the function comment that's not ideal, but the lazy me has been doing it quite a lot nevertheless.
#3
Posté 08 février 2010 - 03:44
Yep ,have to be M2DA_base_fh
#4
Posté 08 février 2010 - 05:23
maybe i'm missing an include file? what include files do you guys use?
#5
Posté 08 février 2010 - 05:23
It is because it is GetM2DAString and not GetM2DAstring
#6
Posté 08 février 2010 - 05:28
Oh, right !
Kinda forgot to pay attention to the error message in the OP. Yay, one more wide off the mark post for me !
Kinda forgot to pay attention to the error message in the OP. Yay, one more wide off the mark post for me !
#7
Posté 08 février 2010 - 06:17
Oh that may be the reason i get random errors so often lol
#8
Posté 08 février 2010 - 06:19
While the compile error surely comes from the typo - did you create gda files out of the xls files? I found the whole 2da concept not very intuitve but maybe that's just me.
http://social.biowar.../Compiling_2DAs
For your (or everybody's?) information, the "base" in M2DA_base_fh is not required.
http://social.biowar.../Compiling_2DAs
For your (or everybody's?) information, the "base" in M2DA_base_fh is not required.
#9
Posté 10 février 2010 - 05:19
you were right anakin now the script compiles but i'm still not able to extract strings from 2da's. the code below makes "gulk" appear above the target of a heal spell. that is intended so the problem is not with the code itself it has something to do with accessing the GDA files.
string s2DA;
s2DA = "gulk";
DisplayFloatyMessage(stEvent.oTarget, s2DA, FLOATY_MESSAGE,16777215, 10.00);
below is the gda file i've done that i'm trying to access:
string s2DA;
s2DA = "gulk";
DisplayFloatyMessage(stEvent.oTarget, s2DA, FLOATY_MESSAGE,16777215, 10.00);
below is the gda file i've done that i'm trying to access:
#10
Posté 10 février 2010 - 05:22
pic of my override folder (just trying to give as much information as i can in case anyone can understand what i'm doing wrong)
#11
Posté 10 février 2010 - 05:26
If your sheet has the ID 43000 in M2DA_base :
DisplayFloatyMessage(stEvent.oTarget, GetM2DAString(43000, "Label", 0));
By the way, note that Bioware reserved ID below 1'000'000 in M2DA_base, so you may want to change that ID if your project is meant to be public at some point.
If your sheet isn't defined in M2DA_base :
DisplayFloatyMessage(stEvent.oTarget, GetM2DAString(-1, "Label", 0, "test2da_fh"));
DisplayFloatyMessage(stEvent.oTarget, GetM2DAString(43000, "Label", 0));
By the way, note that Bioware reserved ID below 1'000'000 in M2DA_base, so you may want to change that ID if your project is meant to be public at some point.
If your sheet isn't defined in M2DA_base :
DisplayFloatyMessage(stEvent.oTarget, GetM2DAString(-1, "Label", 0, "test2da_fh"));
Modifié par Phaenan, 10 février 2010 - 05:30 .
#12
Posté 10 février 2010 - 05:38
yup that worked. thanks for the help.





Retour en haut






