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!
Virtual gardener
staff: administrator
Original Poster
#1 Old 6th Jul 2021 at 11:07 PM
Default "Host object does not have a SacsComponent" error?
Heya!

Here I am again with another questioN! Although this time I don't think its a logistics error, but a very technical issue.

Currently, i'm working on starting a statemachine through just a method, so outside of an interaction class. Now, whenever I call the animation (or the statemachine rather), it's givving me the following error:

"Sims3.simIFace.SacsErrorException: Host object does not have a SacsComponent".

So my first instinct was checking what the original function that throws that error checks on, but unfortunately it's... not that easy:

Code:
	ResourceKey stateMachineKey = new ResourceKey(ResourceUtils.HashString64(stateMachineName), 47570707u, 0u);
	uint num = SacsProxy.Instance.AcquireDriver(allowYield, hostObjectId, stateMachineKey, (int)overridePriority);
	switch (num)
	{
	case 4294967287u:
		throw new SacsErrorException("Host object was not found.");
	case 4294967288u:
		throw new SacsErrorException("Host object does not have a SacsComponent.");
	case 4294967289u:
		return null;
	case 4294967286u:
		return Acquire(hostObjectId, stateMachineName, overridePriority);
	case 4294967283u:
		return Acquire(hostObjectId, stateMachineName, overridePriority);
	case 0u:
		throw new SacsErrorException("You have broken SACS / In a new and unique way / Congratulations.");


(I will say that last error is so sassy, I love it :p)

The animation is called through a alarm callback function, that then calls the anim function which looks like this:
Code:
        public void DoTestAnim(StateMachineClient statemachine, string requestedState, string actorName)
        {
            //DriverRequestFlags flags = DriverRequestFlags.;
            mCurrentStateMachine = StateMachineClient.Acquire(base.Proxy.ObjectId, "LivingSheepMachine", AnimationPriority.kAPDefault, false);
            //mCurrentStateMachine = EnterStateMachine("LivingSheepMachine", "Enter", "sheep_x");
          // mCurrentStateMachine = StateMachineClient.Acquire(this.Proxy.ObjectId, "LivingSheepMachine");
            if(statemachine != null)
            {
                statemachine.SetActor("sheep_x", this);
                statemachine.EnterState(actorName, "Enter");
                statemachine.RequestState(true, actorName, requestedState);
                statemachine.RequestState(true, actorName, "Exit");
            }
        }


If it helps, the primary mod is derived from the GameObject class.
Advertisement
Space Pony
#2 Old 7th Jul 2021 at 3:39 PM
I'm not super well-versed in animation, but it looks like the SACSComponent referred to here is managed by the game engine and requested through the OBJK resource. Per this tutorial,

Quote:
If the object you cloned is not animated (or if the boxes aren't checked), check the boxes labeled "Sacs", and "Animation".


It looks to me like whatever is passed as the host object needs to have an OBJK with a SACSComponent, and any object passed in as an actor requires an OBJK with an AnimationComponent.

"The Internet is the first thing that humanity has built that humanity doesn't understand, the largest experiment in anarchy that we have ever had." - Eric Schmidt

If you enjoy the mods I put out, consider supporting me on patreon: www.patreon.com/Gamefreak130
Virtual gardener
staff: administrator
Original Poster
#3 Old 7th Jul 2021 at 5:17 PM Last edited by Lyralei : 7th Jul 2021 at 6:06 PM.
Quote: Originally posted by gamefreak130
I'm not super well-versed in animation, but it looks like the SACSComponent referred to here is managed by the game engine and requested through the OBJK resource. Per this tutorial,



It looks to me like whatever is passed as the host object needs to have an OBJK with a SACSComponent, and any object passed in as an actor requires an OBJK with an AnimationComponent.


I.... hadn't thought of that actually,! that it might be linked with the OBJK. Currently i found a workaround for it by parsing in the 'active sim' rather than the gameobject itself in the acquire function and that fixed it (probably *because* that's properly set). Lemme check what happens if I do it the OBJK way. Thanks for the tip!

EDIT: That actually did the work! Thanks for the help! Now I don't have to have sims to activate the statemachine!
Back to top