-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More math functions for mta #654
Comments
Would library inclusion solve this problem for you? |
This is basically a request to not have to type exports.resourceName: so what if there was an MTA function like addExportAsFunction(function) which would be called inside the script that creates the export, then each resource would have that function added as a function that can be called without need for exports.resourceName or even addFunctionAsGlobalFunction(function) that would clone any function (doesn't need to be exported) into each resource's function register (that _gc thing?) |
@ArranTuna no, already exists i also want |
What I mean is servers can add those functions (plus we could have a default resource with all the useful functions included) and all you have to do is start that resource, then it will make all the useful functions accessible in any resource. |
now, we need wait for someone who say |
Quickest, easiest and most lightweight solution ( for the solution being discussed here is a new function Then someone can just write code to automate those exports being introduced into the global scope with an exports wrapper. @CrosRoad95, you mentioned that library inclusion with |
getDistanceBetweenPoints2D ^ look at length of both, why mta implementing formula that is 20% longer then function name???? |
I think exports are too slow for such a function (as they serialize and deserialize input and output data). Library inclusion in form of |
you should check lua-package branch |
I would really prefer enabling the regular |
Well, let's say that require gets enabled: a server owner could now access your system with os., io. which means that require should be filtered - and even when filtered properly - it wont prevent scripters from using them (renaming etc) which might be a security flaw Maybe there should be a library folder (1 mta resource / server path) containing all libraries which can be imported in meta.xml using OR we simply add another feature called
|
just add a little + feature to <script> tag, namely the to be able to set 'src' to a script from another resource. |
Is your feature request related to a problem? Please describe.
Low amount of math function that are used often
Describe the solution you'd like
Add more math functions
Describe alternatives you've considered
Copy and paste one piece of code to every resource
Additional context
few math functions that could be added, all of them you can find on wiki and in google getDistanceBetweenPointAndSegment2D getDistanceBetweenPointAndSegment3D, findRotation2D, findRotation3D, getPointFromDistanceRotation, getOffsetFromXYZ
except that, should be added function for bazier curve and splines in 2d and 3d
The text was updated successfully, but these errors were encountered: