Author Topic: Vanish Mod  (Read 3618 times)

This is now a coding topic


I would hope so
Whoa, it actually got moved to coding help! XD It was originally in the Add-ons section.

Lugnut is entirely right. This mod was not ready for release in any possible way and frankly it would have been impossible to tell him just how bad it was without being rude. I'm sorry you got offended OP, but in the real world if you stuff in a can and try to feed it to people they're going to be rude when you try to pass it off as real food. Furthermore; there is no legitimate reason to make shorthand bindings to single functions. The only people that would use your mod are scripters, and there is not a single scripter here that is incapable of typing findClientByName().player.hideNode("x");. Beyond that, even, your mod didn't even work upon release. %client was undefined in the function and would have just thrown console errors. You also don't need to package original functions, that's utterly pointless. If you're trying to learn to script visit the Coding Help board and learn to script via support and help from the Blockland community; releasing stuffty mods is only going to make us dislike you. Badspot did you a favor in moving this to Coding Help, in reality it would have been more at home in the Fail Bin.
this was my thought process.

This mod was made for modders, that almost makes me obligated to chew it out.

I was going to pm the op an apology and a guide to make it better, but half of that is done already.

So without further ado, sorry for my being a richard and not helpful, op.
Now fix your mod.

Not sure why people are posting and arguing about crappy irrelevant code but okay..

Whoa, it actually got moved to coding help! XD It was originally in the Add-ons section.
Oh, okay




NOTE: I wrote most of this before realizing what the intentions of the OP was.
I apologize to him and marble man for calling them stupid. However, if their intention was to make a mod where people (admins?) can hide other people, then they are stupid.

However, they probably weren't. I'll leave this here anyway in case he wants to read it.




Oh goddamnit

(Kudos to Marble Man for helping with the code)

The WORST person to ask. Sorry marble man, but you're missing some important concepts too. // apparently he has a better grip than me :(

Here's some sample code from the latest revision.
Code: [Select]
function servercmdvanishrhand(%client) {

%client.player.hidenode("rhand");

}

okay, still missing camel case but no one gives a stuff about that anyway, it's cool.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaa

naming the variable 'client' doesn't make it magically work! // ACTUALLY IT DOES STUPID ME LOL

okay, lets introduce you to variable types, which don't exactly exist in torquescript, but for the purposes of this, nvm that.

1: you need to locate a client object to locate the player object to call the hideNode method.
to do so, you need to call findClientByName().

when you call a serverCmd, you can input arguments. these are taken as "strings"

observe - try this in chat.
/testCommand testArgument

this will call serverCmdTestCommand("testArgument");

with your code, you have this:
/vanishRHand Lugnut

This will do this: "Lugnut".player.hideNode("rhand");

wait a minute, "Lugnut" isn't a thing! There's a client object with a name of "Lugnut", but we're referencing the string with a value of "Lugnut"!

Here's how to fix it:

Code: [Select]
function serverCmdVanishRHand(%client, %input) {
if(!%client.isAdmin) { return; }
%object = findClientByName(%input);
if(!isObject(%object)) { %object = findClientByBL_ID(%input); }
if(!isObject(%object)) { messageClient(%client, '', "\c6The selected client could not be found."); }
%object..player.hidenode("rhand");
}

This code checks if the user is admin, checks for input as name and BL_ID, and targets players instead of the user.
example: /vanishRHand 16807

boom, my right hand vanishes

/vanishRHand Lugnut

boom, my right hand vanishes.


now learn about switch$ and you're good to go with a nifty mod.
« Last Edit: January 04, 2013, 06:45:41 PM by Lugnut »

okay, still missing camel case but no one gives a stuff about that anyway, it's cool.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaa
Lookout, it's the formatting police!

I'm absolutely sick of this attitude. Just because you don't like their identifier casing does not give you the right to command them to change it in the name of quality. There are many styles and respective users of those styles and no style is better outside of objectivity. Stop being egotistical and condescending. If you want to get anywhere in computer science, you have to learn to adapt to coding styles so please grow a pair of balls and stop prancing around telling people pedantically how to write code.

this was my thought process.

This mod was made for modders, that almost makes me obligated to chew it out.

I was going to pm the op an apology and a guide to make it better, but half of that is done already.

So without further ado, sorry for my being a richard and not helpful, op.
Now fix your mod.
thank you

The WORST person to ask. Sorry marble man, but you're missing some important concepts too. // apparently he has a better grip than me :(
:C My feels are brokened


?? commenting ??
If he actually attached what my pm to him was, what I said was almost "I used find and replace to fix it"

I was going to do
Code: [Select]
function servercmdvanish(%cl,%node)
{
   %cl.player.hidenode(%node);
}
However, some of his code made multiple nodes disappear, so I didn't want to change that

NOTE: I wrote most of this before realizing what the intentions of the OP was.
I apologize to him and marble man for calling them stupid. However, if their intention was to make a mod where people (admins?) can hide other people, then they are stupid.

However, they probably weren't. I'll leave this here anyway in case he wants to read it.

My intention was to fix this so it would work how he intended it to work (or how I thought it would work)
« Last Edit: January 04, 2013, 09:06:20 PM by MARBLE MAN »

I was thinking of another goal for the script, but judging by what's there, it works just fine.

When I wrote all that, it was assuming the other method.

Also, it appears you've gotten better since I've last seen your stuff.

The comments were written about the same time as the bolded text.
Lookout, it's the formatting police!

I'm absolutely sick of this attitude. Just because you don't like their identifier casing does not give you the right to command them to change it in the name of quality. There are many styles and respective users of those styles and no style is better outside of objectivity. Stop being egotistical and condescending. If you want to get anywhere in computer science, you have to learn to adapt to coding styles so please grow a pair of balls and stop prancing around telling people pedantically how to write code.
I'm not going to keel over dead because of ugly code, but if the developer writes beautiful code, I'm pretty sure they're gonna go a lot father than if it looks like stuff.

Also, the line of a's was because of the next part, not the formatting. I'm really not that picky.
« Last Edit: January 04, 2013, 10:03:46 PM by Lugnut »

Also, it appears you've gotten better since I've last seen your stuff.
... What "last stuff"?