Page 1 of 1

SystemFindObjectBySerial question

Posted: Sun Feb 01, 2009 3:12 am
by Gnafu
In the docs SystemFindObjectBySerial has 2 flags

const SYSFIND_SEARCH_OFFLINE_MOBILES := 1;
const SYSFIND_SEARCH_STORAGE_AREAS := 2;

If i use SystemFindObjectBySerial( objserial ); i get the item/pc reference.
If the pc is offline I must use SystemFindObjectBySerial( objserial , SYSFIND_SEARCH_OFFLINE_MOBILES); and it finds it. and that's ok.
If the item is in the storage(or pcequip) I can get the reference using only SystemFindObjectBySerial( objserial ); so..
Is SYSFIND_SEARCH_STORAGE_AREAS useless?
I can't figure a scenario tu use it.. :?:

Thanks in advance

Re: SystemFindObjectBySerial question

Posted: Fri Feb 06, 2009 1:24 am
by Yukiko
According to core-changes.txt:
- SYSFIND_SEARCH_STORAGE_AREAS - search for items in all storage areas
Take note of the word "all".

Maybe SystemFindObjectBySerial only searches pc equipped containers and chests etc. and not merchant storage and world bank areas without the added flag.

Did you test to see if items in the special storage areas (bank and merc storage) are found?

Re: SystemFindObjectBySerial question

Posted: Fri Feb 06, 2009 2:20 am
by Gnafu
With
Gnafu wrote: If the item is in the storage(or pcequip) I can get the reference using only SystemFindObjectBySerial( objserial );
I meant "if the item is in storage.txt or pcequip.txt" so world banks and merchant storages are searched through.

I tryed searching for items in "GivenItems" "Merchant Storage" "Tamed Storage" and "World Bank" StorageAreas, and i found them all, without the flag.

Re: SystemFindObjectBySerial question

Posted: Fri Feb 06, 2009 11:39 am
by Nando
You're correct. The SYSFIND_SEARCH_OFFLINE_MOBILE flag makes SystemFindObjectBySerial return an OfflineMobileRef, so it can act on offline chars. The other flag does nothing. Every item is searched regardless of flags.

Re: SystemFindObjectBySerial question

Posted: Fri Feb 06, 2009 1:43 pm
by Turley
Once upon a time storage area items where storaged intern in an extra vector so to search these an extra flag was needed. Since years the storage area items are in the same vector as "normal" world objects thus flag is obsolete. Maybe time to remove it in pol98? :)

Re: SystemFindObjectBySerial question

Posted: Fri Feb 06, 2009 2:43 pm
by Nando
Talking to Austin, he said the problem was breaking older scripts (095). Maybe removing it from docs and place a comment of deprecation on the uo.em, so no new scripts use? Or just remove and place a BIG WARNING in core-changes... :P

Re: SystemFindObjectBySerial question

Posted: Sat Feb 07, 2009 1:19 am
by Gnafu
Nando wrote:Talking to Austin, he said the problem was breaking older scripts (095).
I don't understand the problem: using a 098 core with 095 scripts needs MANY other changes in the scripts.

Anyway, thanks a lot for the explanation.

Re: SystemFindObjectBySerial question

Posted: Sat Feb 07, 2009 3:40 am
by Yukiko
Gnafu is right. May as well remove the flag entirely and be done with it. I mean that's an easy fix when converting from 0.95 to 0.97/0.98. Would that all conversion issues were THAT easy!

Re: SystemFindObjectBySerial question

Posted: Sat Feb 07, 2009 10:54 am
by Nando

Code: Select all

02-07-2009 Turley:

    Removed: SystemFindObjectBySerial() flag SYSFIND_SEARCH_STORAGE_AREAS (was obsolete since years)