16
Modification Help / Re: Mounting a image to a player with serverCmd
« on: December 10, 2012, 12:32:08 AM »Nope.I've been quoted out of context! That's not at all what I said.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Nope.I've been quoted out of context! That's not at all what I said.
That shouldn't change anything.This. If anything, that'd break it. That's really weird, but if it works, fantastic.
I did that literally 8 posts above yours and he still insists that his way is "equally valid".I never said equally valid, that is false. getType() is better. getClassName() however is also valid, just slower. It appears you are not any better with reading than others.
Do you even know how to read?It is faster to use isObject and getType in conjunction however it will not cover the scenario where there is a player object without a client attached to it.
Holy stuff I can't help but correct this because you're still completely ignorant.
Trigun himself said that it's faster to use isObject and getType in conjunction to eliminate AIPlayer/Player when pulling the TypeMask PlayerObjectType. That's what I was laughing at in that quote, because he had JUST SAID IT and you STILL GOT IT WRONG. Unless you're checking for an object that has no type (GameConnection for instance), it is never faster to use getClassName.
That means you're still wrong and that this method is still invalid.Do you know what invalid means? It is not invalid. The only scenario where it makes a perceivable difference in speed is where you spam check thousands of times in a row, which should never be done in a mod regardless. The difference is exceptionally negligible, it is not invalid. The code you posted past this relates to the comment above, it will not cover the scenario where there is a player object without a client.
If you have any further questions about why what you're doing is wrong, please PM me. This is seriously problematic when I have you spreading false information to new scripters. I really want this confusion to be settled, and you obviously need more 1-on-1 coding help.I'm not spreading ANY false information.
Trigun: getType() and isObject(%obj.client) would be a faster check than even one getClassName, yet alone 2I don't think you understood what I said. Do you need a code example?
Jailbot - RIP HPRC: so in the scenario that you were trying to get both AIPlayers and Players, it would be faster to use getType
Jailbot - RIP HPRC: if you were checking for only actual players
Jailbot - RIP HPRC: it would be faster to use getClassName
lmfao I cannot even believe how intentionally ignorant you are
function isItAPlayer(%obj)
{
if(%obj.getClassname() $= "Player")
return 1;
return 0;
}
function isItAPlayerWithGetType(%obj)
{
if(%obj.getType() & $TypeMasks::PlayerObjectType && %obj.getClassname() $= "Player")
return 1;
return 0;
}
"You know someone is losing an argument when they start talking like a James Bond villain."What? That's how I always talk.
I'm done here. Go create a drama about me so even the TorqueScript Illiterate can laugh at how daft you are.Why would I drama you? Because you decided to classify a method that is slower as invalid and wrong? getType() is definitely loving better, but getClassname() is not wrong.
Sorry OP that this kid decided to cigarette up your topic.
So basically you're defending a method that is inarticulate and slow, just because it technically runs?I'm saying it's not invalid. Not to mention, yours only works if they are trying to net both AIPlayers and Players.
Trigun: well he's right in that you shouldn't ever use getClassName to check the object's type because a better method exists, hence getTYPE
Jailbot - RIP HPRC: it's not a better method
Jailbot - RIP HPRC: getType() will trigger for both players and aiplayers
Jailbot - RIP HPRC: as players
Jailbot - RIP HPRC: getClassname won't
Trigun: getType() and isObject(%obj.client) would be a faster check than even one getClassName, yet alone 2
Jailbot - RIP HPRC: that's not even the correct way to check if it's a player
Jailbot - RIP HPRC: what if it's a player that doesn't have a client
Jailbot - RIP HPRC: new player() { datablock=playerstandardarmor; }
Jailbot - RIP HPRC: ;
Jailbot - RIP HPRC: and it isn't two getClassNames
Jailbot - RIP HPRC: it is one
Trigun: if you want to have two operations for AIPlayer and Player, it is two
Jailbot - RIP HPRC: so in the scenario that you were trying to get both AIPlayers and Players, it would be faster to use getType
Jailbot - RIP HPRC: if you were checking for only actual players
Jailbot - RIP HPRC: it would be faster to use getClassName
Please stop posting in Coding Help; you are a moron.I'm significantly more intelligent than you are; calling me a moron degrades you to the likes of a mongoloid.
It's not "just as valid", you dolt. My way is better.Your way is better but the other way isn't invalid. You didn't say, "Yes, he is checking class name. That is slower, which is why I corrected him." You said it was "bad," which it really isn't.
I don't know what sort of high you get off challenging what I've said, but you're wrong. You've completely lost this. Your way is almost three times slower than mine, and the more class names you add to that if statement the slower it goes.My way is none of the above. I didn't declare that getClassname() was faster, I didn't even take a side. I just said that getClassname() was valid. Speed was not even a factor in our prior argument. So, yeah, you're right, getType() is faster, but getClassname() is not under any circumstance invalid. I am not wrong.
holy stuff kid shut upBest argument 2012. Just in time, too. I'm not going to stand here while you fling unintelligent stuff at people and discredit completely valid methods of checking. %obj.getType() & $TypeMasks::PlayerObjectType is JUST as valid as %obj.getClassname() $= "Player".
Yes, he is checking class name. That is bad, which is why I corrected him.How exactly is this "bad"?
I was not addressing OP's problem. If you had read the posts above mine there would be no confusion.I did read the posts above yours, why would I read the bottom of the page first and comment about something I have no sense of context for? For someone named "Frontier Psychiatrist," you seem to have a very poor understanding of how the human brain works. As I stated before,
the string comparison there is not the issue, hence why I assumed you were talking about the OP.
Checking class name to see if it's the correct type of object is like checking race to see if something is a human being. Although no human is a "Cadillac" and no car is a "Caucasian", it's a pointless middleman. You just want to get the type of the object.What? That brown townogy made no sense whatsoever. If you needed to check if something was a player and you called ::getClassName() on it it would return "Player" if it was a player and something else if it was something else. This method of checking is 100% valid. I suspect you have absolutely no idea what you are talking about.
You're wrong and you're justifying your wrongness very poorly.What would I even be wrong about? That you were referring to the OP? I crossed out my post, what more of an "oops" do you need?
I'm obviously referring to the posts directly above my own.That person isn't checking their type, he's checking their classname. While it wouldn't work because there are WheeledVehicles and FlyingVehicles, the string comparison there is not the issue, hence why I assumed you were talking about the OP.
I've quoted the person I'm replying to this time so you don't think I'm talking to OP again.
Don't use string comparison with class names, especially not in functions used all the time and especially not in scheduled tick functions.
I don't know what the forget this isNow this song
Sounds waay too much like Spectrum by Zedd lol.
Yeah its just I can't make it sound right :cTry turning up the attack so it comes in smoother, if it's too crisp it'll sound weird and off beat.