Simblesse Oblige Forum Index Simblesse Oblige
Forums for serious Simmers to share knowledge about The Sims 1
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

BHAV question

 
Post new topic   Reply to topic    Simblesse Oblige Forum Index -> Object Creation and Recolor Shop
View previous topic :: View next topic  
Author Message
KarinL
Moderator
Moderator


Joined: 08 Mar 2007
Posts: 1591

PostPosted: Sat Jun 21, 2008 7:30 pm    Post subject: BHAV question Reply with quote

Hi everyone,

I have a question which may be Snooper related, but I'm not sure...

I was playing around with a BHAV this afternoon. I tend to do 'resequence' when I'm done, to see whether the lines are in the right order, etc.

Now I have a BHAV that has a first line that exits 'true' (253) for both the true and the false option - this is a 'constant' line, so I kind of understand why it would do that...

The problem is, when I 'resequence', everything below the first line is gone.

I checked my lines, and the 'true-false' lines are all correct, but apparently once the first line is read and it exits 'true - true', Snooper figures the rest of it is just filling???

This is the first line:

[ 0] : 0 2: FE FE: 0 6: 0 86: F 0: 1A 7: Test <=

Literal Value [6], Constant Value : 100 // BCON 4097, 6 [Tuning - Comfort]


When I resequence, this is all that is left. Below it were the GUID checks, the actual comfort checks and increase, etc. etc. Which shouldn't be gone??? They're all in order and all the true/false lines are correct.

It's not a big problem, as I can just decide not to resequence, I'm just curious why this is happening. I can't get Pencil to load for me right now, so I can't check whether this is just a Snooper thing... Because if it is, I think I'll have to be more careful with the 'resequence' from now on... :)

Karin[/u]
Back to top
View user's profile Send private message
mtaman
Moderator
Moderator


Joined: 16 Aug 2006
Posts: 2858
Location: Monon, Indiana

PostPosted: Sat Jun 21, 2008 9:31 pm    Post subject: Reply with quote

It may be a Snooper function, Iff Pencil doesn't do that.
Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4088

PostPosted: Sat Jun 21, 2008 10:25 pm    Post subject: Reply with quote

Since the first line ends with True, True it's the only line of code the game ever uses. The rest of garbage/bloat and IffSnooper cleans it out for you.
_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
KarinL
Moderator
Moderator


Joined: 08 Mar 2007
Posts: 1591

PostPosted: Sun Jun 22, 2008 10:13 am    Post subject: Reply with quote

Raeven wrote:
Since the first line ends with True, True it's the only line of code the game ever uses. The rest of garbage/bloat and IffSnooper cleans it out for you.


But I don't think it can be bloat/garbage. I'm trying to edit an object (lounge chair in this case) using the method from SimCollege Lesson 3.

I tried the SimCollege lesson again, and there Snooper does the same thing to the BHAV - and I don't think SimCollege would have a lesson about editing bloat/garbage??
Even if I open the BHAV in un-edited form, resequencing takes out all but the first line, so it's not something I did.

This is the BHAV from SimCollege before editing. What you're supposed to do in the lesson is add 'hunger' motives. I'm trying to do something similar with the lounge chair, adding 'energy'.

Karin

Edit: I understand the 'hacking' part of this - I just don't understand why I can't resequence if this is actually a bit of coding that is used!!



01.gif
 Description:
 Filesize:  6.34 KB
 Viewed:  2600 Time(s)

01.gif


Back to top
View user's profile Send private message
mtaman
Moderator
Moderator


Joined: 16 Aug 2006
Posts: 2858
Location: Monon, Indiana

PostPosted: Sun Jun 22, 2008 1:50 pm    Post subject: Reply with quote

I would think that the chair was changed when Maxis did it and all of the rest of the BHAV is no longer relevant thus bloat. Maxis wasn't very good about cleaning up after themselves. laugh

You might have to find a different place to add energy. Or add your energy line and then change the true return of Line 0 to go to it.
Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4088

PostPosted: Sun Jun 22, 2008 7:18 pm    Post subject: Reply with quote

Quote:
I understand the 'hacking' part of this - I just don't understand why I can't resequence if this is actually a bit of coding that is used!!


It is not being used.

If the first line is a true statement then TRue... the routine ends. It does not go to any other line in the BHAV.

If the first line is a false statement then True... the routine ends. It does not go to any other line in the BHAV.

Those (true statement or false statement) are the only 2 choices.
In no case, under any condition does the first line go to any other line in the BHAV. The program does not skip around and pick lines simply because they exist. It starts wiht the first statement (line) and follows instructions from that point on.

Those lines are bloat.

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
KarinL
Moderator
Moderator


Joined: 08 Mar 2007
Posts: 1591

