Blockland Forums > Modification Help
making mounted object player the walking/crouch etc animations
zmaster:
[not possible topic dead]
Does anyone know how to make an object mounted to a bot play the animations for walking when moving forward etc?
Code
--- Code: --- package gravPack
...
{
function Player::setActionThread(%this,%name, %hold, %fsp)
{
echo(%name);
%mount = %this.getMountedObject(0);
if(%this.dataBlock $= PlayerD && isObject(%this.getMountedObject(0)))
{
%mount.setActionThread(%this,%name, %hold, %fsp);
echo("poo");
}
else
parent::setActionThread(%this,%name, %hold, %fsp);
}
}; activatePackage(gravPack);
...
--- End code ---
I have also tried playthread(....)
Edit:
I mean when the bot walks forwards the player mounted to the bot plays the animation rather than the bot.
I do unconventional things with bots, we can just leave it at that.
Port:
Uhm, what?
Slicks555:
--- Quote from: Port on May 25, 2012, 01:26:03 PM ---Uhm, what?
--- End quote ---
He wants to have a mounted player play the animations that the Bot should play.
Like, if the bot is playing armFire, he wants to redirect it to the object that's mounted to it.
I actually don't know if this is possible, but I'd try parenting playThread
Port:
--- Code: ---package your_package
{
function Player::playThread( %this, %x, %y )
{
parent::playThread( %this, %x, %y );
%db = %this.getDataBlock();
for ( %i = 0 ; %i < %db.numMountPoints ; %i++ )
{
%obj = %this.getMountedObject( %i );
if ( isObject( %obj ) )
{
// This won't recurse and go a step back because you cannot do circular mounting.
%obj.playThread( %x, %y );
}
}
}
};
activatePackage( "your_package" );
--- End code ---
zmaster:
playThread does not seem to be called when the running/backpedal/crouch/fall animations are played, whan method is called for those?
playThread seems to only be called when you use tools