Quick Reply
Search this Thread
Forum Resident
Original Poster
#1 Old Yesterday at 1:21 PM
Default Help with "Run Tree By Name"
I am not exactly sure how "Run Tree By Name" works, and I am hoping for some help understanding it.

Simple version: If I want a BHAV associated with one object to run a BHAV associated with another object, I can use "Run Tree By Name". If there are multiple BHAVs with the same name attached to similar objects, how do I make sure that it runs the right one (or returns false if the right object doesn't have the appropriately named BHAV)?

Longer version: There is an object in game called "Job Finder" that generates the five different careers available to find a job in each day. I want it to change how it chooses careers based on (a) whether I have added a new BHAV to that career, and if so (b) the information provided by that BHAV (it will assign values to various Temps, which I can then use to remove other jobs as options for that day). The game generates all the careers as invisible objects in each lot, and the career I want to look at would be the Stack Object when I use "Run Tree By Name". Would that work, and what settings would I need?

Thank you very much for any suggestions.
Top Secret Researcher
#2 Old Today at 1:46 AM
Yes, the TreeByName is taken from the current stack object that was selected seleced by 1F. The name of the tree to search for is picked from your own object (Job Finder), its semiglobals, or globals. You can add a string resource 12F with a name to Job Finder, or use one of the existing global names without conflicts. Doesn't matter much what the name says. Unselect the boxes for SemiGlobals and Globals because it doesn't make sense to go up in scope in this case, and only search the stack object's private. Usually you use the method Push Onto My Stack, then the result will be written into your temps, and you will wait until the called tree completes. Run in My Stack works the same but can only execute instantaneous scripts without idle, which would be ok in this case too.

I am not familiar with how Job Finder works specifically, and if there could be a better solution.

https://modthesims.info/wiki.php?title=0x001C

Back to top