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!
Retired Duck
retired moderator
Original Poster
#1 Old 25th Mar 2006 at 12:10 PM Last edited by Echo : 17th Apr 2007 at 11:17 AM.
Default Tutorial: Making Your First Custom BHAV
This tutorial steps you through the process of adding a completely new behaviour to an object. It assumes no prior experience with BHAV programming, (or any programming really, although it would certainly give you a head start,) although it does assume reasonable familiarity with the SimPE program. The steps describe the full process, from adding a new item to the pie menu, having the sim walk to your object, manipulating the sim's motives and statistics, having the sim perform actions, adding randomization and decision based paths, safely looping the interaction, and adding guards to limit its use. It aims to explain the concepts and basic steps in a generic way with practical examples, in order to provide the ability to make lots of different sorts of behaviours.

It is made and tested with SimPE 0.56, and is heavily illustrated.

The attached file "Custom Interaction Tutorial.zip" is the PDF version of the tutorial. If you cannot view PDF files, an HTML version of the same tutorial is available at my website here. A copy of the object that was created in this project ("echo-tutorial.zip") is also attached, so you can compare with your own work.

As stated in the tutorial, you are welcome to post any questions you have about the material here. If you are having trouble completing a step, please post the troublesome object along with your detailed description of the problem, so I can find the problem more efficiently (and with less guesswork).
Attached files:
File Type: zip  Custom Interaction Tutorial.zip (1.07 MB, 10083 downloads)
File Type: zip  echo-tutorial.zip (85.0 KB, 4597 downloads)
Advertisement
Consciously Undead
retired moderator
#2 Old 7th Apr 2006 at 4:05 PM
I've been having a problem with the first step- I import the semi-globals, change the groups, then add in a new string. I commit and save, but then in Pie Menu Functions, the new string does not appear. I've tried commiting, saving, and then closing then reopening the package, but to no avail- what could the problem be?

Thanks,

SuperFly

If you're not part of the solution, you're part of the precipitate
Retired Duck
retired moderator
Original Poster
#3 Old 8th Apr 2006 at 1:28 AM
Could you post the object? It makes diagnosing a whole lot easier!

When you went to the pie menu functions, did you follow this part:

Quote:
Click on the "view" option, and press the "Add" button. An exact copy of the "View" option will be added onto the end of the list. Make sure this copy is selected.

Across to the right you should see a drop down list labeled "Pie String ID". Click on this, and you should get a list of all the lines in the "Pie Menu Strings" file. Find the one you just added, and select it. The name of the interaction on the left should change to match it.


Failing that, take a look at the instance numbers of the Menu Strings and Menu Functions - they should match?
Consciously Undead
retired moderator
#4 Old 8th Apr 2006 at 7:16 PM
Ahh, that fixed the problem- thanks Echo

If you're not part of the solution, you're part of the precipitate
Lab Assistant
#5 Old 13th Apr 2006 at 7:29 PM
Default This is fantastic!
Echo, this is without doubt one of the best tutorials available! I have wanted to work on BHAV's ever since I made my fist objects recolor, and just couldn't figure it out. Now, thanks to you, I CAN! The attached pic is of my custom painting, done by this tutorial, with one of my sims dancing in front of it.

I haven't even finished the tut yet. I only have gone as far as putting the hula dance in the list of BHAV's, but I'm so excited I just couldn't wait to thank you. As you may be able to see looking at the pic, I went ahead and maxed out all the motives with my painting. also, it's using a custom mesh and texture file. The painting really is from a painting, one of my own watercolors.

Now all I have to do is finish the tut, tweak this object so it works just how I envisioned it, and offer it up here. Then go on and do the "magic" system I've been dreaming of since I started. I'd like to figure out how to make it a skilling system like from your Harry Potter magic skilling system. I've got so many ideas! *brain starts to overheat* Don't know if I can figure that out, but I want to try so much.
Screenshots

“Meddle not in the affairs of the dragon; for you are crunchy and taste good with ketchup.”
-unknown
Retired Duck
retired moderator
Original Poster
#6 Old 14th Apr 2006 at 2:10 AM
Looks pretty much perfect to me! Very cool!

