Author Topic: [Solved] Making a model invisible in first person  (Read 1414 times)

Hey guys! I made this thing:

But it bugs out in first person


..stuff
I didn't get anything from this topic, since it was a bit vague. Any ideas?

My code:
function servercmdMage(%client)
{
   %client.player.unmountImage(5);
   %client.player.mountImage(MageRobesImage, $backSlot);
}
datablock shapeBaseImageData(MageRobesImage)
{
   shapeFile = "./models/mageRobes.dts";
   mountPoint = $backSlot;
   emap = false;
   rotation = eulerToMatrix("0 0 0");
    offset = "-0.08 0.65 -0.48";
    eyeOffset = 0;
    scale = "1 1 1";
     doColorShift = false;
     colorShiftColor = "50.000 50.000 50.000 255.000";
};
« Last Edit: August 05, 2015, 01:57:27 PM by Johnny Blockhead »

set the eye offset to like "0 0 50"
they won't be able to see it if it is about a mile up in the air


Hey, so I ran into another problem. I'm trying to make a system where you can craft the three different armor types, and then equipt them separately. So far, I've made the model for the helmet and the chestplate. Yet, when I try and put on the helmet after I put on the chestplate, the chestplate disappears (and vice-versa). Any solutions?

function gameConnection::equiptChestplate(%client)
{
   if(!isObject(%client.player))
      return false;
   %client.player.mountImage(MetalChestplateImage, $backSlot);
}
datablock shapeBaseImageData(MetalChestplateImage)
{
   shapeFile = "./models/armorChestplate.dts";
   mountPoint = $backSlot;
   emap = true;
   rotation = eulerToMatrix("0 0 0");
    offset = "0.005 0.07 -0.53";
    eyeOffset = "0 0 50";
    scale = "1 1 1";
     doColorShift = false;
     colorShiftColor = "50.000 50.000 50.000 255.000";
};

function gameConnection::equiptHelmet(%client)
{
   if(!isObject(%client.player))
      return false;
   %client.player.mountImage(MetalHelmetImage, $headSlot);
}
datablock shapeBaseImageData(MetalHelmetImage)
{
   shapeFile = "./models/armorHelmet.dts";
   mountPoint = $headSlot;
   emap = true;
   rotation = eulerToMatrix("0 0 0");
    offset = "0 -0.1 0.05";
    eyeOffset = "0 0 50";
    scale = "1 1 1";
     doColorShift = false;
     colorShiftColor = "50.000 50.000 50.000 255.000";
};
function servercmdget(%client)
{
   %client.player.mountImage(MetalHelmetImage, $backSlot);
   %client.player.mountImage(MetalChestplateImage, $hipSlot);
}tt]

I think it's because they are being mounted on the same slot, when in the mountImage command they're being mounted onto different ones. It's weird, any ideas?

Well, the player only has 4 slots. Not "slots" per say, but slots that can be mounted by anything anywhere.

So you have your normal slots like $backSlot and $hipSlot but then you have slots 0 1 2 and 3 which is what slot you mount them on.

0 is used for weapons
1 is used for the second hand in akimbo weapons
2 is used for the pain emitter
and 3 is used for anything you want.

the correct syntax to mount an object to slot 0 with mountImage is %obj.mountImage(image, 0);

You can only have one image per slot for a grand total of 4 images mounted at once.

Be warned, if a player takes damage, and your armor is mounted to slot 2, the game will mount the pain image to slot 2, and will dismount your armor image.
If your armor is mounted to slot 1? An akimbo weapon will dismount that.

If you mount your armor to slot 3, because you can only have 1 image mounted to slot 3 at a time, that's only 1 allowed mounted image without default game functions overriding your armor slot placement. Not to mention 3rd party add-ons also mounting stuff to slot 3.

I suppose you could also package the pain function to not mount the pain image while the player has the armor equipped, but I'm not sure if you could even do that. You might have to package the damage function itself.

Also, you can't have more than 1 image mounted on the same slot, IE you can't have 2 armor pieces on $hipSlot

TL;DR: Blockland's 4 image limit at a time is loving stupid.
« Last Edit: August 05, 2015, 11:50:39 PM by Darksaber2213 »

I'm making a SurvivalRPG in pretty much prehistoric times, so guns wouldn't be used, let alone guns akimbo. I guess I'll use the 1 and 3 slots.

set the eye offset to like "0 0 50"
they won't be able to see it if it is about a mile up in the air
Woooow you just fixed hats on my jailbreak thanks man.

Doesn't the "firstPerson" variable work then in ShapeBaseImageData?
Because if that works, you should be able to make mountable things invisible in firstPerson by adding:
firstPerson = false;
To the ShapeBaseImageData datablock of the hats/armor/whatever.
Never had to make something invisible in first person and i would test it, but i currently can't.
It seems like a better solution then shifting the position of it in 1st person...

Doesn't the "firstPerson" variable work then in ShapeBaseImageData?
Because if that works, you should be able to make mountable things invisible in firstPerson by adding:
firstPerson = false;
To the ShapeBaseImageData datablock of the hats/armor/whatever.
Never had to make something invisible in first person and i would test it, but i currently can't.
It seems like a better solution then shifting the position of it in 1st person...
thats what I always do, I'd say its the easiest solution and works as intended