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!
Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 22nd Jul 2015 at 8:13 PM Last edited by lunacie : 24th Jul 2015 at 10:38 PM.
Default [SOLVED]Sim to Object Animation Madness
Well... I usually am a really calm person. I don't get irritated easily, and I am not so bad of a programmer... Or so I thought.

I spent the last THREE DAYS (and I means days, actual days, doing nothing else but) trying to play a custom animation for my object mod.
I've been following several tutorials, doing them all over and over (and over) again, all in vain. All the tutorials and tools I find are either outdated or just plain confusing. Some even contain mistakes.

I'm getting so stressed out, and I mean physically stressed out, I feel like a sim whose fun motive is hitting rock bottom and it's not good for a simmer's health. Can someone please help me ?


What I already did :
- Making a mesh + textures + uvs + shadows + lighting for my objects (works in game)
- Playing a custom interaction that writes debug (works in game)
- Playing my custom animation (works in game, tested with that nraas mod that plays any animation)

What I can't do :
- play the animation when you click on the object IG.

Can you either give me a link to a tutorial I hopefully didn't already tried or just explain to me how it's done ?
Or some documentation... Please can a good soul send me some documentation ?
Please...

I don't know if I should roll into a ball and cry or just keep calm and brew some green tea...
Advertisement
Test Subject
Original Poster
#2 Old 23rd Jul 2015 at 7:52 PM
Anyone ?
Instructor
#3 Old 24th Jul 2015 at 4:29 AM
Probably I'm here just to give some encouragement (if this actually discourages you in the way that it isn't constructive guide ), I do think that you are really super to have accompolished a working mesh and a custom animation (I've always wanted to do these, only that I've no idea how to do so...), so don't be discouraged. Like me as a scripter, I can get frustrated from time to time, but what matters is that you know how to get away from the workload and relax. Let things be off your mind. I must admit that I'm a lazy modder and leaves work WIP all the time, so...

Anyway, trying to be helpful: I think you can PM Arsil. He used to lurk around here more often, but if you give him a friendly PM with link to this thread, and if you are indeed serious about the mod (that you continue your work actually), he will give in-depth thoughts into your mod. I think both Arsil and I saw too many people running away after we gave some actual coding ideas, that those people didn't understand and left without a word. This, is exactly discouraging. (Sorry for ranting again)
Inventor
#4 Old 24th Jul 2015 at 8:26 AM
Damn you, SimsMatthew, why are you suggesting people to PM me! Just kidding. But seriously, don't do that :P

For a simple, single animation involving a Sim you can use
sim.PlaySoloAnimation(animationName);
where "sim" is a variable of type Sim and animationName is a string with the name of the CLIP
(which IIRC has to be the hashing - not FNV64 but CLIP IID - of the Instance Id of the CLIP resource)
Usually in an interaction you'll use
this.Actor.PlaySoloAnimation(animationName);

Sometimes (or always) the animation will end abruptly (this also happen with the animation player
and I guess also with the NRaas mod). A simple trick is to use a second call using as clip name
"a_idle_jazzutility", which is the default pose and thanks to the "blending" it will make the
transition between the two animation smooth.

Now, let's say you want to animate 2 Sims at the same time. You can use
sim1.PlaySoloAnimation(whatever, false);
sim2.PlaySoloAnimation(whatever2);

That "false" is for the yeld parameter, this way you don't have to wait for the animation to end before
going on with the next instructions (the 2 animations usually better have the same duration).

But that is just for very simple things and I think only for animating Sims (and not objects).
For most complex things you have to make a Jazz script.
They allow looping, different paths, mirroring (to use a bathtub or bed from one side or another,
the animation is the same but mirrored), etc, etc.

Now don't ask me about Jazz scripting, but I wanna say one thing about it.
Not sure if it's good advice or bad, but I found out that they work also if you don't define all those
Assign Actor "whatever.ma".whatever as "<actorName>"
Now, I could be very wrong about it, and all those directives are needed to choose the right age
related animation, but in my last tests I've omitted them and all seems to work anyway.
If I'm right, it means there's no need to change the "internal" names of a clip: the name itself and the source name,
the one ending with .ma that I think indicates the original name of the animation (you can change those with an
hex-editor - but you have to use names with the same length of the existing ones - or with AnimTool by Wes Howe:
careful with that, if you use it always verify that the internal name has been assigned correctly - since the names
you put in the inputboxes will be used also for the next conversions).
Test Subject
Original Poster
#5 Old 24th Jul 2015 at 8:01 PM
Awww... Thank you, both of you. I got my motivation back !
I think I am going to try what you just sugested, and thank you for telling me more about what jazz scripts are used for.
What I am working on is typically something for which being able to play loops for as long as the action lasts would be very helpful.
That's a lot of help !

And no, I do not plan on disapearing just yet :p
Test Subject
Original Poster
#6 Old 24th Jul 2015 at 10:38 PM
Omg omg omg ! It's working ! Thank you so much !!
The animation is working with its jazz script, now all I need to do is make my sim walk up to the object before she starts the animation, and create a few loops that I alternate so that she doesn't do the same animation over and over again.
Then I need to find out how to run the animation only for as long as the sim needs to perform the activity, in this specific case : bathing, and update the motives.
Oh... And she needs to undress, too.
Everything is going just fine. I was following instructions from an obsolete tutorial from the start...
Thank you so much guys x3

In case someone needs it too in the future, this is what worked for me :
Code:
 
 protected override bool Run()           
  {       
		base.EnterStateMachine(<YourJazzScriptHere>, "Enter", "x"); 	
		base.AnimateSim(<YourStateHere>); 				
	        base.AnimateSim("Exit"); 		 	
                return true;       
      }

It's not much, but I'm only just starting.
Instructor
#7 Old 27th Jul 2015 at 3:34 AM
@Arsil Of course I know you are kidding with the "damn" on me and that you think PMs aren't quite good, but I only wrote that because I think @lunacie is really serious about the mod. I've seen too many cases in which people just has the "idea" part of programming but not the "execution" part, they don't have the skills / patience. Not saying I have proficient "execution" skills though - I'm terrible with animations / meshes / jazz scripts, I never understand the heck out of them.
Test Subject
Original Poster
#8 Old 27th Jul 2015 at 1:54 PM
Plus, I sent him a message before you advised me to, so I would have harassed him anyway... ahem..
Thank you for thinking I am serious about starting modding. People giving encouragements help me stay motivated

Jazz scripts are something... I can animate my Sim, and make her walk up to the object and check if in use, but I am still trying to figure out how to play the .animation file I made for my object. (Filling the bucket with water)
Back to top