There's not much in the tutorial about proper skilling (it was on the original draft, but the explainations were getting quite complicated and, well, the tutorial was already pretty long) but if you get to the end and decide you want to use the magic-skilling system let me know and I'll give you a quick rundown on how to make your object use the hidden magic skill. If you were wanting to create your own hidden skill I can probably help with that too, although it's a little more complicated.

PS - The painting's gorgeous! My paintings tend to come out looking a lot like that Llama painting sims with very low creativity skill make, so I'm in awe.
Lab Assistant
#7 Old 14th Apr 2006 at 3:03 AM Last edited by dragonarts : 14th Apr 2006 at 7:35 PM.
The corners of the texture got messed up when I resized the new mesh, so I have to redo the UV map and fix it. Won't take long... And I wanted to give more options than just maxing all the stats at once.

As for the skilling, I think the magic skill would work nicely, but the type of effects are very different. Actually, I'm not totally sure modding can accomplish everything I want to have happen, but I'm sure I can get some of it in place.

What I have in mind is, well... big. A whole system. I developed a type of powers for a book I mostly got written, and then developed the system of powers into a Dungeon and Dragons class for my son to use. (he likes to play) If you've read any of my threads, and seen the Kii skins you've seen a tiny bit of what I've developed. Not that these powers would be limited to my custom skins. But there are 8 "realms", and each realm has 4 aspects. Even if I give each aspect of each realm only one effect, that's still 32 powers. And eally, they should each have at least 3 or 4. So that would be... um... lots of things to have happen. I haven't got all the effects worked out on paper yet. If I use the magic skilling, then powers would build, as skill builds. Aspects could stack, but you still have 8 realms.

Yes, I really appreciate your offer to help. I'll probably come begging. Thanks.

“Meddle not in the affairs of the dragon; for you are crunchy and taste good with ketchup.”
-unknown
Lab Assistant
#8 Old 17th Apr 2006 at 2:07 PM
Finally, set the value in the "Guardian BHAV" to 0x0. The purpose for this box will be described a little later, but for now, just set it to 0.


Finally, look at the fields for "Action BHAV" and "Guardian BHAV".
??????