PostPosted: Tue Jun 24, 2008 5:05 pm    Post subject: Reply with quote

I went back to the instructions and I think I see now - there's this whole thing about editing 4112 to 'practice' and 4113 is the 'real thing.

Somehow I ended up editing that same CT-BHAV for my new object thinking it was the real one...

Snooper is smarter than I am. :) I should have believed it when it said I was editing those lines for nothing... :)

Thanks, mtaman and Raeven! I think I finally 'got' it now... Sorry to be so dense you had to hit me over the head with it several times before I did...
rolleyes

Karin



Picture 1.jpg
 Description:

Download
 Filename:  Picture 1.jpg
 Filesize:  233.36 KB
 Downloaded:  187 Time(s)

Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4088

PostPosted: Tue Jun 24, 2008 6:14 pm    Post subject: Reply with quote

You can lay the blame for the "goose chase" feeling on me ... Graph is innocent.

Originally 4112 was included in the lessons by accident.
When editing and correcting bits of the lessons (I was the ELH instructor for a year or more before SimsCollege closed its doors) I opted to leave it in because practicing reading the lines in different orders is very helpful.

I always got grumbling from students (including Mr. Raeven) about time wasted but Id already been hacking long enough by them to know that learning to follow the code rather than relying on rewrite or requences to put it in perfect order is a huge HUGE asset. More complex BHAVS split off into a ton of If Then branches and loop back around on itself and Rewrite/Resequence can only do so much for you.

I just told most student's "live with it!" laugh but poor Mr Raeven had to go through being sat down and shown a few of these charming BHAVS. It shut him up quite nicely LOL biggrin

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
KarinL
Moderator
Moderator


Joined: 08 Mar 2007
Posts: 1591

PostPosted: Tue Jun 24, 2008 10:06 pm    Post subject: Reply with quote

Raeven wrote:
You can lay the blame for the "goose chase" feeling on me ... Graph is innocent.


LOL!!! Originally I understood what was happening - it says clearly enough that the 4112 is 'practice'. :) (Yes, I grumbled, too! LOL!!)

The trouble started when I wanted to do something similar, decided to use the tutorial as a guide - and then picked up the wrong part of the instructions to follow.

Until I went back and re-did the SimCollege lessons with the chair, and *then* I remembered grumbling about that the first time I did it...

Quote:
but poor Mr Raeven had to go through being sat down and shown a few of these charming BHAVS. It shut him up quite nicely LOL biggrin


And he didn't run away screaming?? Brave man!! laugh

Anyway, I finished lesson three again - this time I did manage to do the STR# and FWAV - which I didn't 'get' before...

Now I'm back to my original project of trying to add 'energy' to a lounge chair... :)

What really had me grumbling last time was lesson 4 - none of what I'm supposed to be trying works for me - since in Snooper, as far as I can see, you have to change *all* of the parameters by hand in most cases for the change to stick - so you can't just add a hex and 'watch the other boxes change' - if you don't change them by hand, nothing happens.
So in a way, I'm not learning anything, since I can only put in those parameters in the lesson, and I don't have the nifty pull-down menu for functions, and can't enter a hex and change paramenters that way...

What made me stop in disgust at that time was not having IffPencil so I could actually make a code book.
I do now, so I'm re-doing that lesson in Pencil to make a *very large* code book to be used witn Snooper... :) :) :)
Once I have most of the parameters written down, I can experiment like in the lesson. I hope.

I might even go on from there, because I *think* I managed my own 'energy raising' chair last night... So I have new confidence. LOL!!

Karin
Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4088

PostPosted: Wed Jun 25, 2008 6:09 pm    Post subject: Reply with quote

One of us must misunderstand

The "other boxes" changing are not the rest of the parameters.

Iffpencil displays the coding in 3 ways: as text in the main window, as 4 decimal parameters (which you can edit) or as 8 HEX parameters (which you can edit). But it's the same code in each place.

I can choose to type "100" into one of the four decimal parameters or I can go to the 2 corresponding HEX parameters and enter 64 00 (which in iffsnooper would probably be 00 64 since peter prefers that direction). If I do the former than 64 00 will be "automatically" entered into the CORRESPONDING hex boxes. If I choose the former then that one corresponding decimal parameter would be updated to reflect that and now read 100.

No code is being automatically entered. The text in the main window and the "other" form of parameters are being updated to reflect the code I have entered, that's all.

My understanding of iffsnooper is that if you choose to view the code in decimal form it WILL display the current code. If you change the code it will be updated. Did I misunderstand that? Do you have to retype everything in the decimal window after putting it in the HEX window?



ip2-DRGPhexboxes.gif
 Description:
 Filesize:  3.79 KB
 Viewed:  2527 Time(s)

