SystemFindObjectBySerial question

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am

SystemFindObjectBySerial question

Post 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
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: SystemFindObjectBySerial question

Post 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?
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am

Re: SystemFindObjectBySerial question

Post 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.
Nando
POL Developer
Posts: 284
Joined: Wed Sep 17, 2008 6:53 pm

Re: SystemFindObjectBySerial question

Post 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.
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: SystemFindObjectBySerial question

Post 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? :)
Nando
POL Developer
Posts: 284
Joined: Wed Sep 17, 2008 6:53 pm

Re: SystemFindObjectBySerial question

Post 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
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am

Re: SystemFindObjectBySerial question

Post 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.
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: SystemFindObjectBySerial question

Post 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!
Nando
POL Developer
Posts: 284
Joined: Wed Sep 17, 2008 6:53 pm

Re: SystemFindObjectBySerial question

Post by Nando »

Code: Select all

02-07-2009 Turley:

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