Author Topic: Force root animation  (Read 1044 times)

Hello. I'm having a problem with player vehicles.

Code: [Select]
...   
   numMountPoints = 1;
   mountThread[0] = "sit";
   mountNode[0] = 2;
...

This is supposed to make the player "sit" right? No, it doesn't. Try it yourself. Note that it is at mount2 not mount0. mount0 do work, but it is not my plan, since mount0 and mount1 are place holders for weapons.

Now I made this "hack" to force "sit" the player:

Code: [Select]
//Sit hack. Sit animation on blockhead won't work so I had to do this
package sitCow {
   function armor::onMount(%this,%obj,%col,%slot)
   {
      parent::onMount(%this,%obj,%col,%slot);
      if(%col.getDataBlock() == CowArmor.getID())
         %obj.playThread(3,"sit");
   }
};
activatePackage(sitCow);

Yes, the Blockhead does sit. Now I added this line to make sure it returns to the "root" state:

Code: [Select]
function CowArmor::onDriverLeave(%obj, %player)
{
%player.schedule(33, playThread, 3, "root");
}

Unfortunately it stays at the "sit" position. It only returns to the "root" state when I activate/fire.

Any suggestions on how to force the player into the "root" state?

Tried:
- Using the playthread on slots 0 to 7, never worked.
- Doubling the playthread
- Using %obj.client, %obj.client.player, and %player


Halp D: I can't continue with the cow update

What happens if you set mountThread[2] to "sit"?

What happens if you set mountThread[2] to "sit"?

It stands, not sitting.


Maybe remove mountnode? Rowboat sitting works fine.
Code: [Select]
   numMountPoints = 3;
   mountThread[0] = "sit";
   mountThread[1] = "sit";
   mountThread[2] = "sit";

Sitting works fine for me.

Maybe remove mountnode? Rowboat sitting works fine.
Code: [Select]
   numMountPoints = 3;
   mountThread[0] = "sit";
   mountThread[1] = "sit";
   mountThread[2] = "sit";

Do you know what you're talking about mountnodes? I never included mountNode, I use mount0 and mount 1

The rowboat thing seems weird :/ I would experiment on it more.

Sitting works fine for me.

I would appreciate it if yours is the same situation as mine.

Update: Sitting works only on mount0, mount1 above can't do the sitting animation.

What. I mean, I get it.

But, what.

Update: Sitting works only on mount0, mount1 above can't do the sitting animation.
Uh, the Jeep?

Uh, the Jeep?

Uh, it can't explain why a simple sitting position at mount2 can't be done at a 1-seated vehicle.

You could just change the model so the seat is mount0 and the weapons are in 1 and 2.

Try scheduling the playThread?

You could just change the model so the seat is mount0 and the weapons are in 1 and 2.

How?

Try scheduling the playThread?

Did you try to look into the code I posted?

Did you try to look into the code I posted?
Code: [Select]
function CowArmor::onDriverLeave(%obj, %player)
{
%player.schedule(33, playThread, 3, "root");
}

Oops, excuse me. I missed that.