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!
Forum Resident
Original Poster
#1 Old 26th Nov 2017 at 2:12 AM
Default Adding an item to inventory after an interaction completes
So, I managed to get my sim to go on a hike by interacting with an object. However, now I need to add items to their inventory when they return from the hike.

I tried adding inventory commands before and it stopped the BHAV from operating correctly. Now, my sims won't hike. Where do I add the inventory commands to my hiking BHAV?

For my physical health, I can't eat cheesecake everyday.
For my mental health, I imagine eating cheesecake everyday.
It's a delicate balance.
Advertisement
*shrugs*
retired moderator
#2 Old 26th Nov 2017 at 5:53 PM
You would add them whenever you want the item added to the Sim's inventory. If you want it to appear while they are on the hike, that's where you would put it.

Without being able to see your BHAV code, it is hard to say where the problem is. Feel free to post your object here for others to look at.

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Forum Resident
Original Poster
#3 Old 27th Nov 2017 at 4:42 PM
@maybesomethingdunno Thank you! I've attached both a picture and the file is below.

Here's what I'm trying to do: With the hiking interaction as a basis, I want my sim to leave the lot for a while, then return with an item in their inventory. But I am still rather amateur with the operands and opcode.

I do know I'll need to fix the hiking interaction later (Because they aren't hiking. They'll be trick or treating. I don't want random hiking elements or consequences popping up later.) I'm also thinking of the sim carrying a bag off lot and when they return, but I'll worry about pipe dreams later.

Attached files:
File Type: zip  Trick or Treat.zip (76.0 KB, 8 downloads) - View custom content

For my physical health, I can't eat cheesecake everyday.
For my mental health, I imagine eating cheesecake everyday.
It's a delicate balance.
*shrugs*
retired moderator
#4 Old 28th Nov 2017 at 2:42 AM
If you turn on debug mode (boolProp testingCheatsEnabled [true/false]), it will likely throw an error at node 3. That BHAV node needs to be Temp 0x000 not Temp[Temp 0x000].

So long as you are using the hiking controller and its interaction, the Sim's interaction is literally going to be the hiking interaction. You will want to use your own interaction so they don't return covered with poison ivy Furthermore, I think once you have pushed an interaction from another object onto a Sim, they will leave the current interaction. What I mean is that the hiking interaction will replace the Sim's current action on your object. The Sim will get back from the hike and their action queue will be empty; they do not continue down to where you are adding the inventory code to add the candy.

If you want to use a controller, clone the hiking controller, take out the hiking-related elements you don't want, and add the elements you do want (like getting treats) into it.

Otherwise, you would want to look at the hiking controller or a mod like Smonaff's Jogging Mod to see how to make a Sim walk to a pedestrian portal, leave the world, and come back. Extract that technique and put it into a self-contained interaction inside your object instead of pushing the interaction onto a Sim from a controller object.

Whichever of those depends upon how you want the interaction to be initiated.

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Forum Resident
Original Poster
#5 Old 1st Dec 2017 at 6:41 PM
@maybesomethingdunno So, in other words, I'm probably better off putting together my own interaction and using elements like Smonaff's mod. That might be my best bet. In that case, my main work is figuring out how to get them off world then come back after a certain period of time.

For my physical health, I can't eat cheesecake everyday.
For my mental health, I imagine eating cheesecake everyday.
It's a delicate balance.
*shrugs*
retired moderator
#6 Old 1st Dec 2017 at 11:30 PM
Yes, either do something similar to Smonaff's mod, some other similar mod, or the hiking controller that you are spawning.

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Back to top