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 28th Oct 2014 at 11:56 PM Last edited by seresv : 31st Oct 2014 at 10:41 PM.
Default Custom and INteraction animation Help!
Okay this is for anyone else who very familiar with c# and animations, i was trying to test out an interaction that i made. : However i cant post the blasted thing no where because of the simple fact. that the darn thing refuse to play the custom animation that made for it. And if i cant get that one to play how in heck am i gonna get others to play. :tantrum: . This is a mod ive been working on for past week. It has the interaction name, blah , blah, gives the reaction i want blah blah blah :baa:, however it refuses to play the animation that i want it too. I begging for help no screaming for help with this .. so i can share it when its completed so any help would be very much so welcome... :Oh and one more thing do i have to use jazz editor for all custom animation ?
Advertisement
Inventor
#2 Old 29th Oct 2014 at 11:51 AM Last edited by Arsil : 29th Oct 2014 at 1:49 PM.
Hello. Your description of the problem is too vague, it's hard to help you.

Animation excluded, your code is working?
How you created the animation?
Does the clip name/iid match its "internal" name?
Can you play the animation in game with AnimationPlayer (it's a mod that allows to play animations)?
How do you invoke the animation from the c# code?

If you can't provide further information, the simplest way to get help is to upload the .package file here
(compressed/zipped).

For a simple animation that involves a single sim and don't make use of props you probably don't need a jazz script.
Lab Assistant
Original Poster
#3 Old 31st Oct 2014 at 10:42 PM Last edited by seresv : 1st Nov 2014 at 10:50 PM.
Okay working good so far
Inventor
#4 Old 31st Oct 2014 at 11:28 PM Last edited by Arsil : 1st Nov 2014 at 8:47 AM.
Quote:
Okay i have the animation part working just fine, now however i want the interaction to only be for teen and adults , and it needs a clothing change as well. The interactions is for sims3. Right now its works but the pie menus are showing up on everyone , and i don't want that.. So can someone help a bit..

Let's see... about the age I think there are various solutions:
- you can set the age filter with an ITUN for each interaction, that's the more common solution but works just for the subject/actor though, not for the object/target;
- you can inject the interaction only to sims who have the age requirement. I mean in the AddInteractions(Sim sim) method you check their age (see below).
By the way, before you add the interaction check if that sim already has it (EDIT: or maybe, since the sim has just been instantiated, he can't already have it).
- you can do it also with a check on the Test() method of each interaction with something like:
Code:
protected override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
    return (actor.SimDescription.TeenOrAbove() &&
        target.SimDescription.TeenOrAbove() &&
        && actor.SimDescription.SimDescriptionId != target.SimDescription.SimDescriptionId);
}

You should probably use all three solutions or at least the first two.

About the clothing change, you can do something like this before playing the animation:
Code:
private OutfitCategories actorOutfit = actor.CurrentOutfitCategory;
private OutfitCategories targetOutfit = target.CurrentOutfitCategory;
if (actorOutfit != OutfitCategories.Career|Athletic|Whatever)
    actor.SwitchToOutfitWithSpin(OutfitCategories.Career|Whatever);
// do the same for target
...
[after the animations, if you want to restore the previous outfit]
if (actorOutfit != actor.CurrentOutfitCategory)
    actor.SwitchToOutfitWithSpin(actorOutfit)
// do the same for target

You can use one of the many methods to switch outfit (with spin, without spin, etc).
I think you can also choose a custom outfit (douglasveiga's gardener mod comes to mind)
but that's a bit more complicated and I never tried. If you want to change single clothes
(just the top for example), I don't know how to do that and I'm really interested in it too.

Out of curiosity, are the animations synchronized? actor and target start their animation at the same time?

EDIT: I'm wondering if EventTypeId.kSimInstantiated is raised when a sim ages-up,
otherwise my suggestion about he injection may not be that good...
Lab Assistant
Original Poster
#5 Old 1st Nov 2014 at 4:37 AM Last edited by seresv : 1st Nov 2014 at 8:20 AM.
The animation looks and seems sync, and i post and update soon , and thanks so much.

At the end of code i added this ;
protected override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)

{

return (actor.SimDescription.TeenOrAbove() &&

target.SimDescription.TeenOrAbove() &&

&& actor.SimDescription.SimDescriptionId != target.SimDescription.SimDescriptionId);

}



1error pop up, saying some about cant find teenorabove in reference, is there a dll that im missing that has teens in it?
Inventor
#6 Old 1st Nov 2014 at 8:58 AM
Quote: Originally posted by seresv
The animation looks and seems sync, and i post and update soon , and thanks so much.

You are welcome.

Quote:
At the end of code i added this ;
protected override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)

What you mean with "at the end of the code"? You just have to update the 2 Test methods you already have.

Quote:
1error pop up, saying some about cant find teenorabove in reference, is there a dll that im missing that has teens in it?

Guilty! Sorry about that. It's not a method, don't use the brackets.
actor.SimDescription.TeenOrAbove
Lab Assistant
Original Poster
#7 Old 1st Nov 2014 at 7:52 PM Last edited by seresv : 1st Nov 2014 at 10:54 PM.
OK, so far so good and thanks so much for your patience with me...Arsil and cmar thank you as well I appreciate you all
Inventor
#8 Old 1st Nov 2014 at 8:11 PM
Code:
actor.SwitchToOutfitWithSpin(OutfitCategories.Career, 0);
Lab Assistant
Original Poster
#9 Old 2nd Nov 2014 at 9:02 PM
One more thing i just notice after posting this, that animals can use, how do i stop that , I tried using this : actor.IsHuman & target.isHuman, but it giving errors about its already define some where in code , but it is not.. I dont believe in beastility..
Inventor
#10 Old 3rd Nov 2014 at 9:26 AM
Weird, that seems to work for me. Try with "actor.SimDescription.isHuman".

"isHuman" should work but I think it will exclude vampires and other life-states,
is that what you want? Well, you could always use something like
Code:
(actor.isHuman || actor.isVampire || actor.isXXX)


If that doesn't work either, can you quote exactly the error message you are getting?

The ITUN solution will also work, but only for filtering the sim who use the
interaction (the actor), not the one you click on (the target).
Lab Assistant
Original Poster
#11 Old 3rd Nov 2014 at 5:55 PM
Quote: Originally posted by Arsil
Weird, that seems to work for me. Try with "actor.SimDescription.isHuman".

"isHuman" should work but I think it will exclude vampires and other life-states,
is that what you want? Well, you could always use something like
Code:
(actor.isHuman || actor.isVampire || actor.isXXX)


If that doesn't work either, can you quote exactly the error message you are getting?

The ITUN solution will also work, but only for filtering the sim who use the
interaction (the actor), not the one you click on (the target).



yes thank you so much cause , im testing it now..
Lab Assistant
Original Poster
#12 Old 4th Nov 2014 at 2:16 AM
Quote: Originally posted by seresv
yes thank you so much cause , im testing it now..


nah i use it, and it still allow vampire, fairies,etc use it which is good.. I just didnt want kids,and animals to use. If you want to check the results of it.. Look up kiwimisty on ladymoraine. I cant post link here . now i need to fix the pesky routing but that will be for later time . Like when i have a hoilday or vacation . But thanks so very much for everything..
Back to top