SRL Archive - Bugs

Gametab(TAB_EQUIP) in Equipment functions


Coh3n

2011-02-09 21:21:37

Just tested, and there's no need for the gametab call in almost all of the equipment functions. Is there a reason it's there?

mormonman

2011-02-09 22:15:27

It has to update the cache for the equipment interface.

pyroryan

2011-02-09 22:16:31

From: mormonman
It has to update the cache for the equipment interface.


Unless you use the Equipment hook, which should contain anything that is displayed on the character (so not rings, etc.).

mormonman

2011-02-09 22:20:52

From: pyroryan
Unless you use the Equipment hook, which should contain anything that is displayed on the character (so not rings, etc.).


Which isn't in equipment.simba - Its in players.simba

Coh3n

2011-02-10 00:15:58

From: mormonman
It has to update the cache for the equipment interface.

I don't know what that means. :o

Sorry.

mormonman

2011-02-10 00:51:28

From: Coh3n
I don't know what that means. :o

Sorry.


What are you using it for?

Coh3n

2011-02-10 01:00:43

From: mormonman
What are you using it for?

As a failsafe to check if the player as a weapon equipped.

mormonman

2011-02-10 01:10:51

Use GetMe.Equipment[EQUIPMENT_SLOT_WEAPON]

Coh3n

2011-02-10 01:43:53

From: mormonman
Use GetMe.Equipment[EQUIPMENT_SLOT_WEAPON]

Decent, thanks. :)

Gu3st...

2011-02-10 03:35:13

From: Coh3n
I don't know what that means. :o

Sorry.
Each time you click the equipment tab, the information in that tab is stored. That information can be accessed by reflection at any time, but if you equip new items, the information wont be updated until you click the equipment tab again

pyroryan

2011-02-10 13:26:18

From: Zyt3x
Each time you click the equipment tab, the information in that tab is stored. That information can be accessed by reflection at any time, but if you equip new items, the information wont be updated until you click the equipment tab again


Thats when the getEquipment hook comes in. I believe that one stays updated. The normal equipment detection uses interfaces.

Sir R. M8gic1an

2011-02-10 13:30:36

From: pyroryan
Thats when the getEquipment hook comes in. I believe that one stays updated. The normal equipment detection uses interfaces.


Wow, now I got confused.

So… the hook always has the right info,
The cache has the latest info,
and if you click it then you obviously have the info.

Is that it?

What's the hook then? :) / How do I use it rather.

And if anyone is gonna call this spoon feeding, please bring HagenDass and big spoons, cus most people wouldn't specifically ask how to use the hook.

~RM

pyroryan

2011-02-10 13:36:16

From: Sir R. M8gic1an
Wow, now I got confused.

So… the hook always has the right info,
The cache has the latest info,
and if you click it then you obviously have the info.

Is that it?

What's the hook then? :) / How do I use it rather.

And if anyone is gonna call this spoon feeding, please bring HagenDass and big spoons, cus most people wouldn't specifically ask how to use the hook.

~RM


Its built into GetMe.Equipment by mormonman. It will not work with rings, ammo, etc. (anything you can't see on the player).

mormonman

2011-02-10 13:40:50

function GetKegOnHeadCount: Integer;
var
me: TMe;
HeadID: Integer;
begin
me := GetMe;
HeadID := me.Equipment[EQUIPMENT_SLOT_HELMET];
Result := HeadID - BARREL_ID;
end;

^^ thats how i use it.