Replies: 6 (Who?), Viewed: 256 times.
Instructor
Original Poster
#1 Old 1st Apr 2021 at 4:38 AM Last edited by echoweaver : 1st Apr 2021 at 4:56 PM.
Default Props/accessories in animations
So, my cat fishing skill is at the stage of high effort for small tweaks. Here's one that bugs me -- the animation for a cat catching a fish uses a generic fish prop. So if your cat catches a toad or a shark, they still walk out of the water with a sardine-sized tail sticking out of their mouth.

So I tried (sort of accidentally) to use the actual model of the fish caught with this animation. Unfortunately, those fish seem to have their "attachment point," for lack of a better word, at the mouth. So, the cat's mouth attaches to the fish's mouth, and you get the unfortunate second screenshot I attached.

So, I'm curious -- might there be a way to turn that fish to a proper position for a cat carrying something in its mouth. I'm all right if huge fish are huge. A cat happily trotting out of the water with a tuna four times its size is pretty entertaining .

Code-wise, we're talking about
Code:
SetModel ("accessoryCatHuntFish")
for the generic fish and
Code:
SetModel (fishobject.ModelName)
for the fish you see when a human catches a fish.
Screenshots

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Advertisement
Virtual gardener
staff: administrator
#2 Old 1st Apr 2021 at 12:24 PM
Quote:
Originally Posted by echoweaver
So, my cat fishing skill is at the stage of high effort for small tweaks. Here's one that bugs me -- the animation for a cat catching a fish uses a generic fish prop. So if your cat catches a toad or a shark, they still walk out of the water with a sardine-sized tail sticking out of their mouth.

So I tried (sort of accidentally) to use the actual model of the fish caught with this animation. Unfortunately, those fish seem to have their "attachment point," for lack of a better word, at the mouth. So, the cat's mouth attaches to the fish's mouth, and you get the unfortunate second screenshot I attached.

So, I'm curious -- might there be a way to turn that fish to a proper position for a cat carrying something in its mouth. I'm all right if huge fish are huge. A cat happily trotting out of the water with a tuna four times its size is pretty entertaining .

Code-wise, we're talking about
Code:
SetModel ("accessoryCatHuntFish")
for the generic fish and
Code:
SetModel (fishobject.ModelName)
for the fish you see when a human catches a fish. I
Lol that fish :p I do agree though that that's been an annoyance for me too! especially for big fishes that they just run... well, so small! ANd nothing like the actual thing they caught!

there are two things you can do here:

1. Programmatically turn the positioning. 
2. Use the fish's rig (they're all the same) and create a small animation for it/CLIP file. Although it could screw up the IK targets (which is the positioning you're talking about)

So technically you should be able to do something like:

Code:
//switch position
Vector3 position = Vector3(Add whatever position you'd want it to be );

 fishobject.Position = position;
And so you can also do this with rotation, forward, etc  

I'm actually writing this away from my home PC so I actually don't know if the Vector3 thing would work so I might edit this later :p
Instructor
Original Poster
#3 Old 1st Apr 2021 at 5:08 PM Last edited by echoweaver : 1st Apr 2021 at 5:28 PM.
Well, this gives me stuff to experiment with. Thanks! If you have more insight, I'll be delighted to have it . I don't know how I'd define the vector.

It looks like there a few useful methods here. There's both GetPositionOfSlot AND GetSlotPosition (I need to see what, if any, differences there). Also Get/Set Position and SetRotation. Those sound very promising. There's also GetNearestSlot, which takes a Sim as an input. I'm assuming a "slot" is the right thing here, which might not be true.

I have never attempted to make any animation. I have converted adult animations to child using Blender, but that's about it. I don't know how I'd even get the fish rig. Which doesn't mean I'm not willing to take it on

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Instructor
Original Poster
#4 Old 2nd Apr 2021 at 1:28 AM
So, if you weren't scared before, here's my most recent attempt to mess around with fish positioning.

The more frightening things is that I think the test worked....
Screenshots

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Lab Assistant
#5 Old 2nd Apr 2021 at 1:38 AM
Oh nooo

This looks like it's going to be awesome though, nightmare toad aside
Instructor
Original Poster
#6 Old 2nd Apr 2021 at 2:20 PM Last edited by echoweaver : 2nd Apr 2021 at 2:39 PM. Reason: Added code example
Well, grump, I guess those test weren't working after all. I've tried a bunch of increasingly extreme position values without meaningful change in the caught fish position.

Code:
Fish fish = Fish.CreateFishOfRandomWeight(fishType, Actor.SimDescription);
string message = skill.RegisterCaughtPrey(fish, TerrainIsWaterPond);
if (fish.CatHuntingComponent != null)
{
    fish.CatHuntingComponent.SetCatcher(Actor);
}
fish.UpdateVisualState(CatHuntingComponent.CatHuntingModelState.InInventory);
fish.SetPosition(fish.Position.x + 500f, fish.Position.z + 100f);   // THIS LINE IS THE TEST CODE
SetActor("fish", fish);
mNumberFishCaught++;
if (Actor.Motives.GetValue(CommodityKind.Hunger) <= EWCatFishHere.kEatFishHungerThreshold)
{
    // Notify if cat eats caught fish
    message += Localization.LocalizeString("Gameplay/Abstracts/ScriptObject/CatFishHere:EatFishTns",
        Actor, fish.GetLocalizedName(), fish.Weight);
    Actor.ShowTNSIfSelectable(message, NotificationStyle.kGameMessagePositive);
    AnimateSim("ExitEat");
    fish.Destroy();
    Actor.Motives.ChangeValue(CommodityKind.Hunger, EWCatFishHere.kHungerGainFromEating);
}
else
{
    if (message != "")
    {
        // Notify if the fish is interesting (new type or weight record)
        message += Localization.LocalizeString("Gameplay/Abstracts/ScriptObject/CatFishHere:PutFishInInventoryTns",
            Actor, fish.GetLocalizedName(), fish.Weight);
        Actor.ShowTNSIfSelectable(message, NotificationStyle.kGameMessagePositive);
    }
    AnimateSim("ExitInventory");
    fish.UpdateVisualState(CatHuntingComponent.CatHuntingModelState.InInventory);
    if (!Actor.Inventory.TryToAdd(fish))
    {
        fish.Destroy();
    }
}

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Instructor
Original Poster
#7 Old 11th Apr 2021 at 4:21 AM
So this seems like a tutorial in the direction of what it might take to replace the generic fish prop? https://modthesims.info/t/469283

The thing is I'd really like to be able to use the existing fish model, since I'm not going to be able to clone every single fish in the game.

I've only started reading this tutorial to see if it will give me info I can use.

Echo Weaver's Simblr: http://echoweaver.tumblr.com/
A portrait in stubbornness - Playing the same legacy since 2009
Sample a Brave Legacy: http://sims3sample.illation.net
Back to top