Invisible Playertype

Author Topic: Invisible Playertype  (Read 1712 times)

I need a playertype that is 100% invisible and has 100 hp, also no jets.

Could someone show me a WORKING link or make an add-on? I've been searching for ages and haven't found anything.
« Last Edit: September 19, 2015, 02:04:28 PM by Cone² »

Not sure if this can work.

Code: server.cs (16 lines)
datablock PlayerData(InvisiblePlayerNoJet : PlayerStandardArmor)
{
    minJetEnergy = 0;
    jetEnergyDrain = 0;
    canJet = 0;

    uiName = "Invisible No-Jet Player";
    showEnergyBar = false;
};

function InvisiblePlayerNoJet::onNewDatablock(%data, %obj)
{
    Parent::onNewDatablock(%data, %obj);
    %obj.setShapeNameDistance(0);
    %obj.hideNode("ALL");
}


You also need to do
Code: [Select]
function InvisiblePlayerNoJet::onAdd(%data, %obj)
{
    %obj.setShapeNameDistance(0);
    %obj.hideNode("ALL");
}

So we don't need the parent for onAdd, but we need it for onNewDatablock?


So we don't need the parent for onAdd, but we need it for onNewDatablock?
I've never seen onNewDatablock being used in any script i've ever seen, so if that's what you're using, it's definitely not a common thing

onNewDatablock is called when you change a datablock to a different datablock (does not call after that), basically, but I'm not sure if I should include the parent.

So we don't need the parent for onAdd, but we need it for onNewDatablock?
onNewDatablock is called when you change a datablock to a different datablock (does not call after that), basically, but I'm not sure if I should include the parent.
Yes. onAdd is only a callback. Pretty sure you should parent onNewDatablock. Not sure if you should package it, I did in my playertype.

Armor::onNewDatablock does something by default, so you should parent it.

Armor::onNewDatablock does something by default, so you should parent it.
From what I seen it helps apply nodes on the avatar, since one time I forgot to parent it and my character looked like an AI player

From what I seen it helps apply nodes on the avatar, since one time I forgot to parent it and my character looked like an AI player
but theoretically it wouldn't matter since its invisible

I'm sure it causes more issues however