Author Topic: Add the hat to Hole Bot  (Read 2919 times)

I talked to Masterlegodude about this, He not know about it, So I want make this thread.

I know how make Hole bot script.  I use the model armyhat.dts, How I am going add it to bot head for a hat?

What exactly are you trying to accomplish?

He wants to mount a custom hat to a bot from a bot hole.

He wants to mount a custom hat to a bot from a bot hole.
This

call
Code: [Select]
object.mountImage(yourimage,$headSlot); when your bot is created

call
Code: [Select]
object.mountImage(yourimage,$headSlot); when your bot is created
Okay, which I put in line of script and I name (armyhat) in the line?
I has 3 kind of army hats.

Code: [Select]
function BlockheadHoleBot::onAdd(%this,%obj)
{
   armor::onAdd(%this,%obj);
   %obj.mountImage(armyhat,$headSlot);
}

Now how you code the hat's image data i don't know, it's been a long time since i've worked with hats...

Code: [Select]
function BlockheadHoleBot::onAdd(%this,%obj)
{
   armor::onAdd(%this,%obj);
   %obj.mountImage(armyhat,$headSlot);
}

Now how you code the hat's image data i don't know, it's been a long time since i've worked with hats...

Okay, I will try that. If it does not work. I will let you know and post here.

EDIT: I did tested, It does not showed up and no error at console.
« Last Edit: March 14, 2013, 08:33:23 PM by Furling² »

I did re-wrote this code:
Code: [Select]
Add-Ons/Bot_Construction/bot_construction.cs Line: 92 - Syntax error.
>>> Some error context, with ## on sides of error halt:
datablock ShapeBaseImageData(HardHatImage)

{

shapeFile = "./HardHat.dts";

emap = true;

mountPoint = $HeadSlot;

offset = "0 0.02 0.3";

eyeOffset = "0 0 -1";

rotation = eulerToMatrix("0 0 0");

scale = "0.1 0.1 0.1";

doColorShift = false;

colorShiftColor = "0 0 0 1.000";

};

{##
##
^// echo( "Blockhead onLoop" );

^// parent::onBotLoop( %this, %obj );

^//Called every cycle

^//Useful for doing unique behaviors during normal loop

}



function BlockheadHoleBot::onBotCollision( %this, %obj, %col, %normal, %speed )

{

^// echo( "Blockhead onCollision" );
>>> Error report complete.

ADD-ON "Bot_Construction" CONTAINS SYNTAX ERRORS

I got it from Emote_Hardhat script
Code: [Select]
datablock ShapeBaseImageData(HardHatImage)
{
shapeFile = "./HardHat.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0.02 0.3";
eyeOffset = "0 0 -1";
rotation = eulerToMatrix("0 0 0");
scale = "0.1 0.1 0.1";
doColorShift = false;
colorShiftColor = "0 0 0 1.000";
};

Code: [Select]
function BlockheadHoleBot::onAdd(%this,%obj)
{
   armor::onAdd(%this,%obj);
   %obj.mountImage(armyhat,$headSlot);
}

Now how you code the hat's image data i don't know, it's been a long time since i've worked with hats...
Are you forget about this line ?
Code: [Select]
shapeFile = "./HardHat.dts";

Code: [Select]
datablock ShapeBaseImageData(HardHatImage)
{
shapeFile = "./hardhat.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0 0.1";
eyeOffset = "0 0 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "1 1 1";
doColorShift = true;
colorShiftColor = "0.000 0.500 0.250 1.000";
}

function BlockheadHoleBot:onAdd(%this,%obj)
{
parent::onAdd(%this,%obj);
BlockheadHoleBot:onAdd(%this,%obj);
//schedule(10,0,national socialistfy,%obj);
schedule(15,0,Survivorfy,%obj);
//schedule(20,0,ghostifybot,%obj);
//%obj.playthread(2,armreadyright);
//%obj.setarmthread(crouch);
//%obj.mountimage(m4image,0);
              %obj.mountimage(m4image,0);
%obj.mountimage(hardhatImage,2);
}

CONTAINS SYNTAX ERRORS:
Code: [Select]
Add-Ons/Bot_Construction/bot_construction.cs Line: 93 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^shapeFile = "./hardhat.dts";

^emap = true;

^mountPoint = $HeadSlot;

^offset = "0 0 0.1";

^eyeOffset = "0 0 0.4";

^rotation = eulerToMatrix("0 0 0");

^scale = "1 1 1";

^doColorShift = true;

^colorShiftColor = "0.000 0.500 0.250 1.000";

}



