Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Instructor
Original Poster
#1 Old 6th Apr 2017 at 6:25 PM Last edited by whoward69 : 6th Apr 2017 at 10:36 PM.
Default Create/Destroy temp object vs find one used earlier
I have a modded game object that has some player selectable options. I have a BCON to store the default values (bit flags), a couple of object attributes to store the current settings, and a series of menu options to turn them on/off ... simples ...
Except, the modded game object is an incoming phone call handler so has no visual presence in game ...
So, I have a cloned painting that the BCON, attributes and menu entries are actually on, and a "CT" style BHAV to retrieve the current settings. The painting also has logic to replicate values between copies, if the player happens to place more than one on the lot.
The incoming phone call handler then finds the (first) cloned painting and uses Run Tree By Name to call the "CT" BHAV and get the current option settings ... simples ...
Except, the player may NOT have placed a copy of the cloned painting on the lot. In this case I need the default values from the BCON, and to get those I need a copy of the cloned painting ...

Now, I can create an off-world copy of the cloned painting and use that, but what should I do with that off-world copy - should I delete it or leave it lying around? There is a high probability that it will be needed again in 24 game hours, and even if in that time the player places a copy on the lot, they will just sync themselves.

Neatness is telling me to delete it, but was just wondering if there is a "best practice" for this kind of situation.

W

Just call me William, definitely not Who-Ward
Advertisement
Scholar
#2 Old 7th Apr 2017 at 11:59 AM
You don't have to create it but if you do you should delete when finished or small a bug in your code could cause thousands to be created.

If you use 'Test Object Type' (primitive 0x20) and tick 'return found object in Temp0,1' then you can run the 'Run Tree by Name' on the object without it being on the lot by using the 'push onto my stack by guid (in temp 0 & 1)' Type setting. See the global 'Shops - Open Store' (0x051B) for an example.
Back to top