Trying to redirect BHAV to new BCON
|
#1
20-07-2015
Hey guys.
I'm working on a mod project, and one of the possible solutions would be to clone a BCON and redirect the BHAV to the new one. This is because the BCON appear to be used by more than one BHAV, so modifying it could have unwanted side-effects.
I've been given to understand that the way to do that would be to keep group ID intact, but change instance number to a unused instance number within that group. I'm not entirely familiar with how the game reads things, and I wonder, does the instance number have to be in order? By that I mean, does the new instance number have to be in rising order? Meaning, do I need to find the highest instance number in the group and change mine to exactly one above that? The reason I wonder is because there are hundreds of objects in this group, and I don't know of a way to sort by instance number and group number, and trying to figure out what the highest instance number is, is giving me a headache.
Second, I can't get the BHAV to recognize the new BCON. When entering the instance number I gave it, it says not found (Picture: http://tinyurl.com/od3q2fe), and if I click away from the box it changes the number (700 becomes 070). I'm sure there's a reason behind it that I'm not understanding. Anyone who could explain to me what I'm doing wrong? Or is it simply that the instance number has to be one above the previous highest?
I'm working on a mod project, and one of the possible solutions would be to clone a BCON and redirect the BHAV to the new one. This is because the BCON appear to be used by more than one BHAV, so modifying it could have unwanted side-effects.
I've been given to understand that the way to do that would be to keep group ID intact, but change instance number to a unused instance number within that group. I'm not entirely familiar with how the game reads things, and I wonder, does the instance number have to be in order? By that I mean, does the new instance number have to be in rising order? Meaning, do I need to find the highest instance number in the group and change mine to exactly one above that? The reason I wonder is because there are hundreds of objects in this group, and I don't know of a way to sort by instance number and group number, and trying to figure out what the highest instance number is, is giving me a headache.
Second, I can't get the BHAV to recognize the new BCON. When entering the instance number I gave it, it says not found (Picture: http://tinyurl.com/od3q2fe), and if I click away from the box it changes the number (700 becomes 070). I'm sure there's a reason behind it that I'm not understanding. Anyone who could explain to me what I'm doing wrong? Or is it simply that the instance number has to be one above the previous highest?
gummilutt, proud to be a member of LeeFish since Jun 2013.
#2
20-07-2015
Let me list a few things, @gummilutt, to help you make the right choice.
I hope that this helps. If not, then please let me know, ok?
- First, you should at least not choose a lower number, because those are most likely already all in use, just like the BCON you're planning to clone. So the only way to go is UP.
- Next, it is just convenient and sensible not to leave gaps in the numbering. Because that would force others who might end up in a similar situation, to start looking for gaps. Don't do to others, what you don't want to have them do to you!
- Last, finding the next number is not at all that hard.
- First, using the filter to the right side of the screen, filter out the group (by Group ID) that you're looking at.
- Second, select "Behavior Constant" [BCON]" in the resource tree to the left.
- Third, at the top of the resource list in the middle, click twice (no double click) on the "Instance" tag.
- Now you see only BCONs listed, and they're perfectly in descending order, highest numbered at the top and then going down... Could not be any simpler!
- Absolutely the last thing: if the top BCON is numbered 0x007F (127 decimal), you'll be stuck, because the game doesn't accept BCONs with a higher number.
I hope that this helps. If not, then please let me know, ok?
#3
20-07-2015
@BoilingOil Thank you BO! Really, I can't say how grateful I am that I am able to ask these questions to someone. It makes learning so much easier.
Good to know that it doesn't have to be in order, but it's nice if it is. I always do it in order when creating myself, but it's useful to know it's more about making it easy later than it being required. And thank you for teaching me the filter thing exists, that's going to make looking at code so much easier. I also thought instance numbers were group specific, but I see now that it's also type of thing within group specific, so BCONs have their own and BHAVs and so on.
I have a stupid question that I've been wondering for a while. You write that the highest is 0x007F, but that's only 6 digits. In SimPE, instance numbers are 8 digits. I've seen the same thing in tutorials and other places. What's the difference between 6 digits and 8, and how does one translate 6 to 8 for SimPE? The highest BCON in the group is 0x0000017F.
Last night I figured out how to completely remove the motive part from the BHAV, so that the BCON is no longer needed. I would however like to also offer a version with BCON intact, for those who do like the motive changes but would like to alter the rate. But then I figured I'm unlikely to be the only one to have cloned a BCON in this group, as it seems to hold a lot of frequently used stuff, and if someone used the same instance number I pick for their creation, then they would conflict. Yet I can't go around looking at every mod ever made with a BCON in it. Should I just pick one, and wait to see if anyone finds a conflict?
Good to know that it doesn't have to be in order, but it's nice if it is. I always do it in order when creating myself, but it's useful to know it's more about making it easy later than it being required. And thank you for teaching me the filter thing exists, that's going to make looking at code so much easier. I also thought instance numbers were group specific, but I see now that it's also type of thing within group specific, so BCONs have their own and BHAVs and so on.
I have a stupid question that I've been wondering for a while. You write that the highest is 0x007F, but that's only 6 digits. In SimPE, instance numbers are 8 digits. I've seen the same thing in tutorials and other places. What's the difference between 6 digits and 8, and how does one translate 6 to 8 for SimPE? The highest BCON in the group is 0x0000017F.
Last night I figured out how to completely remove the motive part from the BHAV, so that the BCON is no longer needed. I would however like to also offer a version with BCON intact, for those who do like the motive changes but would like to alter the rate. But then I figured I'm unlikely to be the only one to have cloned a BCON in this group, as it seems to hold a lot of frequently used stuff, and if someone used the same instance number I pick for their creation, then they would conflict. Yet I can't go around looking at every mod ever made with a BCON in it. Should I just pick one, and wait to see if anyone finds a conflict?
#4
20-07-2015
I'm glad that my explanation helped you that much, @gummilutt! Working with Sims code will be a lot easier, once you get through all these basic methods to filter, order and arrange what your looking at. Trust me; at first it gets a lot harder, because heck... this is SimAntics and we have no manual. But eventually, it *will* be easier!
Thing with the digits is this: the "0x" is not part of the digits. It is an identifier that normally ALWAYS preceeds hexadecimal code, just so everyone will *know* that it's hexadecimal code!
So "0x007F" is a FOUR digit code, and it can also be written as 8-digit code "0x0000007F", or - without the 0x - as 0000007F. In FRONT of the number, the 0x is like the $ in money, and the 0000's don't count. Like on your bank account $0,000,000,100.00 is merely a hundred dollars, just like $100.00.
And to your last question: yup, that's how it works. Since there is no database of all the stuff that everyone made for the Sims, nobody knows which BHAV and BCON numbers have already been used by anyone for any purpose. There are millions of player AND coders out there, and they've surely made billions of mods... try to figure THAT out! So what you do is pick the lowest number you can. And if someone tells you that it conflicts with something, you pick a NEW number, and again and again, until nobody complains anymore.
BUT... if you correctly cloned the object, the Group ID for your new object is most probably just 0x7FFFFFFF. And that is a very special group: every object that has this group number, only shares its code WITHIN the package. So if another person for another cloned object of exactly the same original ALSO uses your BCON number, they still will NOT conflict, because it is in another file!
Really, most of the modded objects out there (like 999 out of every 1000) are made by modders (and I use that term lightly, because most are just morons with a computer) who have no idea what they're doing. They just hit the "clone" button, because SimPE makes it that simple, and now they have a cloned object... They 'eff around' with the bloody thing until it does what they want it to do, and then they put it on MTS or TSR as the next best thing. And there is never a conflict, because of how cloning works.
YOU are smarter than that, and ask some effing intelligent questions about how to do stuff *correctly*. So don't you say again that your questions are dumb or silly or stupid. It's GOOD to ask questions, because that shows that you want to LEARN something! Be PROUD of that, ok? Because really, @leefish, @celebkiriedhel, @NixNivis, Cyjon, Pescado, TwoJeffs, Inge Jones and many, many others who are now called great modders... they ALL started out knowing nothing! Some figured it out on their own, but most of them had the guts to ask questions when they didn't get it on their own! *I* started out that way too. That's normal.
Thing with the digits is this: the "0x" is not part of the digits. It is an identifier that normally ALWAYS preceeds hexadecimal code, just so everyone will *know* that it's hexadecimal code!
So "0x007F" is a FOUR digit code, and it can also be written as 8-digit code "0x0000007F", or - without the 0x - as 0000007F. In FRONT of the number, the 0x is like the $ in money, and the 0000's don't count. Like on your bank account $0,000,000,100.00 is merely a hundred dollars, just like $100.00.
And to your last question: yup, that's how it works. Since there is no database of all the stuff that everyone made for the Sims, nobody knows which BHAV and BCON numbers have already been used by anyone for any purpose. There are millions of player AND coders out there, and they've surely made billions of mods... try to figure THAT out! So what you do is pick the lowest number you can. And if someone tells you that it conflicts with something, you pick a NEW number, and again and again, until nobody complains anymore.
BUT... if you correctly cloned the object, the Group ID for your new object is most probably just 0x7FFFFFFF. And that is a very special group: every object that has this group number, only shares its code WITHIN the package. So if another person for another cloned object of exactly the same original ALSO uses your BCON number, they still will NOT conflict, because it is in another file!
Really, most of the modded objects out there (like 999 out of every 1000) are made by modders (and I use that term lightly, because most are just morons with a computer) who have no idea what they're doing. They just hit the "clone" button, because SimPE makes it that simple, and now they have a cloned object... They 'eff around' with the bloody thing until it does what they want it to do, and then they put it on MTS or TSR as the next best thing. And there is never a conflict, because of how cloning works.
YOU are smarter than that, and ask some effing intelligent questions about how to do stuff *correctly*. So don't you say again that your questions are dumb or silly or stupid. It's GOOD to ask questions, because that shows that you want to LEARN something! Be PROUD of that, ok? Because really, @leefish, @celebkiriedhel, @NixNivis, Cyjon, Pescado, TwoJeffs, Inge Jones and many, many others who are now called great modders... they ALL started out knowing nothing! Some figured it out on their own, but most of them had the guts to ask questions when they didn't get it on their own! *I* started out that way too. That's normal.
#5
20-07-2015
@BoilingOil Thank you, for the answers and encouragement! I'm glad you don't think my questions are stupid, for some reason I tend to expect the Pescado-type reply. Silly, really, since almost everyone I've come across in the simming community has been very kind and helpful.
What I'm trying to make is a global mod that removes the hygiene tank from reading Sci-Fi books. As a proper nerd I find the notion that sci-fi makes you dirty kind of offensive, and really, hygiene drops as if the Sims were rolling in stinky mud. Makes no sense whatsoever. Because I want it to be global, I didn't clone a book case, I extracted the BHAV that controls motive changes, and the BCON it pulls rates from, and made a package file with the two.
Like I said in my previous post, last night I figured out how to simply edit the BHAV and remove motive loss from it. The reason I still want to try and create a BCON-including version is because there are three books that have motive changes beyond fun, and which ones bug people and how it bugs them is going to vary. The hygiene I find stupid, but hunger from cook books and social from romance makes a little bit of sense, although the rates are too steep. If people could simply edit motive drain rate in the BCON to their preference, there's room to accommodate every preference in one file. Plus, this way I learn more stuff
Thanks to your instructions/explanations, I now understand the instance part and what I should change it to. But the problem I mentioned in the first post remains. Attempting to change the instance number called by BHAV causes a "not found"-message, and if I click away from the box I edited, it will automatically change what's written from 180 to 018. Using an existing BCONs works, but my new one, nope. Any idea what's up with that?
Looking at the line it calls a global BHAV, which in turn calls another global BHAV that says there are 4 args, and lists which these are. Those 4 are what appears in the pop-up wizard when trying to edit the line in the first BHAV. I'm not sure what that all means, but it looks to me like the other two bhavs tell the frame of what it wants to do, and the first bhav holds the information to put in the frame. In this case, info on which bcon to pull data from. Is that correct, or am I misunderstanding it?
What I'm trying to make is a global mod that removes the hygiene tank from reading Sci-Fi books. As a proper nerd I find the notion that sci-fi makes you dirty kind of offensive, and really, hygiene drops as if the Sims were rolling in stinky mud. Makes no sense whatsoever. Because I want it to be global, I didn't clone a book case, I extracted the BHAV that controls motive changes, and the BCON it pulls rates from, and made a package file with the two.
Like I said in my previous post, last night I figured out how to simply edit the BHAV and remove motive loss from it. The reason I still want to try and create a BCON-including version is because there are three books that have motive changes beyond fun, and which ones bug people and how it bugs them is going to vary. The hygiene I find stupid, but hunger from cook books and social from romance makes a little bit of sense, although the rates are too steep. If people could simply edit motive drain rate in the BCON to their preference, there's room to accommodate every preference in one file. Plus, this way I learn more stuff
Thanks to your instructions/explanations, I now understand the instance part and what I should change it to. But the problem I mentioned in the first post remains. Attempting to change the instance number called by BHAV causes a "not found"-message, and if I click away from the box I edited, it will automatically change what's written from 180 to 018. Using an existing BCONs works, but my new one, nope. Any idea what's up with that?
Looking at the line it calls a global BHAV, which in turn calls another global BHAV that says there are 4 args, and lists which these are. Those 4 are what appears in the pop-up wizard when trying to edit the line in the first BHAV. I'm not sure what that all means, but it looks to me like the other two bhavs tell the frame of what it wants to do, and the first bhav holds the information to put in the frame. In this case, info on which bcon to pull data from. Is that correct, or am I misunderstanding it?
#6
20-07-2015
On those questions, I'll have to get back to you later, because I don't have my PC at the restaurant...
But here's a wild idea: why don't you just edit the BCON to more reasonable values for reading SciFi books? It should just be one or two lines of all there is in the file, and they shouldn't affect anything else!
But here's a wild idea: why don't you just edit the BCON to more reasonable values for reading SciFi books? It should just be one or two lines of all there is in the file, and they shouldn't affect anything else!
#7
20-07-2015
The reason I don't want to edit the original BCON is because I am not sure that it's not being used in other places. Books only affect fun, social, romance and hygiene, but the BCON it uses has all motives, including water for Plant Sims and scratch/chew for pets. It seems unlikely that they would make the BCON have all motives, it they aren't actually using all of them. And if it's used in more places, what's to say they don't use the hygiene one elsewhere too? I wouldn't want to accidentally affect some other activity, and it'd be very hard to test to make sure it doesn't.
And while this project could be solved by just editing the bhav, I feel like knowing how to redirect a bhav to a new bcon is something I might want to do in some other project down the road, so I'd like to learn how it's done
Sorry, I realize now that my questions rather assume you've seen the code, which you obviously haven't. I'll add screenshots, so that it makes more sense. But if you are busy then don't feel pressured to look at it now (or ever, for that matter), there's no hurry
Primary BHAV
http://i740.photobucket.com/albums/xx43/...1zun6j.png
Second BHAV
http://i740.photobucket.com/albums/xx43/...t2l0qz.png
The third one is really long so I won't add pictures. It contains a bunch of Expressions, a Set Motive Change for each possible motive, and a few other random stuff like "Is Pet a cat?" and Verify Person ID. But it differs from the first two in that the lines can't be edited with pop up wizard, which is why I'm thinking it might just be a frame telling the other two what data they should hold.
And while this project could be solved by just editing the bhav, I feel like knowing how to redirect a bhav to a new bcon is something I might want to do in some other project down the road, so I'd like to learn how it's done
Sorry, I realize now that my questions rather assume you've seen the code, which you obviously haven't. I'll add screenshots, so that it makes more sense. But if you are busy then don't feel pressured to look at it now (or ever, for that matter), there's no hurry
Primary BHAV
http://i740.photobucket.com/albums/xx43/...1zun6j.png
Second BHAV
http://i740.photobucket.com/albums/xx43/...t2l0qz.png
The third one is really long so I won't add pictures. It contains a bunch of Expressions, a Set Motive Change for each possible motive, and a few other random stuff like "Is Pet a cat?" and Verify Person ID. But it differs from the first two in that the lines can't be edited with pop up wizard, which is why I'm thinking it might just be a frame telling the other two what data they should hold.
#8
20-07-2015
Ok, one important thing, then. You mentioned that when you try to redirect the BHAV to a new BCON, it says that the BCON is not found. Have you made the BCON already? Because you cannot redirect to a BCON that doesn't exist yet!
And remember, as you said that this is a Global thing, I feel I must warn you: the Global group already uses ALL the available BCON numbers from 0000 up to 007F. (In decimal numbers, that's 0 to 127). You cannot make a higher numbered BCON than that, because the system doesn't understand that. Trust me, I've tried it and I hit my head hard!!!
And remember, as you said that this is a Global thing, I feel I must warn you: the Global group already uses ALL the available BCON numbers from 0000 up to 007F. (In decimal numbers, that's 0 to 127). You cannot make a higher numbered BCON than that, because the system doesn't understand that. Trust me, I've tried it and I hit my head hard!!!
#9
20-07-2015
Hm. I did create the BCON already, it's in the same package as the BHAV. The screenshots show the instance number as the old one, I decided to make a model package to look at the original code in, so that's why it's not changed
I thought I had understood the instance-thing but I don't think I have. As I understand hex goes from 1-9 and then A-F. You say the highest the game can read for BCONs is 007F, which I interpret as starting on 0000, going up to 007F. But the game code for this group starts at 0100 and ends at 017F, which in my mind is higher than 007F. But 100 to 17F is 127 values, so is it that it can only hold that many, but the actual number doesn't have to be 0000 to 007F?
Should I just give up and settle for editing BHAV, or is it possible to create a whole new group for the new BCON and redirect the BHAV to that group instead?
I thought I had understood the instance-thing but I don't think I have. As I understand hex goes from 1-9 and then A-F. You say the highest the game can read for BCONs is 007F, which I interpret as starting on 0000, going up to 007F. But the game code for this group starts at 0100 and ends at 017F, which in my mind is higher than 007F. But 100 to 17F is 127 values, so is it that it can only hold that many, but the actual number doesn't have to be 0000 to 007F?
Should I just give up and settle for editing BHAV, or is it possible to create a whole new group for the new BCON and redirect the BHAV to that group instead?
#10
20-07-2015
Sorry, I had not looked at those screenshots yet, because I was using my piece-of-<something-filthy> phone at the time - as I said, I was at a restaurant But I see from those shots now, that you are indeed working with group 0x7FD46CD0 - the Global group, the group that allows only that specific range of BCONs.
Ok, I may have forgotten about the 1 in the BCON number... it was quite a while ago that I was battling the same kind of problem. So in that case it's 100 to 17F, the difference is the same. It's 127 BCONs, and that's the end of it. Believe me, when *I* needed a new BCON in the Global group, I slammed my face into that same wall over and over again, because the game will just keep repeating that it cannot find the BCON. Sorry, but there is nothing you can do, except trying to find some other way to store your numbers.
An idea is to just go back to the original idea, and maybe for this special case add some new values at the bottom of the existing BCON, and use those for the SciFi-book thingy. Sure, others may already be using that BCON, but that doesn't matter. If someone tells you that there's a conflict with mod 'so-and-so', you DL that mod, check that it's a BCON conflict, and then you import the BCON from that other mod into your own and make the same changes again. Now your mod will still conflict with the other one, but as long as you warn people that your mod must load AFTER the other one, it will be compatible because you included the changes that the other mod requires! THAT is how modders solve such conflicts
Ok, I may have forgotten about the 1 in the BCON number... it was quite a while ago that I was battling the same kind of problem. So in that case it's 100 to 17F, the difference is the same. It's 127 BCONs, and that's the end of it. Believe me, when *I* needed a new BCON in the Global group, I slammed my face into that same wall over and over again, because the game will just keep repeating that it cannot find the BCON. Sorry, but there is nothing you can do, except trying to find some other way to store your numbers.
An idea is to just go back to the original idea, and maybe for this special case add some new values at the bottom of the existing BCON, and use those for the SciFi-book thingy. Sure, others may already be using that BCON, but that doesn't matter. If someone tells you that there's a conflict with mod 'so-and-so', you DL that mod, check that it's a BCON conflict, and then you import the BCON from that other mod into your own and make the same changes again. Now your mod will still conflict with the other one, but as long as you warn people that your mod must load AFTER the other one, it will be compatible because you included the changes that the other mod requires! THAT is how modders solve such conflicts