Author Topic: A better custom Avatar system?  (Read 2671 times)

I'm using Trader's script for mounting pieces to the player model (Hats etc),
Code: [Select]
datablock ShapeBaseImageData(spikehawkImage)
{
shapeFile = "./Shapes/Custom avatars/spikemohawk.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0.02 0.3";
eyeOffset = "0 0 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "1 1 1";
doColorShift = true;
colorShiftColor = "0.200 0.200 0.200 1.000";
};

function serverCmdspikehawk(%client)
{
%player = %client.player;

if(isObject(%player))
{
if(%player.getMountedImage(2) $= nametoID(spikehawkImage))
{
%player.unmountImage(2);
%client.applyBodyParts();
%client.applyBodyColors();
}
else
{
%player.unmountImage(2);
%player.mountImage(spikehawkImage,2);

for(%i = 0;$hat[%i] !$= "";%i++)
{
%player.hideNode($hat[%i]);
%player.hideNode($accent[%i]);
}
}
}
}
the current way I'm doing it eats datablocks for each colour and I'm told I can make a bunch of pre-made images and use them instead. Also if I'm going to be using a system like that would there be a way to have certain mount points reuse the last texture the last custom model was using to save me and people choosing a colour each change. Again would it be possible to make a save system that saves the current selected set and loads every re-spawn/spawn. Any examples or scripts how I could do all this would be great.

I'm trying to go full out on this with best results possible, any help will be very very helpful and credited for your work.

You mimic datablocks, this just makes a copy that doesn't use up a datablock.
Code: [Select]
datablock ShapeBaseImageData(spikehawkImage)
{
shapeFile = "./Shapes/Custom avatars/spikemohawk.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0.02 0.3";
eyeOffset = "0 0 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "1 1 1";
doColorShift = true;
colorShiftColor = "0.200 0.200 0.200 1.000";
};

datablock ShapeBaseImageData(pinkspikehawkImage : spikehawkImage)
{
colorShiftColor = "1.000 0.700 0.700 1.000";
};

No, it still uses up a datablock, its just more organized than writing out the same code hundreds of times.



setSkinName?
Yeah some thing like that but not a clue how it works.

Make the model with texture names following this naming convention:

base.part.png (i.e. base.leftarm.png)

Then make other textures for each of the parts:

red.part.png
blue.part.png

Then you can use %obj.setSkinName("blue");

This will work for static shapes and vehicles and players, but not weapon images.  You're using weapon images for this, so you'll have to do it a different way.  I think Ephi remembers how to do it.  Let me see if I can get him to reply here.

Quote from: Ephialtes
%obj.mountImage(%image,%slot,%loaded,%skinname); //%loaded is a boolean

Just testin to see if something works

Just proving your own idiocy.

Just testin to see if something works

...Why is that striked out if there's an end tag infront of the strike tag, same with the end?

Looks like your in a bit of a pickle.

Make the model with texture names following this naming convention:

base.part.png (i.e. base.leftarm.png)

Then make other textures for each of the parts:

red.part.png
blue.part.png

Then you can use %obj.setSkinName("blue");

This will work for static shapes and vehicles and players, but not weapon images.  You're using weapon images for this, so you'll have to do it a different way.  I think Ephi remembers how to do it.  Let me see if I can get him to reply here.
So how would I go about putting that into the script? Not very good at this. Also what I do to choose colour I want via a GUI? Can I make a drop down menu or do I have to have each colour separated?

I'm still in a bit of a pickle. Still clueless how I would do this all, I'll check around Garage games but any extra help would be nice.

Could you use node color?