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

Also when you leave the vehicle you will still hug, is it possible to fix that so when you get out you don't automatically continue to hug?

well i think the only way to fix it is reoving this force hug script from bikes

Bump.

The codebit Greek2Me provided killed the standing, but the hands remain when exiting.
The idea is to have the player bring its hands up when it enters, and to keep them up until it exits.

I can not code, and the time it would take for me to figure out this thing would be a waste of time.
I'd appreciate it if someone could give me a block of code that does what I need.

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

   function armor::onUnMount(%this,%obj,%col,%slot)
   {
      Parent::onMount(%this,%obj,%col,%slot);
      if(%col.dataBlock $= legoMobileVehicle)
         %obj.playThread(0, root);
   }
};
activatepackage(HugPackage);
BTW, I'm guessing on the playThread bit.


Try this.
-snip-
BTW, I'm guessing on the playThread bit.
Code: [Select]
package HugPackage
{
   function armor::onMount(%this,%obj,%col,%slot)
   {
      Parent::onMount(%this,%obj,%col,%slot);
      if(%col.dataBlock $= legoMobileVehicle)
         %obj.playThread(2, armReadyBoth);
   }

   function armor::onUnMount(%this,%obj,%col,%slot)
   {
      Parent::onMount(%this,%obj,%col,%slot);
      if(%col.dataBlock $= legoMobileVehicle)
         %obj.playThread(2, root);
   }
};
activatepackage(HugPackage);
No idea what action number hugging sets itself to. So just replace the hug with the playThread.
« Last Edit: April 21, 2011, 02:08:12 AM by Daenth »

No idea what action number hugging sets itself to. So just replace the hug with the playThread.

This fixes the hands, but now I am sit-walking when I exit the vehicle.
Haha.

Try this
Code: [Select]
package HugPackage
{
   function armor::onMount(%this,%obj,%col,%slot)
   {
      Parent::onMount(%this,%obj,%col,%slot);
      if(%col.dataBlock $= legoMobileVehicle)
         %obj.playThread(2, armReadyBoth);
   }

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

Try this

That appears to have done it.
Unless a problem is found, that should do it. Thanks.

That appears to have done it.
Unless a problem is found, that should do it. Thanks.
The credit goes to Greek, I only added the playThread lines.

Try this
package HugPackage
{
   function armor::onMount(%this,%obj,%col,%slot)
   {
      Parent::onMount(%this,%obj,%col,%slot);
      if(%col.dataBlock $= legoMobileVehicle)
         %obj.playThread(2, armReadyBoth);
   }

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


Oops, change from onMount to onUnMount. I also have a feeling that the 4th arguement (%slot) in onUnMount doesn't exist.