Separate names with a comma.
Comments in 'Plugin Development' started by MCPEPIG, Apr 1, 2016.
What's the best way to suck entities into a certain position (Like a tornado).
That isn't that hard like it sounds.
You just have to calculate from each player position the right setMotion
$px $py $pz (player)
$tx $ty $tz (target)
$tx-$px (if positive) then you have your movement you'll need to apply
May you tell us what $target is? Vector3 maybe?
And i personally hate all these easy to use php functions, i have big projects in C and i have to handle so much on such low level, it's annyoing, what I am trying to point out, you have to learn real programming not writing english.
Why would you hate convenient functions? Technology is developed to make things easier, not to make things harder and harder and f*** people's brains. You are trying to make things complicated so as to make yourself sound "professional" and prevent other people from getting the knowledge you have, or be scared of it and then you become the only one in the world who knows programming?
Or, if you hate easy-to-use PHP functions so much, just don't use them; use the most fundamental functions only and write every function you use yourself.
Real programming is about thinking, adapting and considering, not about implementing the same thing one billion times because one billion users are using it and everyone has to write the algorithm themselves.
The velocity can also be negative, then the player just moves back?
May I ask for the usage of normalize() in this function?
In our case, the output of subtract() is a net (position-less) vector representing the line from player to target. Vector3::normalize() will shrink it such that its length shrinks to 1, creating a base vector that is purely directional. Then I multiply the base vector by the speed, so the new vector points to the same direction but with the length as the speed you want.
I just wanted to say that if you're good in php, you will be suprised that you need 1000 lines in C for a 200 lines php programm. And i personally like php, and if i sit on my C project, i sometimes rage out and say I WANT FOREACH HERE. Actually i like these php functions. But it may be getting slow. If you realy want a fast programm you need to code a little bit more low-level. Languages like brainfuck, of course make no sense, but they may be even faster then assembly.
Just noticed I got way too much offtopic, sorry
Did you see that (if positive)???
That was a rough draft, of course you need to do sth else with negative coordinates
Library functions != slow language
You may need to implement those functions in C++ yourself (I prefer to say C++ even though it is C, simply because C is one letter only and easily gets ambiguous). But if it was originally implemented in the standard library, it would not make things faster.
You are comparing at different criteria. The PHP language itself is slow because it is a parsed language without compiling to native code or running on a virtual machine . And the PHP language provides a wide range of builtin functions, but this has no relationship with what you said about the language itself being slow. Look at Java. It is almost as fast as C++ nowadays, but it still has a good broad library that does many things.
Back to your original point, you were saying that PHP is not real programming because you just have to write English, which is very wrong. It just provides a lot of builtin functions such that you don't even need to think in most cases, making it such that some people go to interview but not even know how to get the average of numbers in an array .
 http://sijinjoseph.com/programmer-competency-matrix/ "Unable to find the average of numbers in an array (It’s hard to believe but I’ve interviewed such candidates)"