Home | Download | Discussion | Help | Site Map | New Posts | Sign in

Latest Site News

Nysha's New Creators for November - posted on 1st Dec 2017 at 10:00 AM
Replies: 5 (Who?), Viewed: 1221 times.
Forum Resident
Original Poster
#1 Old 26th Nov 2017 at 3: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?

You can't lie to me. I play Town Of Salem.
Advertisement
*shrugs*
staff: moderator
#2 Old 26th Nov 2017 at 6: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 5: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.

Download - please read all instructions before downloading any files!
File Type: zip Trick or Treat.zip (76.0 KB, 5 downloads) - View custom content

You can't lie to me. I play Town Of Salem.
*shrugs*
staff: moderator
#4 Old 28th Nov 2017 at 3: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 7: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.

You can't lie to me. I play Town Of Salem.
*shrugs*
staff: moderator
#6 Old 2nd Dec 2017 at 12:30 AM
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