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!
Lab Assistant
Original Poster
#1 Old 6th Aug 2005 at 12:57 PM Last edited by skankyboy : 6th Aug 2005 at 1:07 PM.
Default Probem with BHAV and Animation
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.


Attached files:
File Type: rar  skankyboy-chairanim.rar (69.6 KB, 11 downloads) - View custom content
File Type: zip  skankyboy-chairanim.zip (85.2 KB, 23 downloads) - View custom content
Advertisement
Inventor
#2 Old 6th Aug 2005 at 1:12 PM
Hm... what is the exact name of the anim file?
Lab Assistant
Original Poster
#3 Old 6th Aug 2005 at 1:31 PM
The exact name of the anim file is "o-snowManHat-ayiy-ayiz_anim" as you can see i SimPe. The orginal name was "o-snowManHat-ayiy-ayiy_anim" and the new animation was created with the Miche's "Animation Editor".
Inventor
#4 Old 6th Aug 2005 at 1:39 PM
SO it was cloned from Miche's Test Animation HAt ?
Lab Assistant
Original Poster
#5 Old 6th Aug 2005 at 1:49 PM Last edited by skankyboy : 6th Aug 2005 at 1:56 PM.
not cloned,

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).
Retired Duck
retired moderator
#6 Old 6th Aug 2005 at 2:06 PM
Have you changed the name in the text lists as well? If you change the name in the anim, you'll need to change its name in the relevant "Anim" text list.
Lab Assistant
Original Poster
#7 Old 6th Aug 2005 at 2:07 PM
Yes I do, I have change the line reference (in the bhav) too and I know I do it correctly cause it works with the snowhat (add a line, change the name and make the bhav to understand it)
Inventor
#8 Old 6th Aug 2005 at 2:12 PM
Revert to the original name, change the line reference back, and try again. What are the results?
Systemic Anomaly
#9 Old 6th Aug 2005 at 2:32 PM Last edited by jase439 : 6th Aug 2005 at 2:48 PM.
Quote: Originally posted by skankyboy
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.


For starters, your stack object is not pointing to your character or your chair. It points to nothing at all:

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
Lab Assistant
#10 Old 6th Aug 2005 at 2:27 PM
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?
Nearly alive
#11 Old 6th Aug 2005 at 2:45 PM Last edited by Miche : 6th Aug 2005 at 2:57 PM.
IT was a long time ago when I first hacked this object (febuary time) and it was never intended to be shared with anyone so I didn`t really write the functions with sharing in mind, it was just to get a object which I could try animations on quickly. So the behaviours aren`t ideal, but I wrote the instructions about using them as it`s the easiest way I could think of for people to get animations into new objects until either I or someone else writes a tutorial.

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).
Nearly alive
#12 Old 6th Aug 2005 at 2:51 PM
Quote: Originally posted by XxHalfBloodPrincexX
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.)
Lab Assistant
Original Poster
#13 Old 6th Aug 2005 at 3:18 PM
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.
Attached files:
File Type: zip  skankyboy-chairanim2.zip (85.6 KB, 11 downloads) - View custom content
Nearly alive
#14 Old 6th Aug 2005 at 3:30 PM
Quote: Originally posted by skankyboy
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.
Systemic Anomaly
#15 Old 6th Aug 2005 at 4:07 PM
It's not the same error, this time it's on Node 2, Animate Object. The Animate Stop call that was failing previously succeeded.

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.
Lab Assistant
Original Poster
#16 Old 6th Aug 2005 at 4:16 PM
the original bhav with his object is here : http://www.modthesims2.com/showthread.php?t=80907
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)
Systemic Anomaly
#17 Old 6th Aug 2005 at 4:32 PM Last edited by jase439 : 6th Aug 2005 at 4:42 PM.
Ah, ok. I thought this was a Maxis thing you cloned. Miche is probably best positioned to answer your question since he wrote the original. I'll take a quick look anyway.

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.
Systemic Anomaly
#18 Old 6th Aug 2005 at 5:12 PM Last edited by jase439 : 6th Aug 2005 at 5:53 PM.
Well, I can get you half of the way there. The crux of the problem is that the snow hat that Miche created is a "parented" or "contained" object. The hat was originally part of an animating snowman. The hat is now "contained" by a table (or whatever else you set it on). Stack Object 0x0002 is the hat's container id - not the hat itself.

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.
Nearly alive
#19 Old 6th Aug 2005 at 5:51 PM
IT is possible that the animation files the editor creates don`t work on chairs, it`s even possible that they only work on contained objects. This is something I`ll need to look into. So even though the chair still isn`t working, this has at least brought up a problem for me to deal with, what was the whole point of releasing the editor at such a early stage.

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.
Nearly alive
#20 Old 6th Aug 2005 at 6:06 PM Last edited by Miche : 6th Aug 2005 at 6:09 PM.
Quote: Originally posted by jase439

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.)
Systemic Anomaly
#21 Old 6th Aug 2005 at 6:09 PM
This is the non-crashing yet non-animating version of his mod. It's impossible for me to verify the correctness of the BHAV except to say that it looks correct in disasim2 and the stack object appears correct. Note, that I had to change the name of the anim from "chairdining" to "snowmanhat" in SimPE to eliminate the application crash. I have no idea what the ramifications of this are.

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.
Attached files:
File Type: zip  skankyboy-chairanim.zip (78.7 KB, 11 downloads) - View custom content
Systemic Anomaly
#22 Old 6th Aug 2005 at 6:15 PM Last edited by jase439 : 6th Aug 2005 at 6:23 PM.
Quote: Originally posted by Miche
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).
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. 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.
Nearly alive
#23 Old 6th Aug 2005 at 6:24 PM Last edited by Miche : 6th Aug 2005 at 7:01 PM.
Quote: Originally posted by jase439
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.
Systemic Anomaly
#24 Old 6th Aug 2005 at 7:41 PM
I tried to apply the original "fire" animation and the rotate360 animation on the chair with no success. Maybe this is something unique to the chair. Perhaps trying to animate a simpler object, like an alarm clock would be worth trying. I am fresh out of ideas.
Lab Assistant
Original Poster
#25 Old 7th Aug 2005 at 1:23 PM
Miche, if the first frame of an animation is not set to 0 (second) the anim works but there is no transition between original position and the first frame position. I try with the snowmanhat and it works.
Page 1 of 2
Back to top