Page 1 of 1

parts of inventory missing...

Posted: Sun Aug 01, 2004 2:27 am
by pooz

Code: Select all

| wearing.mac
| Displayes item name of what is in each inventory slot.
Sub Main
/echo       Charm: ${Me.Inventory[Charm]}
/echo     LeftEar: ${Me.Inventory[LeftEar]}
/echo        Head: ${Me.Inventory[Head]}
/echo        Face: ${Me.Inventory[Face]}
/echo    RightEar: ${Me.Inventory[RightEar]}
/echo        Neck: ${Me.Inventory[Neck]}
/echo   Shoulders: ${Me.Inventory[Shoulders]}
/echo        Arms: ${Me.Inventory[Arms]}
/echo        Back: ${Me.Inventory[Back]}
/echo   LeftWrist: ${Me.Inventory[LeftWrist]}
/echo  RightWrist: ${Me.Inventory[RightWrist]}
/echo       Range: ${Me.Inventory[Range]}
/echo       Hands: ${Me.Inventory[Hands]}
/echo     Primary: ${Me.Inventory[Primary]}
/echo   Secondary: ${Me.Inventory[Secondary]}
/echo  LeftFinger: ${Me.Inventory[LeftFinger]}
/echo RightFinger: ${Me.Inventory[RightFinger]}
/echo       Chest: ${Me.Inventory[Chest]}
/echo        Legs: ${Me.Inventory[Legs]}
/echo        Feet: ${Me.Inventory[Feet]}
/echo       Waist: ${Me.Inventory[Waist]}
/echo        Ammo: ${Me.Inventory[Ammo]}
/return
Everything will return correct items except the following slots will return NULL:
Shoulders
Range
Primary
Secondary

Code: Select all

| wearing2.mac
| Iterates through your inventory and displays item names
Sub Main
	/declare x int
	/for x 0 to 29
		/echo ${x} ${Me.Inventory[${x}]}
	/next x
/return
Will display everything correctly.

It would appear there's something wrong with either the struct or the name->slot conversion.

Posted: Sun Aug 01, 2004 3:16 am
by dont_know_at_all
See the inventory.mac that is distributed with the zip.

shoulder
ranged
mainhand
offhand

Posted: Sun Aug 01, 2004 2:34 pm
by pooz
Why are they called something besides what's in the struct?

Code: Select all

typedef struct _INVENTORY { 
/*0x00*/  struct	_CONTENTS* Charm; 
/*0x04*/  struct	_CONTENTS* LeftEar; 
/*0x08*/  struct	_CONTENTS* Head; 
/*0x0c*/  struct	_CONTENTS* Face; 
/*0x10*/  struct	_CONTENTS* RightEar; 
/*0x14*/  struct	_CONTENTS* Neck; 
/*0x18*/  struct	_CONTENTS* Shoulders; 
/*0x1c*/  struct	_CONTENTS* Arms; 
/*0x20*/  struct	_CONTENTS* Back; 
/*0x24*/  struct	_CONTENTS* LeftWrist; 
/*0x28*/  struct	_CONTENTS* RightWrist; 
/*0x2c*/  struct	_CONTENTS* Range; 
/*0x30*/  struct	_CONTENTS* Hands; 
/*0x34*/  struct	_CONTENTS* Primary; 
/*0x38*/  struct	_CONTENTS* Secondary; 
/*0x3c*/  struct	_CONTENTS* LeftFinger; 
/*0x40*/  struct	_CONTENTS* RightFinger; 
/*0x44*/  struct	_CONTENTS* Chest; 
/*0x48*/  struct	_CONTENTS* Legs; 
/*0x4c*/  struct	_CONTENTS* Feet; 
/*0x50*/  struct	_CONTENTS* Waist; 
/*0x54*/  struct	_CONTENTS* Ammo; 
/*0x58*/  struct	_CONTENTS* Pack[0x8]; 
} INVENTORY, *PINVENTORY;

Posted: Sun Aug 01, 2004 3:11 pm
by blueninja
That struct is not where the names are read by the parser.

From MQ2Globals.cpp:

Code: Select all

PCHAR szItemSlot[] = {

    "charm",        // 0

    "leftear",      // 1

    "head",

    "face",

    "rightear",

    "neck",

    "shoulder",

    "arms",

    "back",

    "leftwrist",

    "rightwrist",   // 10

    "ranged",

    "hands",

    "mainhand",

    "offhand",

    "leftfinger",

    "rightfinger",

    "chest",

    "legs",

    "feet",

    "waist",        // 20

    "ammo",

	"pack1",

	"pack2",

	"pack3",

	"pack4",

	"pack5",

	"pack6",

	"pack7",

	"pack8",        // 29

    NULL            // 30

};
Also see MQ2DataTypes.cpp in the function:

Code: Select all

bool MQ2CharacterType::GetMember(MQ2VARPTR VarPtr, PCHAR Member, PCHAR Index, MQ2TYPEVAR &Dest)
under

Code: Select all

	case Inventory:

Posted: Sun Aug 01, 2004 4:10 pm
by Sparr
i agree that having the struct and the parser use different names is not cool. but even more so is that most of the things available in most of the structs isnt available in scripts. this i a major annoyance every time i need access to that data for two reasons. Firstly because i have to recompile MQ to get access to it, and secondly because I cant distribute the macros that use it.

Posted: Sun Aug 01, 2004 4:37 pm
by Fippy
Sparr

Why dont you post your mods and maybe they will get rolled into the distro.