ip2-DRGPhexboxes.gif



_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
KarinL
Moderator
Moderator


Joined: 08 Mar 2007
Posts: 1591

PostPosted: Wed Jun 25, 2008 9:08 pm    Post subject: Reply with quote

Quote:
The "other boxes" changing are not the rest of the parameters.


What I mean is, when I enter a new number in the HEX boxes (in the BHAV editor), the parameters do not change.

Quote:
Did I misunderstand that? Do you have to retype everything in the decimal window after putting it in the HEX window?


Exactly. I tried with a BHAV where I changed the first parameter from 20000 to 10000 - so the first digits of the hex changed from 20 4E to 10 27.
Then when I typed in 20 4E instead of 10 27 in the hex boxes, the parameter stayed on 10000.
When I tried to edit the parameter by hand, first it changed the hex back to 10 27 when I clicked in the box to be able to edit it.
And then, when I'd changed it to 20000, the hex changed back again to 20 4E.

So I can change the parameters and watch the hex change, but I can't change the hex and watch the parameters change...

This is the new BHAV editor, by the way. When I export the hex and change it and re-import the changed version, everything does look right.


Likewise, I haven't found a way to actually see what each code does, like you can in Pencil with the pull-down menu.

Which is why I'm going to do that in Pencil and then experiment with what I put in my code book until I understand HOW Snooper works with this information.
I really want to understand how Snooper does this the 'entry level' stuff before attempting to finally go to 'intermediate' level lessons. :)

As an example: one of the functions Snooper does not have, is 'add'. It depends on what I'm adding where, how I do it:

