Posts: 3,856
Thanks: 8483 in 67 Posts
28 Achievements
"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.