parts of inventory missing...

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

User avatar
pooz
a lesser mummy
a lesser mummy
Posts: 44
Joined: Fri Jun 27, 2003 1:01 pm

parts of inventory missing...

Post by pooz » Sun Aug 01, 2004 2:27 am

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.
trees do not need much money

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sun Aug 01, 2004 3:16 am

See the inventory.mac that is distributed with the zip.

shoulder
ranged
mainhand
offhand

User avatar
pooz
a lesser mummy
a lesser mummy
Posts: 44
Joined: Fri Jun 27, 2003 1:01 pm

Post by pooz » Sun Aug 01, 2004 2:34 pm

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;
trees do not need much money

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Sun Aug 01, 2004 3:11 pm

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:

Sparr
a hill giant
a hill giant
Posts: 159
Joined: Mon Jun 24, 2002 5:41 am

Post by Sparr » Sun Aug 01, 2004 4:10 pm

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.

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Sun Aug 01, 2004 4:37 pm

Sparr

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

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]