Been seeing a lot of questions about recently asking about hacking and changing behaviors. This is a really slippery topic to write tutorials about, because the standard walkthrough style tutorial can only teach how to do one specific hack, and can be very hard to generalize beyond that particular example. So I had a go at writing a guide to BHAV theory, the bits and pieces that make it easier to edit BHAV files intelligently.
I am NOT an expert on BHAVs. Not even close! Absolute amateur compared to many people on this forum. This document just combines a lot of bits and pieces of information I garnered from this and similar forums over the last several months. So a word of warning - there may be mistakes in this document, but I promise I've done my best to discuss only things I was reasonably certain about.
Specific questions are welcome, (that is, "what did you mean by...?" and "could you explain this part in more detail?"). Generic questions are less welcomed ("how do I make an object?" or "where can I get SimPE?",) and are more likely to result in a polite redirection to a more relevant forum. Corrections, suggestions and criticisms are also entirely welcome.
This document is subject to future modification (in case I fouled something up!)
well i for one will be the first to post and read your guide. Perhaps if i get the theory down, i will have a better understanding of why i do this, or why when i do this, this doesn't work sorta stuff. thanks so much
You did a good job on it. It is hard to help people to understand Simantics. What I usually tell everyone is, Simantics is a language. It's a language that is made up of numbers, but it is still a language, and it can be learned if you are persistant.
Thanks a lot, Echo, I was looking forward to something like this a long time! It is somewhat difficult to find a source of information about this that is a basic overview and does not only rely on one specific topic. Great work!
Really good thing. I used many basic tutorials but still could not get into details: "why this thing has to be modified that way" and "will it still work if i try to change this BHAV code". With Echo's tutorial it is easier to figure out how to get desired results. Thanks.
Don't know much about programming (or modding yet), but this was very, very useful. Thanks to the bit about opcodes numeration, and where to extract (from objects), was able to edit the bhav's for the whole game. (Was making new package in SimPE and importing semiglobals, but those were'nt of the 2000's instance, and so nothing changed despite changing those bhavs.) The t-f thing was fairly evident, but i wasn't completely understanding until reading this guide that those lines are (some of them anyway) calls to other globals. Thanks for this guide, was looking for something to explain it in this way instead of the basic lets change an objects bhav tutorial. I think now I can do just about anything with the bhav's. thankya thank ya thank ya
Okay, I made it to page 7 by now, and so far it's great - I love that finally I'm getting explanations for the terms which I find all over the forums: what is SimAntics, what is BHAV, what in all heck is a global, what do the numbers mean...
So, thanks a bunch!
"There are many resources online that are excellent at explaining these concepts."
But: Where? Because at that point, and later on, I have a dim idea at best of what concepts those are. The best I can do is wait for the first unknown expression and then google "tutorial *expression*" and wade through the first dozen of links.
If you have any recommendation, it would be great if you added them, and it would save a lot of time-consuming searching.
It's worth repeating myself on this: getting an understanding of all the terms is great, it means that I don't have to follow walk-throughs blindly but know what I'm doing. Many many thanks!
Thank you so much! I realy have enjoyed seeing my sim dancing in front of the painting! The tutorial was exelent and I was able to understand it without having any programing experience whatsoever.
However when I started try to make the object interactions for the toddler instead I got stucked. When I make the same changes for the object as in the tutorial but for toddlers only the object turn to be unplacable at the lot.
I have tried with different objects, the painting and toddler object. Do you know why this happeneds or can you tell me wich object will be good to start with to make a toddler object. To start with I only want them to crawl to the object and then sit down.
Are you able to post a copy of the object here (or on the tutorial thread)? Toddler interactions are slightly different to adult interactions, but most of the stuff in the tutorial ought to work just fine for toddlers (assuming you want hula dancing toddlers, of course!). Being unplaceable makes me think it's not related to the interactions, but to some other change. Placeability is determined before any of the interaction code is accessed normally.
The name given to a BHAV is just for human reader benefit, it doesn't actually do anything to the system. If you still have the earlier drafts, I'm still happy to take a look and see if I can figure out what you did differently, but it's your call.
The animation lists are the same for all objects, so you don't need to clone a different object. (Just about everything I make is based on sculptures or paintings these days.) If your object doesn't have a table for toddler animations, just make one for it. All you need is a text list with the instance number of 0x89.
The name given to a BHAV is just for human reader benefit, it doesn't actually do anything to the system.
This is not true. The name of a BHAV *USUALLY* doesn't matter, but BHAVs can be invoked by Run Tree By Name, which DOES use the name. So arbitrarily changing the names of BHAVs on cloned objects can caused them to behave strangely.
Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
The name given to an Interaction is just for human reader benefit, it doesn't actually do anything to the system. The same is true for object functions, events, and most other BHAVs, with the exception of those that get run using a "Run Tree By Name" call. These often (although not always,) have names that begin with "CT", to help differentiate them to the reader.
As far as telling a toddler to quit when it's tired... Let me rephrase your question, as it may make the answer a little more obvious:
If "My motive (Energy) < -60" is true, then finish the interaction. Otherwise, keep going in the loop.
The tutorial should show you how to manage If statements like that, but if you're still stuck PM me and I'll send you the code.
As an extra note, if your object is only ever going to be used by toddlers, then it's good practice to specify the toddler list in the "Animate Sim" commands, rather than the adult list. If you look at your Animate Sim commands, you'll see one of the operands is "81". Change that to "89". That box is just saying which text list to look at first. In your case, it'll make the Animate Sim commands actually display the correct description for the animation you're running.
Of course, since toddlers that run the animation will automatically look to that table anyway it's not strictly necessary, it just makes the code a bit clearer.
I have been playing around with the potty animation, I thought I would like to make a little chair for the toddler.
I have two problems. I think I need to tell the toddler to go to a routing slot, but I dont know where to set that value.
It looks like I have to snap the toddler to the object to get the animations to work but I dont know where to set that either.
I have done some reading about routing slots and it seems to be rather complicated. I made it the other way around instead. I cloned a potty and deleted the BHAV that have to do with training and bladder and set it only awalible for toddlers to use. It actuelly worked!
This site is not endorsed by or affiliated with Electronic Arts, or its licensors. Trademarks are the property of their respective owners. Game content and materials copyright Electronic Arts Inc. and its licensors. All Rights Reserved.