Attach3DTextLabelToObject by Kaliber -
pabloalber84 - 01.11.2015
In another post check this out:
Quote:
Originally Posted by Luis-
Here we are with the new topic, seeing as Garsino has left SA:MP.
FUNCTIONS
pawn Код:
native Attach3DTextLabelToObject(Text3D:id, objectid, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
......
|
And I search, and found one post in forum germany, and I decided to bring their respective credits.
Attach3DTextLabelToObject
pawn Код:
native Attach3DTextLabelToObject(Text3D:id, objectid, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
native Detach3DTextLabel(Text3D:id);
native AttachPlayer3DTextLabelToObject(playerid, PlayerText3D:id, objectid, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
native DetachPlayer3DTextLabel(PlayerText3D:id);
if you created more than 1,000 Attach3DTextLabelToObject, all labels will be updated by ~9ms!
Include:
Download:
Link pastebin
Link mediafire
Credits:
pawn Код:
/* SA-MP Include Attach3DTextLabelToObject
*
* © by Kaliber, 2015
*
*/
Re: Attach3DTextLabelToObject by Kaliber -
Lacrim - 01.11.2015
Nice, good job!
Re: Attach3DTextLabelToObject by Kaliber -
Pottus - 01.11.2015
Talk about obfuscated code.
Respuesta: Re: Attach3DTextLabelToObject by Kaliber -
pabloalber84 - 01.11.2015
Quote:
Originally Posted by Lacrim
Nice, good job!
|
Include is of Kaliber, from one germany forum, I just came to the post, he did a good job, but there was no include those here.
Quote:
Originally Posted by Pottus
Talk about obfuscated code.
|
The code is more advanced, not for new users, but it works correctly and already only to use.
Re: Respuesta: Re: Attach3DTextLabelToObject by Kaliber -
Pottus - 01.11.2015
Quote:
Originally Posted by pabloalber84
The code is more advanced, not for new users, but it works correctly and already only to use.
|
I didn't say it wouldn't work correctly but it is nice to actually be able to read code anyone looking at this is going to have a hard time trying to figure it out. Advanced user or not you should be able to read code easily the whole design of this system is excessive in terms of obfuscation and convolution.
Respuesta: Re: Respuesta: Re: Attach3DTextLabelToObject by Kaliber -
pabloalber84 - 01.11.2015
Quote:
Originally Posted by Pottus
I didn't say it wouldn't work correctly but it is nice to actually be able to read code anyone looking at this is going to have a hard time trying to figure it out. Advanced user or not you should be able to read code easily the whole design of this system is excessive in terms of obfuscation and convolution.
|
From a professional point of view has a code that confuses anyone, and you can understand seeing the possible outcomes of each function shown there, to reach the conclusion that code is a simple but well scripted.
Re: Respuesta: Re: Respuesta: Re: Attach3DTextLabelToObject by Kaliber -
Pottus - 01.11.2015
Quote:
Originally Posted by pabloalber84
From a professional point of view has a code that confuses anyone, and you can understand seeing the possible outcomes of each function shown there, to reach the conclusion that code is a simple but well scripted.
|
What the hell is that supposed to mean? Your explanation is completely incoherent and makes absolutely no sense.
Re: Respuesta: Re: Respuesta: Re: Attach3DTextLabelToObject by Kaliber -
ThePhenix - 01.11.2015
Quote:
Originally Posted by pabloalber84
From a professional point of view has a code that confuses anyone, and you can understand seeing the possible outcomes of each function shown there, to reach the conclusion that code is a simple but well scripted.
|
Not only because a code "apparently" works fine you can reach the conclusion that it's well scripted.
Re: Attach3DTextLabelToObject by Kaliber -
SkittlesAreFalling - 01.11.2015
I can read his code just fine... Want me to re-code it simpler for you Pottus?
Re: Attach3DTextLabelToObject by Kaliber -
Pottus - 01.11.2015
Quote:
Originally Posted by SkittlesAreFalling
I can read his code just fine... Want me to re-code it simpler for you Pottus?
|
The argument isn't complexity the argument is that the code is obfuscated and convoluted, obfuscation and convolution does not equate to complexity rather silliness and difficult to read code. Could you picture an entire gamemode coded in this manner? That would be absolutely ridiculous so why bother coding like a donkey to begin with?
Re: Attach3DTextLabelToObject by Kaliber -
SkittlesAreFalling - 01.11.2015
Quote:
Originally Posted by Pottus
The argument isn't complexity the argument is that the code is obfuscated and convoluted, obfuscation and convolution does not equate to complexity rather silliness and difficult to read code. Could you picture an entire gamemode coded in this manner? That would be absolutely ridiculous so why bother coding like a donkey to begin with?
|
You need glasses, is my point.
Re: Attach3DTextLabelToObject by Kaliber -
Pottus - 01.11.2015
Quote:
Originally Posted by SkittlesAreFalling
You need glasses, is my point.
|
Even if I did whatever point you are trying to make is moot as you have failed to even reiterate any level counter point beyond an adolescent remark from my last statement.
Re: Attach3DTextLabelToObject by Kaliber -
SkittlesAreFalling - 01.11.2015
Quote:
Originally Posted by Pottus
Even if I did whatever point you are trying to make is moot as you have failed to even reiterate any level counter point beyond an adolescent remark from my last statement.
|
Do I really need to? You clearly don't know what obfuscation is (coding wise).
Re: Attach3DTextLabelToObject by Kaliber -
IllidanS4 - 01.11.2015
It is either obfuscated or written without any consideration for user-friendliness. Anyway, does it move the label when the object moves (smoothly)?
Re: Attach3DTextLabelToObject by Kaliber -
Crayder - 01.11.2015
Lol.
This code is nailed to the ceiling but still touches the floor. It's a mess. I feel like this guy literally made it look stupid on purpose. There is no point in doing it like that.
Re: Attach3DTextLabelToObject by Kaliber -
ThePhenix - 02.11.2015
The code literally makes my eyes hurt.
Re: Attach3DTextLabelToObject by Kaliber -
SkittlesAreFalling - 02.11.2015
Guess it takes people more time than others to understand.
Re: Attach3DTextLabelToObject by Kaliber -
ThePhenix - 02.11.2015
The problem relies on the fact that everything is so fastened and tight that it's quite hard for your eyes not to get lost when looking at that code.
Re: Attach3DTextLabelToObject by Kaliber -
SimonItaly - 02.11.2015
pawn Код:
new Float:tmp[3],i;
for(;; i++)
if(i==MAX_3DTEXT_GLOBAL) break;
I won't discuss the functionality of this include, but I don't think that this will make your code wiser, just more unreadable.
Edit: you're also looping through MAX_3DTEXT_GLOBAL = 1024 labels every 199 milliseconds, that's a bit heavy for me. Consider using foreach.
There's also a double check for INVALID_3DTEXT_ID in Detach3DTextLabel.
Re: Attach3DTextLabelToObject by Kaliber -
Crayder - 02.11.2015
Quote:
Originally Posted by SkittlesAreFalling
Guess it takes people more time than others to understand.
|
Nobody ever said we didn't know what any of the code does. It's just a very useless scripting style (hell can we even call it a 'style' at all?).