example ???
i think it so..
Code:strcpy(infoCharacter.bodySkin,"char\\tmABCD\\D003.ini");
strcpy(infoCharacter.headSkin,"char\\tmABCD\\tfh-d03.inf");
Printable View
example ???
i think it so..
Code:strcpy(infoCharacter.bodySkin,"char\\tmABCD\\D003.ini");
strcpy(infoCharacter.headSkin,"char\\tmABCD\\tfh-d03.inf");
I think you didnt unserstand what I meant =p
I just wanted to know which head potions those headSkins strings correspond to
I forgot to tell you that there are also "comic head" versions and those new potions from official server (cry, laugh, love etc.) :)
Head system is messed up in PT, over 500 strings. They should drop that .inx system.
btw, your screenshot isnt matching with the info in your dat... at least I'm getting level 12, 94 of defense...
Sorry, I think that was from my backup, try this one:
Multiupload.com - upload your files to multiple file hosting sites!
its all ok now, except for this:
cant reproduce that in C# :(Code:union {
long unknowInt8[34];
float unknowFloat8[34];
short unknowShort8[68];
};
long sessionID;
long x;
long y;
long z;
union {
long unknowInt9[4];
float unknowFloat9[4];
short unknowShort9[8];
};
I know a union allows that offset to be read as a int,float or a short in the 1st case, I just make it as an int, then I try to retrieve the next fields, like: sessionID, X,Y,Z, but they are with the incorrect values :(
I think you are slightly mistaken. A union allows a single memory location to be accessed implicitly as one of a number of different datatypes, without explicitly specifying the typecast in each access.
So, in the first case the array of 34 long integers "unknowInt8" occupies the same memory as the "unknownFloat8" and the 68 short integers "unknownShort8".
So, lets examine the following code using that unionThis code will display:-Code:unknownInt8[0] = 0x00FFFF00;
printf("Short[0] = %n, Short[1] = %n\n", unknownShort8[0], unknownShort8[1]);
i.e. unknownShort8[0] = 0xff, unknownShort8[1] = 0xff00. Get it?Code:Short[0] = 255, Short[1] = 65280
Maybe that's what you meant.
I'll give another simple example, if you make a union of a single element of type ubyte and of type char, then you can assign "a" to the char element, then add (+=) 32 to the ubyte element and the char element will then contain "A". ;)
If nothing else, I'm sure C# can contain the data in it's most basic form as an object defining access and modification properties and methods for the data which match the required datatypes, and perform internal typecasting in the operation overloads for those methods and properties. (however you work a property get & set and operator overloads in C#) unions are much simpler to write, and much simpler for the compiler to turn into machine code.
In most CPUs there is 0 logic to performing these typecasts, so why "invent" source code for the programmer to write in order to achieve something that is naturally understood without any CPU cycles or instruction execution in the processor?
From x86 assembly point of view, this method of managing information in memory is implicit in the fact that there is only one data type known to the CPU; Binary. XD How the assembler source code chooses to "pretty" it's entry for the coder is irrelevant to the CPU. :D:
This is how I made:
but I cant get the X Y Z... dunno how they are saved in the .dat fileCode:[StructLayout(LayoutKind.Explicit)]
struct P_Union
{
[FieldOffset(0), MarshalAs(UnmanagedType.ByValArray, SizeConst = 34)]
int[] p_int;
[FieldOffset(0), MarshalAs(UnmanagedType.ByValArray, SizeConst = 34)]
float[] p_float;
[FieldOffset(0), MarshalAs(UnmanagedType.ByValArray, SizeConst = 34*2)]
short[] p_short;
}
// remove padding
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct CharDat
{
public int size;
public int opcode;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst = 8)]
public string header;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string charName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string charModel1;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string charModel2;
public long charID;
long unknow;
int mobs;
public CharacterClass Class;
public int Level;
public int Strength;
public int spirit;
public int talent;
public int agility;
public int health;
public int freeStat;
public int attackRatting;
public int attackPowerMin;
public int attackPowerMax;
public int attackSpeed;
public int attackLengh;
public int criticalAttack;
public int defense;
public int block;
public int absorbtion;
public int speed;
int nulls;
public short currentpot;
public short maxpot;
public short elementalPoison;
public short elementalNone;
public short elementalFire;
public short elementalIce;
public short elementalLight;
public short elementalOrganic;
[MarshalAs(UnmanagedType.ByValArray,SizeConst = 5)]
int[] zeros;
public short currentHP;
public short maxHP;
public short currentMP;
public short maxMP;
public short currentSTM;
public short maxSTM;
public float HP_Regen;
public float MP_Regen;
public float STM_Regen;
public int currentExp;
public int nextLevelExp;
public int gold;
P_Union union1;
public int SessionID;
public Stages currentMap;
int unknow2;
}
I guess the P_Union struct is correct, isnt it?
@edit
I managed to get the correct X and Z values:
seems that the Y value isnt saved in the .dat file, am I right? when I spawn in ric my Y is 203 (0xCB) but there isnt any 0xCB in my .datCode:public Stages currentMap; // 0x1E4
int unknow2;
byte not;
public short X;
short not2;
public short Z;
0x1E4 field
0x1E8 camera mode
0x1EC X position
0x1F0 Z porition
Y (PT height) is calculated when you load on map.
What's byte not?
starting from 0x1E4:
03 00 00 00 (int currentMap)
01 00 00 00 (int unknow)
00(byte not) E9 FB FF (short X)
00 B3(short not2) BD FF (short Z)
is it possible to calculate the Y in C#?
and what would be the possible values to cameraMode?
Camera mode have only 3 values 0, 1, 2.
I think it is possible to calculate Y, but you need to know how PT use hight data in .smd files.
Well, PT calculating Y all the time if you look at admin HUD so it might be good place to look at.
PS. Are you sure that X, Z are not int?
do you know what this 3 values mean?
3 values? I said it wrong I guess.
Camera mode can be:
00 00 00 00
or
01 00 00 00
or
02 00 00 00
what 0, 1 and 2 means?
you talk about that fixed camera mode?
Yes. Free, fixed and auto, I don't remember what number is what =P