Author Topic: Need help making a tool item  (Read 1081 times)

I'm making a tool add-on for Blockland, and I need to know a few things to have it work properly.
(You'll all know what it is later when I either beta host it or release it, and you may be able to figure it out based on my questions anyway)

First off, I need to know how to execute trust checks and centerPrint trust errors the way other tools do it.
Code: [Select]
toolProjectile::OnCollision(%this, %obj, %col, %fade, %pos, %normal) {
if(%col.getClassName() $= "fxDtsBrick") {
//%good = do a trust check
if(%good) {
//perform tool action (I know what I'm doing over here)
}
else //print trust error
else return;
}

Second, I need to know how to display non-render'd brick wireframes when the tool is mounted.

Third, I need to understand how to make a properly functioning get-a-tool slash command.
I've made code to do this before, but either the function didn't make the player's arm get into the "ready" position, or if I made the function do this, the arm would remain "ready" even if you switched weapons and de-quip'd it.


Thanks for the help... (assuming you post with help anyway)

EDIT: Problems 1 & 3 solved by looking at other code. Thanks Falcondude. XD
« Last Edit: September 14, 2008, 07:04:45 PM by Kirbylikesit »

Code: [Select]
function serverCmdToolname(%client) {
%client.mountImage(ToolName, NodeName);
}
I just made that off what I know, I probably put an error or 2 in the format :o

Code: [Select]
function serverCmdToolname(%client) {
%client.mountImage(ToolName, NodeName);
}
I just made that off what I know, I probably put an error or 2 in the format :o

Sorry, nope. I've tried that code before, and it doesn't make your hand stick up in the "ready" position.
It looks odd.
Also, it's %client.player.mountImage(image, node);

Have you taken a look at the duplicator's code? /duplicator should be a good reference for that.

Have you taken a look at the duplicator's code? /duplicator should be a good reference for that.
Wow, how did I not think of that? XD

Although, I still need to know about the wireframe bit.

I'm not sure if doing a trace(1); and equipping a hammer would work, but you could try it, assuming you haven't already. I haven't really played with the default tools' functions so I don't know what you'll find.

v8 has metrics(); that wireframed everything, and made text look like total stuff so you couldn't do crap.

Seems in v9, metrics(); returns an error, but the same effects happen when you take out a tool. Only differences are that it only does invisible bricks and it doesn't screw chat.

Theres a variable in the weapon image that determines if it shows the wireframes I believe.

v8 has metrics(); that wireframed everything, and made text look like total stuff so you couldn't do crap.

Seems in v9, metrics(); returns an error, but the same effects happen when you take out a tool. Only differences are that it only does invisible bricks and it doesn't screw chat.

No, that was an openGL debugging thing by doing glEnableWireframe() or something. The metrics function is used for displaying fps etc.

No, that was an openGL debugging thing by doing glEnableWowseckz() or something. The metrics function is used for displaying fps etc.
Code: [Select]
$glmetrics = 0;
function glmetrics() {
if($glmetrics = 0) {
GLEnableMetrics(1);
commandtoserver('messagesent',"GLMetrics Mode Enabled");
$glmetrics = 1;
}
else {
GLEnableMetrics(0);
commandtoserver('messagesent',"GlMetrics Mode Disabled");
$glmetrics = 0;
}
}
I made that for v8 and it doesn't work in v9 anymore.

I tried metrics(); in v9 recently and it gave me a error like GL Metrics so I thought it was that... I was bored and didn't care to remember it wasn't.