- Site Map >
- Modding and Creation >
- Sims 2 Creation >
- Modding Discussion >
- Probem with BHAV and Animation
- Site Map >
- Modding and Creation >
- Sims 2 Creation >
- Modding Discussion >
- Probem with BHAV and Animation
Posts: 65
Thanks: 2643 in 22 Posts
I created a clone of a chair then add to it a new pie function "Move".
If I try the Move Interaction in the game I've got an error "Could not find object reference". In the log file I notice the Stack object and the Stack object's id values are pointing to the character I'm playing with but not to the chair object (I think that's why I got an error).
So I want that my "new" bhav store the Stack Object and the Stack Object's id of the chair.
How can I do that ? I hope someone can help me.
Skankyboy
You can dowload the chair package with the log file error created when I clicked on the Move interaction.
skankyboy-chairanim.rar (69.6 KB, 11 downloads) - View custom content | ||||||||||
Size Packed Ratio Date Time Attr CRC Meth Ver ------------------------------------------------------------------------------- skankyboy-chairanim.package 290575 63886 21% 06-08-05 13:48 .....A. 3F782079 m5d 2.9 ObjectError_N004_t91414.txt 37407 7235 19% 06-08-05 03:12 .....A. 7FA3F3F9 m5d 2.9 ------------------------------------------------------------------------------- 2 327982 71121 21% |
||||||||||
skankyboy-chairanim.zip (85.2 KB, 23 downloads) - View custom content | ||||||||||
290575 08-06-05 13:48 skankyboy-chairanim.package 37407 08-06-05 03:12 ObjectError_N004_t91414.txt -------- ------- 327982 2 files |
Posts: 1,109
Thanks: 700 in 10 Posts
Posts: 65
Thanks: 2643 in 22 Posts
Posts: 1,109
Thanks: 700 in 10 Posts
Posts: 65
Thanks: 2643 in 22 Posts
1. I extracted the anim file "o-snowManHat-ayiy-ayiy_anim" from the hat package (I got 2 files on my HD : animation.simpe & animation.simpe.xml)
2. I created a new animation with the Miche's Animation Editor and I changed the name to "o-snowManHat-ayiy-ayiz_anim". I save the file to "animation.simpe"
3. I add the new file in the chair package by clicking on Add then choose the file animation.simpe.xml
4. I change (in the Animation Plugin Wndow) the Misc/Name (originally snowmanhat) to chairdining.
I did the same operation (without step 4) to add a new interaction to the snowmanhat object and it worked so I don't think the probleme is here but probably with the BHAV (but I'm not sure).
Posts: 65
Thanks: 2643 in 22 Posts
Posts: 1,109
Thanks: 700 in 10 Posts
Posts: 333
Thanks: 2 in 2 Posts
First, thanks to all the modders who make a great job to improve this game . I created a clone of a chair then add to it a new pie function "Move". If I try the Move Interaction in the game I've got an error "Could not find object reference". In the log file I notice the Stack object and the Stack object's id values are pointing to the character I'm playing with but not to the chair object (I think that's why I got an error). So I want that my "new" bhav store the Stack Object and the Stack Object's id of the chair. How can I do that ? I hope someone can help me. Skankyboy You can dowload the chair package with the log file error created when I clicked on the Move interaction. |
Stack Object id: 0
When this behavior is called, it expects that the Stack Object already points to the chair and that its Attribute 0x2 has been set to point to the sim that is using it. Prior to the crash, the Stack Object is switched to refer to Attribute 0x2 (the sim) and then calls Animate Stop on that sim. In this case, Animate Stop is being called on "zero" - which is an error. This results from the fact that Attribute 0x2 hasn't been initialized (consider initializing it in your guardian TEST function to point to My 0x000B which should be the ID of the active sim).
The code you are hijacking does not appear to have been written with an interaction in mind. If you look to where this function is actually called in the original code, you will probably see that it is being invoked via Run Tree By Name (most BHAV's that begin with "CT" are called this way) as part of a larger operation and that Attribute 0x2 has been initialized ahead of time to point to the sim.
In either event, you might simply try adding:
Stack Object ID 0x0000 := My 0x000B to the end of CT - animate-testb function. That might be enough to get you to where you need to go. I am still somewhat dubious if this will fly, since the behavior you have cloned was clearly intended to be called from another behavior - and not directly (as evident by the fact that it has 2 "out" parameters to return data back to the caller). I think you may find that doing the above will get you beyond your error, but the call may or may not work as you expected called in isolation like this.
J
Posts: 134
Thanks: 6657 in 23 Posts
Posts: 629
Thanks: 1844 in 27 Posts
Now, onto the problem here..like Jase439 says it`s likely that I`m setting a few attributes up in the test function (when I wrote the instructions I forgot to check this), and at the moment I`m not at home so can`t check myself now. You`ll be able to find what test function I was using by looking at which one is called in the pie function part. (I think it was called animate-test).
Posts: 629
Thanks: 1844 in 27 Posts
how do you get a anim file you've just made added to an object since sim pe doesn't accept the file it saves it self as by just adding it to a file? |
If you mean the animation file that the editor/converter creates, then SimPE will read it but it doesn`t by just using add, know what type of file it is.
So what you need to do is replace a existing animation in that object. if it doesn`t aready have a animation in the package then extract one from a different package (like my version of the snowman`s hat) and then add the file (.xml) that SimPE creates when extracting, to your new package. That way SimPE knows that it is a animation file and then you can replace that once it has been added. (right click on the added animation and select replace. )
I really need to update the instructions I gave as they were wrote quickly, as a way for people to quickly add animations but I left out a number of parts (like the test function and also making sure the group and instance numbers were correct.)
Posts: 65
Thanks: 2643 in 22 Posts
First, Miche, I checked your Animate-test BHAV in DisaSim2 here's what I get
# Group = FFFFFFFF, Instance = 100A
# Title = CT - animate-test
# SemiGlobal File: SnowManGlobals (7F6AB593)
#
# Format = 8007, Params = 0, Locals = 0
# Tree type = 0, Header flag = 0, Tree version = FFFF8006 (-32762)
0: 0 == 12; true: true, false: true
1: Animate Stop: All Animations running affecting Stack Object, Stopping normal AND flipped anims, Priority Any; true: 2, false: error
2: Animate Object: anim id in STR# 0x86:[Param 0] affecting Local 0, No Event Tree, No Blend in, No Blend out; true: true, false: error
3: .CT - Hat Pose (Stack Object, Stack Object's container id); true: true, false: true
So it seems that only line 0 is read because it return true everytime.
So, to jase439, I try change the animate-testb BHAV like you said but it doesn't work I got the same error but this time in the log file the ID seems to be good. you can download the modified package with the new error log.
skankyboy-chairanim2.zip (85.6 KB, 11 downloads) - View custom content | ||||||||||
290506 08-06-05 16:10 skankyboy-chairanim.package 39372 08-06-05 15:54 ObjectError_N004_t90761.txt -------- ------- 329878 2 files |
Posts: 629
Thanks: 1844 in 27 Posts
Thanks for all this answer, First, Miche, I checked your Animate-test BHAV in DisaSim2 here's what I get # Group = FFFFFFFF, Instance = 100A # Title = CT - animate-test # SemiGlobal File: SnowManGlobals (7F6AB593) # # Format = 8007, Params = 0, Locals = 0 # Tree type = 0, Header flag = 0, Tree version = FFFF8006 (-32762) 0: 0 == 12; true: true, false: true 1: Animate Stop: All Animations running affecting Stack Object, Stopping normal AND flipped anims, Priority Any; true: 2, false: error 2: Animate Object: anim id in STR# 0x86:[Param 0] affecting Local 0, No Event Tree, No Blend in, No Blend out; true: true, false: error 3: .CT - Hat Pose (Stack Object, Stack Object's container id); true: true, false: true So it seems that only line 0 is read because it return true everytime. So, to jase439, I try change the animate-testb BHAV like you said but it doesn't work I got the same error but this time in the log file the ID seems to be good. you can download the modified package with the new error log. |
I`ll look into this either tomorrow night or monday, when I get home. I really can`t remember what I did in that object.
Posts: 333
Thanks: 2 in 2 Posts
This is the line that is failing:
: Animate Object: anim id in STR# 0x86:[Param 0] affecting Local 0, No Event Tree, No Blend in, No Blend out; true: true, false: error
Local 0 is "zero"
Local 0 is assigned at Node 6:
Local 0x0000 := Stack Object ID 0x0000
Not sure how the stack object could be zero here and still having the following call return something valid at Node 5:
Stack Object ID 0x0000 := Stack Object's 0x0002
I would have to debug this. I don't know enough about what you're trying to do here, what anim you are running, and on what object that anim is supposed to run. I would need to see the original calling context and the parameters as they are coming into this function to understand what is happening here.
Posts: 65
Thanks: 2643 in 22 Posts
All I want to do is to make a movement interaction like the Fire Function of the Hat.
All I do is to clone a chair and add to it the new interaction "Move" with an animation like the one played in the Hat. (this include txt liste change, Pie changes, bhav change and anim resource change)
Posts: 333
Thanks: 2 in 2 Posts
Is the idea here you click Move on your chair and it slides in some direction?
EDIT: I think I understand what's going on now. Let me futz with this, and see if I can't get it working. Curiosity has taken hold of me.
Posts: 333
Thanks: 2 in 2 Posts
Your chair is NOT contained by anything. So any references to Stack Object 0x0002 is referencing nonsense in this context.
Miche's object, having been cloned from the animating snowman, was designed to first stop the running animations on the body of the snowman, and then animate the hat. The interesting thing about this is that the Animate Object call is made on the container object, not the subobject itself (in this case, the "snowman", or in Miche's case...the table is the subject of the Animate Object call) and a reference to the subobject (hat) is passed in via Local Var 0.
Trying to make this Animate Object call on the unparented chair results in an application crash. There are probably a half dozen reasons that this could be the case (malformed anim data, missing bones, anim data referencing bones that don't exist, a bad entry in the anim table, etc.). It may just be that the Animate Object call in Miche's function expects to be called on the parent of an object (which yours is not) and the call barfs. I can't vouch for the integrity of your animation - that is well beyond my area of expertise. Miche can better help you there.
Personally, I think you either need to clone a different object that is more like the hat or find an Animate Object sequence in the Maxis code which is acting on an unparented object and copy that call instead. The upshot is that I think you're trying to treat an apple like a pear here, and they are entirely different critters.
J
EDIT: Just for kicks I replaced the Animate Object call with a very simple, very direct call:
Animate Object 0x0069
21 00 00 20 00 00 0A 00
00 00 20 00 00 00 00 00
(translates to)
Animate Object: o-snowManHat-ayiy-ayiz affecting Stack Object, No Event Tree; true: true, false: error
And it still crashes. If I were a betting man, my guess is that there's something junked in your animation data that the game can't handle. If it was a problem in script, you likely would not get the hard application crash, but an error log. My guess is that a mistake was made while trying to clone Miche's hat animation and/or by trying to apply it to the chair. Miche will prove to be a far better resource for you here.
J
PS. If I change the anim name to "snowmanhat" it doesn't crash anymore. It doesn't animate, but it doesn't crash the game either.
Posts: 629
Thanks: 1844 in 27 Posts
Jase439, it would be helpful if you could post the version of the chair with the direct call in, then I can just try adding different animations to it, to see if I can find the problem with them.
Posts: 629
Thanks: 1844 in 27 Posts
PS. If I change the anim name to "snowmanhat" it doesn't crash anymore. It doesn't animate, but it doesn't crash the game either. |
As far as I can tell, if you changed the name of the animation file to just "snowmanhat" then the game is very unlikey to read the full file as the structure of the file is depended on the size of certain parts of the file so by cutting down the size of the name would destroy the structure without the whole file being rewrote. So in the files that the editor creates (at the moment ) the name always has to be 27 characters long (including the "_anim" part at the end).
So by changing it to snowmanhat, the game is most likely giving up attempting to read the file(nomally though this will give a missing animation error to the console when in debug mode).
Edit : I`ve just checked the second package that Skankyboy uploaded , the skankyboy-chairanim2.zip one, and the animation file in that is corrupt ( part of the end of it has been cut off), the first package that he uploaded seemed fine (or at least had a full animation file in it), so I don`t know how this got cut off in the second.)
Posts: 333
Thanks: 2 in 2 Posts
If you're looking for a simple stand-alone basic animating object test case, I might suggest the alarm clock which has a ring and shutoff animation.
J
PS. I always run in debug mode. No errors were generated. Just no animation.
skankyboy-chairanim.zip (78.7 KB, 11 downloads) - View custom content | ||||||||||
290324 08-06-05 13:00 skankyboy-chairanim.package -------- ------- 290324 1 file |
Posts: 333
Thanks: 2 in 2 Posts
As far as I can tell, if you changed the name of the animation file to just "snowmanhat" then the game is very unlikey to read the full file as the structure of the file is depended on the size of certain parts of the file so by cutting down the size of the name would destroy the structure without the whole file being rewrote. So in the files that the editor creates (at the moment ) the name always has to be 27 characters long (including the "_anim" part at the end). So by changing it to snowmanhat, the game is most likely giving up attempting to read the file(nomally though this will give a missing animation error to the console when in debug mode). |
EDIT: If you refer back this post: http://forums.modthesims2.com/showp...631&postcount=5 he says he tried this procedure and applied his modified animation on your original hat and it worked (provided he did not change the name), but when this same animation is applied to the chair it does nothing. Which makes me think its something in the anim data itself (perhaps it references nodes in the hat that do not exist in the chair?) that is preventing any translation of the object from occuring. He does state that he started with the original hat animation, modified it, and replaced it with his own. What's good for the goose may not be good for the gander in this case.
Posts: 629
Thanks: 1844 in 27 Posts
I should be clear about what I changed. I did not change the filename. It is still "o-snowManHat-ayiy-ayiz_anim". What I changed is the "Name" property that is displayed in SimPE for that resouce under "Content" (where it says Part2Count, Part4Count, SUnknown1, SUnknown2, etc.). The "Name" property was originally "chairdining" (that crashes the game). I changed this to "snowmanhat" - and while that does not crash the game, it does not trigger an animation either. If I change this field to ANYTHING other than "snowmanhat" the application will crash with a fault. "snowmanhat" is the ONLY acceptable value for this name field (sadly, it doesn't do anything EDIT: If you refer back this post: http://forums.modthesims2.com/showp...631&postcount=5 he says he tried this procedure and applied his modified animation on your original hat and it worked (provided he did not change the name), but when this same animation is applied to the chair it does nothing. Which makes me think its something in the anim data itself (perhaps it references nodes in the hat that do not exist in the chair?) that is preventing any translation of the object from occuring. |
Thanks for all your help.
While the name of the object that the aniamtion is meant to be used on is snowmanhat, in my tests it has (until now) seemed like this name isn`t used as I have tested a couple of animations the editor creates on other objects, but also tried changing that name to random things and they still work on the snowmanhat, plus there is animation included with the game which is meant to be generic (it is called generic_roatate or something like that , and according to one of the maxis people it would work on any object, yet this has a name of "dinnerplate" in it), so I am kind of leaning to it being a different problem in this animation to the name.(just that using that name seems to stop the problem showing ). As for refrencing nodes that aren`t in the chair, the only two bones/nodes that this animation effects are "root_rot" and "root_trans" which I`m 99% certain every object (including the sims themselves have). Although it could be that there is a flag in there that I haven`t found yet sets something about what type of objects it can animate.
EDIT: I`ve just caught onto to what name you mean you changed, and yes if he had changed that name (to anything other than snowmanhat) then it would be causing a problem, as there are two internal names in the file, which (as far as I know) need to be the same, and as originally they were set to snowmanhat, by changing just one of them (like he had) it would be causing a problem. BTW these names still don`t match up, the name needs to be "snowmanhat" (no capital letters, although I`m not sure if having capital letters in it will matter or not), I need to add instructions for this name not to be changed at all.
skankyboy,
I`ve checked the animation in the package that jase439 just uploaded and it`s not missing the end, although I did notice something which could be a problem with it, in that the first frame has a time of 1000 (1 second(, while I`m not sure if it`s a requirement of the game, all the animations I`ve looked at which were included with it have the first frame at 0 (0 time), I seriously suggest for now that the first frame of any animations made have that as well. (also it would be a idea if the position and rotation in the first frame are all set to 0).
IF you want to really find out if it`s the animation or someother problem you could take out the animation in the snowman called "o-generic-rotate360_anim" and try that in your object, this is a maxis animation which I`ve placed in the object (but the object doesn`t use) and it is unchanged. So if you call this animation instead of the one you made and the object rotates 360 degrees then we know it`s a problem with the animation the editor is creating (or to do with the first keyframe time), if it doesn`t rotate then it`s something else.
As I said I`ll look into this problem more tomorrow, as I don`t have the sims installed on this computer.
Posts: 333
Thanks: 2 in 2 Posts
Posts: 65
Thanks: 2643 in 22 Posts
Who Posted
|