Author Topic: Force Hug on Vehicles  (Read 1713 times)

All I've got is this hugPackage from Racer's motorbike.
But it forces standing as well.

I would appreciate plain ol' force huggage for when one enters the vehicle.

Quote
package HugPackage
{
   function armor::onMount(%this,%obj,%col,%slot)
   {
      Parent::onMount(%this,%obj,%col,%slot);
      if(%col.dataBlock $= legoMobileVehicle)
      {
         %obj.playThread(0, armreadyboth);
      }
   }
};
activatepackage(HugPackage);

Any help?

Image for Tony.
« Last Edit: April 11, 2011, 08:52:33 PM by Blastdown »

make them sit after they hug?

Post a picture of what happens for people to see.

make them sit after they hug?

I don't know how to do that. :o

Just use the built-in hug command.

Code: [Select]
package HugPackage
{
   function armor::onMount(%this,%obj,%col,%slot)
   {
      Parent::onMount(%this,%obj,%col,%slot);
      if(%col.dataBlock $= legoMobileVehicle)
         serverCmdHug(%obj.client);
   }
};
activatepackage(HugPackage);
That should work. I think I got the variable for the client right (%obj.client).
« Last Edit: April 11, 2011, 08:59:24 PM by Greek2me »

I did this for the HMG Turret.

Of course, the player is standing, so I never encoutered this problem.

make them sit after they hug?
sitting is a different variable in the vehicle code.
standing should be 'root'.
erm, i found it.

Code: [Select]
mountThread[0] = "root";
you should find that somewhere in your code. If it is not already, change it to:

Code: [Select]
mountThread[0] = "sit";
If the code is already like that, I have no clue.

That's not the problem.

His problem is that they stand up when he tells them to hug.

Has nobody noticed that I already posted how to do this?

Just use the built-in hug command.

package HugPackage
{
   function armor::onMount(%this,%obj,%col,%slot)
   {
      Parent::onMount(%this,%obj,%col,%slot);
      if(%col.dataBlock $= legoMobileVehicle)
         serverCmdHug(%obj.client);
   }
};
activatepackage(HugPackage);


That should work. I think I got the variable for the client right (%obj.client).
All I did was take his original code and add in the serverCmdHug part.

Has nobody noticed that I already posted how to do this?
All I did was take his original code and add in the serverCmdHug part.
yeah i noticed that, and then tried it just now and it worked.

use greek2me's code, OP.

Wouldn't someone be able to break that simply by setting and unsetting a tool? If you switch it to another animation slot or whatever, it'd hold...

Try %obj.playThread(2, armReadyBoth);. It's on a different animation slot to the root animation.

Wouldn't someone be able to break that simply by setting and unsetting a tool? If you switch it to another animation slot or whatever, it'd hold...
Nope. Type /hug and then pull out a gun. It stays. oops
« Last Edit: April 12, 2011, 06:01:29 PM by Greek2me »

He got it to work, I am trying it now in my server. Except, it stops forcing the hug when I pull out an item.

He got it to work, I am trying it now in my server. Except, it stops forcing the hug when I pull out an item.
Have the script play the animation every time function WeaponImage::onMount() is called