function ##B##lockheadHoleBot::onAdd(%this,%obj)

{

^parent::onAdd(%this,%obj);

^BlockheadHoleBot::onAdd(%this,%obj);

^//schedule(10,0,national socialistfy,%obj);

^schedule(15,0,Survivorfy,%obj);

^//schedule(20,0,ghostifybot,%obj);

^//%obj.playthread(2,armreadyright);

^//%obj.setarmthread(crouch);
>>> Error report complete.

If your bot has a custom datablock, you can simply package function yourBotPlayerData::onAdd(%this,%obj){%obj.mountimage(5,blahimage); parent::onAdd();}

Im typing on a moblie device, so it's probably not a good idea to just copy that code directly.

Code: [Select]
function BlockheadHoleBotPlayerData::onAdd(%this,%obj){%obj.mountimage(5,HardHatimage); parent::onAdd();}CONTAINS SYNTAX ERRORS:
Code: [Select]
>>> Some error context, with ## on sides of error halt:
^%obj.secondPack = "0";

^%obj.secondPackColor = "0 0 0 0";



^GameConnection::ApplyBodyParts(%obj);

^GameConnection::ApplyBodyColors(%obj);

}



function BlockheadHoleBotPlayerData::onAdd(%this,%obj){%obj.mountimage(5,HardHatimage); parent::onAdd();}



{##
##
^// echo( "Blockhead onLoop" );

^// parent::onBotLoop( %this, %obj );

^//Called every cycle

^//Useful for doing unique behaviors during normal loop

}



function BlockheadHoleBot::onBotCollision( %this, %obj, %col, %normal, %speed )

{

^// echo( "Blockhead onCollision" );
>>> Error report complete.

-scary code-
Code: [Select]
datablock ShapeBaseImageData(HardHatImage)
{
shapeFile = "./hardhat.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0 0.1";
eyeOffset = "0 0 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "1 1 1";
doColorShift = true;
colorShiftColor = "0.000 0.500 0.250 1.000";
};

function BlockheadHoleBot::onAdd(%this,%obj)
{
parent::onAdd(%this,%obj);
//schedule(10,0,national socialistfy,%obj);
schedule(15,0,Survivorfy,%obj);
//schedule(20,0,ghostifybot,%obj);
//%obj.playthread(2,armreadyright);
//%obj.setarmthread(crouch);
//%obj.mountimage(m4image,0);
              %obj.mountimage(m4image,0);
%obj.mountimage(hardhatImage,2);
}

That should work, unless something else is wrong.

Also the error on your above post is because you have two brackets just lying around there.
« Last Edit: March 15, 2013, 01:01:31 PM by HellsHero »

Code: [Select]
datablock ShapeBaseImageData(HardHatImage)
{
shapeFile = "./hardhat.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0 0.1";
eyeOffset = "0 0 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "1 1 1";
doColorShift = true;
colorShiftColor = "0.000 0.500 0.250 1.000";
};

function BlockheadHoleBot::onAdd(%this,%obj)
{
parent::onAdd(%this,%obj);
//schedule(10,0,national socialistfy,%obj);
schedule(15,0,Survivorfy,%obj);
//schedule(20,0,ghostifybot,%obj);
//%obj.playthread(2,armreadyright);
//%obj.setarmthread(crouch);
//%obj.mountimage(m4image,0);
              %obj.mountimage(m4image,0);
%obj.mountimage(hardhatImage,2);
}

That should work, unless something else is wrong.

Also the error on your above post is because you have two brackets just laying around there.

CONTAINS SYNTAX ERRORS:
Code: [Select]
>>> Some error context, with ## on sides of error halt:
^%obj.rarmColor = "1 1 1 1";

^%obj.Rhand = "0";

^%obj.rhandColor = "0 0 0 0";

^%obj.rleg = "0";

^%obj.rlegColor = "0 0 0 0";

^%obj.secondPack = "0";

^%obj.secondPackColor = "0 0 0 0";



^GameConnection::ApplyBodyParts(%obj);

^GameConnection::ApplyBodyColors(%obj);

}



