Author Topic: Mounting To Back Crashing Blockland  (Read 2269 times)

Whenever I mount the item to my back if I go into third person mode Blockland crashes. Anyone know how to fix this?
Code: [Select]
function FLUDDImage::onMount(%this, %obj, %slot)
{
parent::onMount(%this, %obj, %slot);

%obj.playThread(1, root);
%obj.mountImage(FLUDDImage, 2);

%obj.hideNode(cape);
%obj.hideNode(pack);
%obj.hideNode(quiver);
%obj.hideNode(tank);
%obj.hideNode(armor);
%obj.hideNode(bucket);
}

function FLUDDImage::onUnMount(%this, %obj, %slot)
{
parent::onUnMount(%this, %obj, %slot);

%obj.unMountImage(2);
%obj.client.applyBodyParts();
%obj.client.applyBodyColors();
}

Why are you mounting it after mounting it already?

Why are you unmounting it after it's unmounted?

Why are you mounting it after mounting it already?

Why are you unmounting it after it's unmounted?
Hmm, never thought of that.

Code: [Select]
function FLUDDImage::onMount(%this, %obj, %slot)
{
parent::onMount(%this, %obj, %slot);

%obj.unMountImage(2);
%obj.client.applyBodyParts();
%obj.client.applyBodyColors();
//unMount from their hand before mounting it to their back

%obj.playThread(1, root);
%obj.mountImage(FLUDDImage, 2);
//Mount it to their hand

%obj.hideNode(cape);
%obj.hideNode(pack);
%obj.hideNode(quiver);
%obj.hideNode(tank);
%obj.hideNode(armor);
%obj.hideNode(bucket);
//Hide anything already on their back
}

function FLUDDImage::onUnMount(%this, %obj, %slot)
{
parent::onUnMount(%this, %obj, %slot);

%obj.unMountImage(2);
//unMount the image on their back

%obj.client.applyBodyParts();
%obj.client.applyBodyColors();
//Put on any clothes they had on their back
}

Grr, even that crashes Blockland.

try putting the parent after all the stuff that unmounts/mounts the backpack/quiver/bucket

you don't need to unMount whenever they unmount it

So since all of my attempts crash Blockland can someone tell me how to do it?


it's the model
No it's not, I tried it with the gun model and it still crashed.
Code: [Select]
function FLUDDImage::onMount(%this, %obj, %slot)
{
parent::onMount(%this, %obj, %slot);

if(%obj.getMountedImage(1).getName() $= "FLUDDImage")
{
%obj.unMountImage(1);
%obj.mountImage(FLUDDImage, 1);
//Mount it to their back

%obj.hideNode(cape);
%obj.hideNode(pack);
%obj.hideNode(quiver);
%obj.hideNode(tank);
%obj.hideNode(armor);
%obj.hideNode(bucket);
//Hide anything already on their back
}
}

function FLUDDImage::onUnMount(%this, %obj, %slot)
{
parent::onUnMount(%this, %obj, %slot);

if(%obj.getMountedImage(1).getName() !$= "FLUDDImage")
{
%obj.client.applyBodyParts();
%obj.client.applyBodyColors();

%obj.unMountImage(1);
%obj.mountImage(FLUDDImage, 1);
//Mount it to their back

%obj.hideNode(cape);
%obj.hideNode(pack);
%obj.hideNode(quiver);
%obj.hideNode(tank);
%obj.hideNode(armor);
%obj.hideNode(bucket);
//Hide anything already on their back
}
}

function FLUDDItem::onPickup(%this, %obj, %col, %a)
{
for(%i = 0; %i < %col.getDatablock().maxTools; %i++)
{
%item = %col.tool[%i];

if(%item == 0 || (%item $= ""))
{
%freeSlot = 1;

break;
}
}

if(%obj.canPickup && (!isObject(%col.getMountedImage(1)) && %freeSlot))
{
%col.mountImage(FLUDDImage, 1);
}

parent::onPickup(%this, %obj, %col, %a);
}

function serverCmdDropTool(%this, %slot)
{
if(isObject(%this.player.tool[%slot]) && %this.player.tool[%slot].getName() $= "FLUDDItem")
{
parent::serverCmdDropTool(%this, %slot);

if(isObject(%this.player.getMountedImage(1)) && %this.player.getMountedImage(1).getName() $= "FLUDDImage")
{
%this.player.schedule(5, 0, unMountImage, 1);
}

return;
}

parent::serverCmdDropTool(%this, %slot);
}

You are telling it to mount within onMount. that would cause an infinite loop.

You are telling it to mount within onMount. that would cause an infinite loop.
yeah why wasn't this fixed when it was in the first reply
Why are you mounting it after mounting it already?

Ok, I got the mounting to back all fixed except when it's mounted to your back and you take out the item and fire it does not work.

Ok, I got the mounting to back all fixed except when it's mounted to your back and you take out the item and fire it does not work.
what do you mean by does not work? Give us some more information

what do you mean by does not work? Give us some more information
When you have the weapon selected it is mounted to your back fine but when you fire it treats it as clicking without a weapon.

You might wanna check out my Halloween Headgear on RTB. It has similar mounting things.