The best Sims2 fansite! (Yes, it's even better that MTS2 :-D)
Retired Duck
retired moderator
Original Poster
#9 Old 19th Apr 2006 at 9:32 AM
Hmm... I do tend to overuse the word "finally" when I forget to proof read. The second is just for consolidation - you don't have to do anything, it's just interesting to look at given what you've just learned.
Lab Assistant
#10 Old 20th Apr 2006 at 6:48 AM
I think this tutorial should be sticky, it really helped me out

The best Sims2 fansite! (Yes, it's even better that MTS2 :-D)
Lab Assistant
#11 Old 20th Apr 2006 at 3:23 PM
I subscribed to the thread so I can always find it. But I agree that making this a sticky would be good. Maybe the Powes That Be here will do that soon. This is a GREAT tutorial.
Space Pony
#12 Old 22nd Apr 2006 at 1:14 AM
Echo,

Thank you for a very well written, easy to follow tutorial that explains how to do things!

I still have much to learn but I keep plugging away at it. Eventually I'll get there
Test Subject
#13 Old 27th Apr 2006 at 6:14 PM
thanks LOADS!!!this is a great tutorial
Guest
#14 Old 27th Apr 2006 at 11:44 PM
Default Super
exellent.
thank's.
Deviant Savant
retired moderator
#15 Old 27th Apr 2006 at 11:59 PM
This is great. Thanks for putting it into such an easy to use format. I'm having much fun with it
Test Subject
#16 Old 10th May 2006 at 7:14 PM Last edited by peregrine : 10th May 2006 at 9:49 PM.
Thank you very much for going to all this trouble. I've done only a very little of this sort of thing before but using trial and error. This is very well written and very accessible, and beautifully presented.

What I would like to know is what do you do if you are using an object which has no pie menu strings/functions in the cloned package NOR in the globals, for instance, plantglobals. I wonder if you could help?
Retired Duck
retired moderator
Original Poster
#17 Old 13th May 2006 at 10:24 AM
You can import pie menu strings and function tables from a different object or semi-global group. Just make sure, firstly, that they both have the same instance ID. Then, go into your OBJd file, open the "Raw data" tab, and find the line that says "Interaction Table ID". Set that value to the instance ID of the pie menu files. If all goes well, you should now have a pie menu again.
Test Subject
#18 Old 19th May 2006 at 12:55 PM
Thank you Echo. Apologies for the delay in reading your post. Have followed your advice and it all works fine.
Having been working through your tutorial again I am really impressed by how clear and helpful it is, and how the explanations manage to lead one on to new and different areas of experimentation. You have a real gift for communication. Thanks so much for doing this.
Test Subject
#19 Old 13th Jun 2006 at 5:27 PM
Hello

Thx a lot for this tutorial !! The light come

But ... (an answer = 2 questions) ... i see items with sub-level menu choice .
I read some with SimPE but i don't really undestand the logical way.

With this sub-level menu choice ... that's an explosion of possibility. can you explain the basis of this concept ?

Any way, your tutorial have answer too many question and thanks again and again
Retired Duck
retired moderator
Original Poster
#20 Old 14th Jun 2006 at 10:36 AM
When you say sub menu, I assume you're talking about when you click on an item in the pie menu, and a second pie menu expands around that? Actually, that's fairly simple to do. In the pie menu strings, you can enter lines like:
Study.../Cooking
Study.../Mechanical
Study.../Cleaning
(pulled from the Bookshelf)
the .../ seperates the menu from the sub-menu. So when that shows up in game, there's a pie menu item called "study", and when you click on that a second level menu opens up with "cooking", "mechanical" and "cleaning" in it. Because each of these is on their own line in the Pie Menu Strings, you can give them each their own line in Pie Menu Functions, and point them to different BHAVs.
Test Subject
#21 Old 14th Jun 2006 at 2:34 PM
GREAT Thank you very much !!!

Your explanation and somes item download ... i undersstand

It's a good day !

Thank you again, you are great
Lab Assistant
#22 Old 14th Jul 2006 at 7:15 PM
Echo u r awesome for making this tutorial.
Test Subject
#23 Old 18th Jul 2006 at 2:19 AM
I'm not sure if this is even worth asking, but I suppose it wouldn't hurt to do so.

I've been using this tutorial to extract animations into a painting for picture/posing purposes and in doing so have come across a good deal of animations that turn up this error (with testingcheatsenabled turned on, otherwise the animations simply doesn't run). The error isn't too surprising since (I assume) it's telling me that it needs a certain bone from another object/Sim to work. However, there are similar animations that work fine.

A good example would the photobooth animations. All of them (normal, goofy, romantic, solo and duet) can be extracted and work perfectly EXCEPT for several of the 'romantic-couple' photobooth poses (there are four poses each for solo, Sim A, and Sim B). I suppose I'm asking why exactly this isn't occurring for all animations that have to do with an object or another Sim. Many 'social' animations (or, animations that involve two Sims) also do this, where one (the 'initiator' or the 'receiver' animation) will work, while the other won't. There's also no set pattern that I've been able to discern with this; sometimes the initiator animations will fail and sometimes the receiver.

Is there a workaround to force these animations into running? Is there something missing from the 'non-working' animations? I'm not really expecting a solution, just information or some input.

Went over the sea, what did I find?
A thousand crystal towers, a hundred emerald cities.
Retired Duck
retired moderator
Original Poster
#24 Old 18th Jul 2006 at 10:28 AM
While it's hard to come up with a hard-and-fast rule for IK animations, they tend to be animations where bones in two objects/sims have to touch one another at a particular time. This isn't always true, but tends to be the pattern. A lot of the social interactions don't have to match up perfectly, or force two objects to touch each other - in these cases, no one is going to notice if one sim's animation is slightly out of sync with another. That's why they don't all end up being IK.

As for a workaround? If there is I don't know of it. The best solution I've been able to come up with was to spawn a transparent clone of the IK object and use that - but that's vastly impractical!
Field Researcher
#25 Old 19th Jul 2006 at 10:23 AM
i think this is one of the most instresing and helpfull tut on bhav... really thnx

about skilling, i wish to see how my sim are learning, i'm talk about the "skill meter"
i've tryed to read the int from the bookcase semi-global....
but i didn't find anythink about "meter" can you help me ?
Page 1 of 16
Back to top