Welcome to
Mod The Sims
Online: 1183
News:
Have an account? Sign in:
pass:
If you don't have an account, why not sign up now? It's free!
Other sites: SimsWiki
Reply  Replies: 2 (Who?), Viewed: 1297 times.
Search this Thread
Old 25th Jun 2020, 3:02 AM DefaultFunction to Check if Object is Installed? #1
AlfredAskew
Original Poster

Field Researcher

Join Date: Apr 2008
Posts: 353
Thanks: 24911 in 19 Posts
18 Achievements


Full use case: I've been mucking about with crafting stations recently, and I'm worried about silly future-self removing an object that's supposed to be created by the crafting station, and that causing errors. Or even, I thinking about future self, and how I might want to be able to remove packages without having to re-mod a set of objects.

Is there a function to check if an object/package exists/is installed? (Presumably by guid)
I could see this maybe being a bit of an ask as far as searching goes, should this be done in guardian bhavs, or would it be wiser to run all the checks once when the object is loaded and store the results? Or some other third option...?
Old 25th Jun 2020, 7:05 AM #2
Chris Hatch
Scholar

Join Date: Dec 2005
Posts: 1,030


[prim 0x0020] Test Object Type (Stack Object ID 0x0000,
is instance of: GUID 0x008BB2C0,
checking original (not current) GUID: False,
incoming ID is a neighbor ID: False,
return GUID selected in Temp 0,1: True)

Make sure you set 'return found Object in Temp 0,1'. Will return true if an item by GUID 0x008BB2C0 is available to the game or false if it isn't, will leave the current object Id as is so it is easy to use.
Old 25th Jun 2020, 9:13 AM #3
AlfredAskew
Original Poster

Field Researcher

Join Date: Apr 2008
Posts: 353
Thanks: 24911 in 19 Posts
18 Achievements


Quote:
Originally Posted by Chris Hatch
[prim 0x0020] Test Object Type (Stack Object ID 0x0000,
is instance of: GUID 0x008BB2C0,
checking original (not current) GUID: False,
incoming ID is a neighbor ID: False,
return GUID selected in Temp 0,1: True)

Make sure you set 'return found Object in Temp 0,1'. Will return true if an item by GUID 0x008BB2C0 is available to the game or false if it isn't, will leave the current object Id as is so it is easy to use.

Perfect. Thanks so much.
Reply


Section jump:


Powered by MariaDB Some icons by http://dryicons.com.