{##
##
^// echo( "Blockhead onLoop" );

^// parent::onBotLoop( %this, %obj );

^//Called every cycle

^//Useful for doing unique behaviors during normal loop

}



function BlockheadHoleBot::onBotCollision( %this, %obj, %col, %normal, %speed )

{

^// echo( "Blockhead onCollision" );
>>> Error report complete.

Full script:
Code: [Select]
datablock fxDTSBrickData (BrickconstructionBot_HoleSpawnData)
{
brickFile = "Add-ons/Bot_Hole/4xSpawn.blb";
category = "Special";
subCategory = "Holes";
uiName = "Construction";
iconName = "Add-Ons/Bot_Construction/icon_construction";

bricktype = 2;
cancover = 0;
orientationfix = 1;
indestructable = 1;

isBotHole = 1;
holeBot = "constructionHoleBot";
};

datablock PlayerData(constructionHoleBot : PlayerStandardArmor)
{
uiName = "";
minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;
maxItems   = 0;
maxWeapons = 0;
maxTools = 0;
runforce = 100 * 90;
maxForwardSpeed = 8;
maxBackwardSpeed = 4;
maxSideSpeed = 8;
attackpower = 10;
rideable = false;
canRide = true;

maxdamage = 100;//Bot Health
jumpSound = "";//Removed due to bots jumping a lot

//Hole Attributes
isHoleBot = 1;

hEmote = 1;
};

datablock ShapeBaseImageData(HardHatImage)
{
shapeFile = "./hardhat.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0 0.1";
eyeOffset = "0 0 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "1 1 1";
doColorShift = true;
colorShiftColor = "0.000 0.500 0.250 1.000";
};

function BlockheadHoleBot::onAdd(%this,%obj)
{
parent::onAdd(%this,%obj);
//schedule(10,0,national socialistfy,%obj);
schedule(15,0,Survivorfy,%obj);
//schedule(20,0,ghostifybot,%obj);
//%obj.playthread(2,armreadyright);
//%obj.setarmthread(crouch);
//%obj.mountimage(m4image,0);
              %obj.mountimage(m4image,0);
%obj.mountimage(hardhatImage,2);
}

function constructionHoleBot::onAdd(%this,%obj)
{
armor::onAdd(%this,%obj);

//Appearance construction
%obj.accent = "0";
%obj.accentColor = "0.990 0.960 0 0.700";
%obj.chest = "0";
%obj.chestColor = "1 1 1 1";
%obj.decalName = "worm_engineer";
%obj.faceName = "smileyCreepy";
%obj.hat = "0";
%obj.hatColor = "1 1 0 1";
%obj.headColor = "0.75 0.75 0.75 1";
%obj.Hip = "0";
%obj.hipColor = "0 0 0 0";
%obj.Larm = "0";
%obj.larmColor = "1 1 1 1";
%obj.Lhand = "0";
%obj.lhandColor = "0 0 0 0";
%obj.lleg = "0";
%obj.llegColor = "0 0 0 0";
%obj.pack = "0";
%obj.packColor = "0 0 0 0";
%obj.Rarm = "0";
%obj.rarmColor = "1 1 1 1";
%obj.Rhand = "0";
%obj.rhandColor = "0 0 0 0";
%obj.rleg = "0";
%obj.rlegColor = "0 0 0 0";
%obj.secondPack = "0";
%obj.secondPackColor = "0 0 0 0";

GameConnection::ApplyBodyParts(%obj);
GameConnection::ApplyBodyColors(%obj);
}

{
// echo( "Blockhead onLoop" );
// parent::onBotLoop( %this, %obj );
//Called every cycle
//Useful for doing unique behaviors during normal loop
}

function BlockheadHoleBot::onBotCollision( %this, %obj, %col, %normal, %speed )
{
// echo( "Blockhead onCollision" );
//Called once every second the object is colliding with something
}

function BlockheadHoleBot::onBotFollow( %this, %obj, %targ )
{
// echo( "Blockhead onFollow" );
//Called when the target follows a player each tick, or is running away
}

function BlockheadHoleBot::onBotDamage( %this, %obj, %source, %pos, %damage, %type )
{
// echo( "Blockhead onDamage" );
//Called when the bot is being damaged
}

Code: [Select]
...

{
// echo( "Blockhead onLoop" );
// parent::onBotLoop( %this, %obj );
//Called every cycle
//Useful for doing unique behaviors during normal loop
}

...
Also the error on your above post is because you have two brackets just lying around there.


So therefore...

Full script:
Code: [Select]
datablock fxDTSBrickData (BrickconstructionBot_HoleSpawnData)
{
brickFile = "Add-ons/Bot_Hole/4xSpawn.blb";
category = "Special";
subCategory = "Holes";
uiName = "Construction";
iconName = "Add-Ons/Bot_Construction/icon_construction";

bricktype = 2;
cancover = 0;
orientationfix = 1;
indestructable = 1;

isBotHole = 1;
holeBot = "constructionHoleBot";
};

datablock PlayerData(constructionHoleBot : PlayerStandardArmor)
{
uiName = "";
minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;
maxItems   = 0;
maxWeapons = 0;
maxTools = 0;
runforce = 100 * 90;
maxForwardSpeed = 8;
maxBackwardSpeed = 4;
maxSideSpeed = 8;
attackpower = 10;
rideable = false;
canRide = true;

maxdamage = 100;//Bot Health
jumpSound = "";//Removed due to bots jumping a lot

//Hole Attributes
isHoleBot = 1;

hEmote = 1;
};

datablock ShapeBaseImageData(HardHatImage)
{
shapeFile = "./hardhat.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0 0.1";
eyeOffset = "0 0 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "1 1 1";
doColorShift = true;
colorShiftColor = "0.000 0.500 0.250 1.000";
};

function BlockheadHoleBot::onAdd(%this,%obj)
{
parent::onAdd(%this,%obj);
//schedule(10,0,national socialistfy,%obj);
schedule(15,0,Survivorfy,%obj);
//schedule(20,0,ghostifybot,%obj);
//%obj.playthread(2,armreadyright);
//%obj.setarmthread(crouch);
//%obj.mountimage(m4image,0);
              %obj.mountimage(m4image,0);
%obj.mountimage(hardhatImage,2);
}

function constructionHoleBot::onAdd(%this,%obj)
{
armor::onAdd(%this,%obj);

//Appearance construction
%obj.accent = "0";
%obj.accentColor = "0.990 0.960 0 0.700";
%obj.chest = "0";
%obj.chestColor = "1 1 1 1";
%obj.decalName = "worm_engineer";
%obj.faceName = "smileyCreepy";
%obj.hat = "0";
%obj.hatColor = "1 1 0 1";
%obj.headColor = "0.75 0.75 0.75 1";
%obj.Hip = "0";
%obj.hipColor = "0 0 0 0";
%obj.Larm = "0";
%obj.larmColor = "1 1 1 1";
%obj.Lhand = "0";
%obj.lhandColor = "0 0 0 0";
%obj.lleg = "0";
%obj.llegColor = "0 0 0 0";
%obj.pack = "0";
%obj.packColor = "0 0 0 0";
%obj.Rarm = "0";
%obj.rarmColor = "1 1 1 1";
%obj.Rhand = "0";
%obj.rhandColor = "0 0 0 0";
%obj.rleg = "0";
%obj.rlegColor = "0 0 0 0";
%obj.secondPack = "0";
%obj.secondPackColor = "0 0 0 0";

GameConnection::ApplyBodyParts(%obj);
GameConnection::ApplyBodyColors(%obj);
}

function BlockheadHoleBot::onBotCollision( %this, %obj, %col, %normal, %speed )
{
// echo( "Blockhead onCollision" );
//Called once every second the object is colliding with something
}

function BlockheadHoleBot::onBotFollow( %this, %obj, %targ )
{
// echo( "Blockhead onFollow" );
//Called when the target follows a player each tick, or is running away
}

function BlockheadHoleBot::onBotDamage( %this, %obj, %source, %pos, %damage, %type )
{
// echo( "Blockhead onDamage" );
//Called when the bot is being damaged
}
« Last Edit: March 15, 2013, 01:01:24 PM by HellsHero »