To add a line to a BHAV, I have to export the hex and type in a line of 00 or FF, import the changed BHAV and then edit the hex for my new line. (I suppose if I were clever, I could add the right hex line, but I'm hex-impaired...)
To add a resource, like a FWAV, I have to disassemble, add the resource to the folder (just duplicate and rename one will do) and re-assemble, and then edit the new one.
And I found out (by asking) that to add a line to the STR# I just need to change the 'line count' number in the edit window and immediately after, type in the new line number to the right of that - if I do one and not the other, it sometimes won't 'stick'.

So basically, I can do all I have to do, but it's a challenge sometimes to find out *how* to do it. :) Like a puzzle. laugh

Karin
Back to top
View user's profile Send private message
Raeven
Member
Member


Joined: 24 Aug 2006
Posts: 4088

PostPosted: Wed Jun 25, 2008 9:45 pm    Post subject: Reply with quote

KarinL wrote:
So I can change the parameters and watch the hex change, but I can't change the hex and watch the parameters change...

That sounds like a small glitch that Peter'd likely fix if it's reported to him when he has a chance. I'm still a bit confused why it'd be a big enough frustration to stop the lessonbut it must be a "ya gotta be there" thing. laugh
Quote:
Likewise, I haven't found a way to actually see what each code does, like you can in Pencil with the pull-down menu.
!!!? laugh

Sadly, that drop down menu lists the names of functions and globals, which is nice when you remember to use that (which no one does) but that does not ( not, NOT ) tell you what it "does".
Still if it makes you feel any better to have the list, here you go. (Iff Pencil just pulls it from your own game files, by the way):

Code:

Simantic's Primitives as listed in behavior.iff's STR#139
 0 Sleep (for ticks in Parameters ...)
 1 Generic Sims Call
 2 Expression
 3 Find Best Interaction
 4 Grab
 5 Drop
 6 Change Suit/Accessory
 7 Refresh
 8 Random Number
 9 Burn
10 Tutorial
11 Get Distance To
12 Get Direction To
13 Push Interaction
14 Find Best Object for Function
15 Break Point
16 Find Location For
17 Idle for Input
18 Remove Object Instance
19 Make New Character
20 Run Functional Tree
21 Show String ( UNUSED )
22 Look Towards
23 Play Sound Event
24 old relationship ( DO NOT USED )
25 Alter Budget
26 Relationship
27 Go To Relative Position
28 Run Tree by Name
29 Set Motive Change
30 Gosub Found Action
31 Set to Next
32 Test Object Type
33 Find 5 Worst Motives
34 UI Effect
35 Special Effect
36 Dialog
37 Test Sim Interacting With
38 ~unused
39 ~unused
40 ~unused
41 Set Balloon/Headline
42 Create New Object Instance
43 Drop Onto
44 Animate Sim
45 Go To Routing Slot
46 Snap
47 Reach
48 Stop ALL Sounds
49 Notify the Stack Object out of Idle
50 Add/Change the Action String

AND ADDED WITH EXPANSION PACKS:
Code:
51 Manage Inventory ( 1.x Animate Object in 2.0 )
52 Change Light Color ( 2.0 )
53 Change Sun Color ( 2.0 )
54 Point Light at Object ( 2.0 )
55 ~unused (in Sims Online)
56 ~unused (in Sims Online)


http://www.woobsha.com/diy-simanticsfunctions.html
(not linked to rest of the site because I decided after doing this much that I was being silly and a list of function names could not really ahve very much value)

For the names of the global calls you can, of course, pop a copy of the global.iff open and have it listed. I've never taken the time to pick through and copy and past the names and BHAV numbers of them because it seemed a waste of effort to make a text file or webpage to double click and look at rather than have the global.iff right there (especially since in the latter case I can also actually open the real BHAV to really see what it does)

Quote:
So basically, I can do all I have to do, but it's a challenge sometimes to find out *how* to do it. :) Like a puzzle. laugh


I know the feeling.

I do believe, however, that feeling that you are at a disadvantage puts obstacles in front of you that needn't be there at all.

For instance ... HEX impaired.
The line is 8 HEX numbers. it would be just as easy for you o learn that "assign to" is 05 in the correct HEX spot (in iffpencil's case it's the 6th HEX box but It might be the 5th for IffSnooper?) as it is to learn "1280" needs to be entered in the correct decimal parameter spot.

That lots of people beat clothing on a rock in a river for a long long time does not mean that's easier than a washing machine.

_________________
"Laws control the lesser man... Right conduct controls the greater one." -Mark Twain
Back to top
View user's profile Send private message Visit poster's website
peter9g
Member
Member


Joined: 03 Sep 2006
Posts: 507

PostPosted: Wed Jun 25, 2008 11:59 pm    Post subject: Reply with quote

KarinL wrote:

What I mean is, when I enter a new number in the HEX boxes (in the BHAV editor), the parameters do not change.
...

So basically, I can do all I have to do, but it's a challenge sometimes to find out *how* to do it. :) Like a puzzle. laugh

Karin


The Hex box in the data fields section of the IFFSnooper BHAV Edit Screen is not set up to record changes, so if you try to make your changes there they won't have any effect. At some point I ought to enable it, mainly to make GUID replacement easier...

The editable data field boxes you need to use to change the BHAV code are in the rows p0, p1, p2 and p3
The boxes to the left of the "=" sign are for two byte values, like the IFFPencil Parameter fields. The boxes to the right of the "=" sign allow you to manipulate the values one byte at a time.

As you change these values the text in the code interpretation field at the right will update so you can see what the effects are. smile

Peter
Back to top
View user's profile Send private message Visit poster's website
Yersinia
Member
Member


Joined: 12 Oct 2006
Posts: 1934
Location: Old Town

PostPosted: Sat Sep 13, 2008 1:01 am    Post subject: Reply with quote

peter9g wrote:
The Hex box in the data fields section of the IFFSnooper BHAV Edit Screen is not set up to record changes, so if you try to make your changes there they won't have any effect. At some point I ought to enable it, mainly to make GUID replacement easier...


Please, please, please, we beg you to someday get around to doing this! Or, well I do anyway! notworthy

Quote:
The editable data field boxes you need to use to change the BHAV code are in the rows p0, p1, p2 and p3
The boxes to the left of the "=" sign are for two byte values, like the IFFPencil Parameter fields. The boxes to the right of the "=" sign allow you to manipulate the values one byte at a time.

As you change these values the text in the code interpretation field at the right will update so you can see what the effects are. smile


Well, you still have to know what values to put in those fields, and when GUIDs are "in hex" and the p0, p1, p2 and p3 fields, plus the values in the fields to the right of the "=" sign are in "normal" decimal, you need to convert the hex of the desired GUID to decimal, to get the right numbers to put in those fields. Ouch! And then what do you put in your converter -- the GUID backwards (which is how Snooper wants it), or the GUID as is...? The only way around this is to export the hex and edit it "outside," then bring it back in.....

and now that I finally discover this thread (my current project necessitates a lot of this GUID stuff, and please slap me upside the head because if this one works I want to make a second model with different offerings), I see that when I did Sims College lesson 4 and had to make the Burn BHAV/add the fire.iff GUID -- I went through what Karin did and ended up exporting the hex in disgust (sorry all, but I still shudder when I have to edit exported hex)! Sheesh, I was going through my Lesson 4 stuff for almost an hour yesterday trying to figure out how I must have done that with my chair because I knew I needed to do it again (repeatedly!) for this project! (I'm "upgrading" a SSoW contemporary microwave to a 23rd century food replicator...)

Mmmm. OK, gotta go!

~Yersinia.

_________________



"Hand over the coffee and no one gets hurt."
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Simblesse Oblige Forum Index -> Object Creation and Recolor Shop All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group