Author Topic: Playing the 'armReadyBoth' animation when entering a vehicle?  (Read 598 times)

Still working on my Snowmobile and i'm dumbfounded, i'm trying to make the player's hands go up by using the 'armReadyBoth' animation when they mount the vehicle, and for their hands to go back down when they un-mount it, i've been trying different things, but i can't seem to get it working, i would like some help with this

Code: [Select]
if(isPackage(holdSnowMobile))
   deactivatePackage(holdSnowMobile);
package holdSnowMobile {
   function armor::onMount(%this,%obj,%col,%slot {
      parent::onMount(%this,%obj,%col,%slot);
      if(%col.getDataBlock() == yourSnowMobile.getID())
         %obj.playThread(2,armReadyBoth);announce(yes);
   }
};
activatePackage(holdSnowMobile);

Hm, i seem to be failing to find where to put it, when i put it in the .cs file with the rest of the vehicle stuff, it gives me errors and doesn't appear in game

It didn't give me errors and it appeared in game before adding this, so it must be something with the code and/or me not knowing what to do with it

First try:
Code: [Select]
-BLAH BLAH BLAH VEHICLE STUFF-
   //protection for passengers
   protectPassengersBurn   = false;  //protect passengers from the burning effect of explosions?
   protectPassengersRadius = true;  //protect passengers from radius damage (explosions) ?
   protectPassengersDirect = false; //protect passengers from direct damage (bullets) ?

if(isPackage(holdSnowMobile))
   deactivatePackage(holdSnowMobile);
package holdSnowMobile {
   function armor::onMount(%this,%obj,%col,%slot {
      parent::onMount(%this,%obj,%col,%slot);
      if(%col.getDataBlock() == yourSnowMobile.getID())
         %obj.playThread(2,armReadyBoth);announce(yes);
   }
};

activatePackage(holdSnowMobile);

Second try:
Code: [Select]
-BLAH BLAH BLAH VEHICLE STUFF-
   //protection for passengers
   protectPassengersBurn   = false;  //protect passengers from the burning effect of explosions?
   protectPassengersRadius = true;  //protect passengers from radius damage (explosions) ?
   protectPassengersDirect = false; //protect passengers from direct damage (bullets) ?

};

if(isPackage(holdSnowMobile))
   deactivatePackage(holdSnowMobile);
package holdSnowMobile {
   function armor::onMount(%this,%obj,%col,%slot {
      parent::onMount(%this,%obj,%col,%slot);
      if(%col.getDataBlock() == yourSnowMobile.getID())
         %obj.playThread(2,armReadyBoth);announce(yes);
   }
};
activatePackage(holdSnowMobile);

Put a closing parentheses after the %slot arg in the ::onMount function and replace yourSnowMobile with the actual name of your snowmobile.

Don't try to overcomplicate things: vehicle datablocks have fields for this.
For example, Bushido's missile:

Code: [Select]
datablock WheeledVehicleData(MissileVehicle)
{
     ...
     mountThread[0] = "crouch";
     ...
};

Put a closing parentheses after the %slot arg in the ::onMount function and replace yourSnowMobile with the actual name of your snowmobile.
Okay

Don't try to overcomplicate things: vehicle datablocks have fields for this.
For example, Bushido's missile:

Code: [Select]
datablock WheeledVehicleData(MissileVehicle)
{
     ...
     mountThread[0] = "crouch";
     ...
};
I know about that, but aren't those only for the 'sit', 'stand', and 'crouch' animations?

Any animation. If you put "run" in they'll be running on the spot. Try "armreadyboth".

Any animation. If you put "run" in they'll be running on the spot. Try "armreadyboth".
Ah, that worked, but i would like him to sit while his hands are out so they look like he's holding onto handle bars

Code: [Select]
package HoldSnowMobile
{
function armor::onMount(%this, %obj, %vehicle, %slot)
{
parent::onMount(%this, %obj, %vehicle, %slot);
if(%vehicle.getDataBlock() == SNOWMOBILEDATABLOCK.getID())
{
%obj.playThread(1, armReadyBoth);
%obj.playThread(2, sit);
}
}
};
activatePackage(HoldSnowMobile);
Please note "SNOWMOBILEDATABLOCK" which was typed in all caps for your spotting convenience which needs to be edited to the name of your snowmobile's datablock.

Code: [Select]
package HoldSnowMobile
{
function armor::onMount(%this, %obj, %vehicle, %slot)
{
parent::onMount(%this, %obj, %vehicle, %slot);
if(%vehicle.getDataBlock() == SNOWMOBILEDATABLOCK.getID())
{
%obj.playThread(1, armReadyBoth);
%obj.playThread(2, sit);
}
}
};
activatePackage(HoldSnowMobile);
Please note "SNOWMOBILEDATABLOCK" which was typed in all caps for your spotting convenience which needs to be edited to the name of your snowmobile's datablock.
Kay thanks, i'ma try that

Edit: Uh-oh, i tried it, it worked, but if i undo the vehicle while my hands are up, i'll be sliding around on my butt with my hands up, well, i guess i know how to fix this

Edit 2: Apparently not :S
« Last Edit: November 17, 2009, 12:56:08 PM by Masterlegodude »

Remove "%obj.playThread(2, sit);" from that script and set the mount thread to "sit" in the way Truce said.