script_superhat

Author Topic: script_superhat  (Read 13669 times)


why not make a bot with no model and mount it to the player and then mount hats to that


hat2?




i was wondering what happened to your masks add-on
i quit blockland. its super loving easy to make, just needs like a modular framework like the current hatmod uses

i quit blockland. its super loving easy to make, just needs like a modular framework like the current hatmod uses

give us a example file because some of us aren't too bright

i quit blockland. its super loving easy to make, just needs like a modular framework like the current hatmod uses
may be easy but if it really is you should post it so others can continue

give us a example file because some of us aren't too bright
what kind of example
« Last Edit: October 04, 2017, 08:16:53 PM by Kyuande »

Code: [Select]
datablock TSShapeConstructor(Mask_TophatData)
{
baseShape = "./tophat.dts";
//sequence0 = "./root.dsq root";
};

datablock PlayerData(Mask_TopHatBot : PlayerNoJet)
{
class = "MaskData";
shapeFile = "./tophat.dts";
dustEmitter = LiftoffDustEmitter;

Mask_slot = 5;

Mask_nodeCount = 3;

Mask_node[0] = "black";
Mask_nodeColor[0] = "0 0 0 1";

Mask_node[1] = "hat";
Mask_nodeInherit[1] = "hat";

Mask_node[2] = "accent";
Mask_nodeInherit[2] = "accent";
};
this is essentially how i initiallize hats as bots n stuff. the model is almost identical to like hatmod, but i take every colored part and make it its own object, which can later be changed through setNodeColor();

the mask_node
  • stuff is the name of the object/node on that hat, and nodeinherit is the part of the player that it will inherit the color of. for example, mask_nodeInherit[1] = "hat"; will take the player's hat color and apply it to that object.


then i create it in game using %mask = new AiPlayer() { datablock = %thedataiuseforthemask; class = "MaskBot"; }; and use mountObject to mount the bot to the player (as if it was a hat)

Code: [Select]
function AiPlayer::Mask_applyColors(%this,%obj)
{
if(%this.class !$= "MaskBot")
return;

%data = %this.getDatablock();
for(%i=0; %i < %data.Mask_nodeCount; %i++)
{
if(%data.Mask_nodeInherit[%i] !$= "")
{
if(%data.Mask_nodeSubtractiveColor[%i] !$= ""){
//announce(%data.mask_nodeInherit[%i] SPC Mask_SubtractiveColor(%obj.client.hatcolor,%data.Mask_nodeSubtractiveColor[%i]));
eval("%this.setNodeColor(%data.Mask_node[%i],Mask_subtractiveColor(%obj.client." @ %data.Mask_nodeInherit[%i] @ "color,%data.Mask_nodeSubtractiveColor[%i]));"); }
else
eval("%this.setNodeColor(%data.Mask_node[%i],getWords(%obj.client." @ %data.Mask_nodeInherit[%i] @ "color,0,2) SPC 1);");
}
else if(%data.Mask_nodeColor[%i] !$= "")
%this.setNodeColor(%data.Mask_node[%i],%data.Mask_nodeColor[%i]);
}
%obj.client.applyBodyColors();
%obj.hideNode("visor");
%obj.hideNode("plume");
%obj.hideNode("triplume");
%obj.hideNode("septplume");
%obj.hideNode("helmet");
%obj.hideNode("pointyHelmet");
%obj.hideNode("flareHelmet");
%obj.hideNode("bicorn");
%obj.hideNode("cophat");
%obj.hideNode("knithat");
%obj.hideNode("scouthat");
}
most of this is gibberish but i just check for values like Mask_node and values and recolor them based on the data it reads. also i hide every hat/bicorn/visor the player has on. then i just call the above every time the player changes their avatar to ensure it updates the colors every time you make a change
« Last Edit: October 04, 2017, 08:35:05 PM by PhantOS »

its essentially the same principle as hatmod- mount the hat to the player. the only difference is that the hats are more complex to make, they can actually be shot off of your head, and they need to be manually colored either through code or by a file of some sort.

unfortunately, you can't wear more than one bothat because every bot you mount after the first will be visible in first person, so your view will be entirely obstructed/it will look very buggy

unfortunately, you can't wear more than one bothat because every bot you mount after the first will be visible in first person, so your view will be entirely obstructed/it will look very buggy
Give the bot hat a mount point, and let other hats mount to it

i feel like you can set it up in a better way to not require eval... but ok. works i guess.

Give the bot hat a mount point, and let other hats mount to it
still wont work, you can only have one bot mounted to you that is invisible in first person.

heads up buddy is gonna update this so youll get it from me first

still wont work, you can only have one bot mounted to you that is invisible in first person.

who said they have to be invisible? we just need more hats