• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by CrosRoad95

  1. you did mistake, 2020 - 2005 is equal 15 but not 16
  2. compiled script and another compiled
  3. i started to document functions here and pull request here i'm waiting for feedback about syntax
  4. for now project is frozen until first set of rendering functions will released
  5. For long time i considered to do something with physics in mta. For now doing even simplest things such falling box, tree on flat area looks cartoonish. In my history of i saw few attempts of doing simple physics, mostly it was in closed area without bigger interactions with poor performance due you just can't calculate collision in other way than processLineOfSight, isLineOfSightClear or read directly .col file as Tederis did. I started with something to render things, thats how FBX to bypass default rendering to handle future i'll introduce in future. That's how bullet physics project born, first idea how to use react physics, works simillar but is lighter and general smaller project but 0x416c69 suggested to use bullet. I'll use this topic also to prepare long list of features it contains for future copy paste to PR and wiki page The main assumption is to allow for create multiple world with completly independed simulations, get and set detailed information about current step of simulation, fully control how everything is simulated, quality of collision tests, speed and a lot more. i'm trying keep amount of functions low, because if that most stuff is packed into one function. Syntax and name of some function might change in future or along suggestions. Not all properties supports every physics element, some are only get, other set only, however most of them are set/get Current stage: I already implemented function such a: physics physicsCreateWorld() - responsible for creating new world for simulations, return element which will use later. physics-rigidbody physicsCreateRigidBody( shape-type, mixed arguments ) - creates rigid body which is use to simulation bahaviour of non-static shapes, collisions ( currently only few models in mta can do this in simple way ). physics-rigidbody physicsCreateRigidBodyFromModel( model ) - used to create rigid body directly from collision data taken from gta model. physics-static-collision physicsCreateStaticCollision( shape-type, mixed arguments ) - creates static collision which will not move at all ( it is still possible to move it by Lua script ) physics-shape physicsAddShape( shape-type, mixed arguments ) - if you create compound shape, this function let you add more shapes into static collision or rigid body bool physicsSetProperties( any physics element, physics-property, mixed arguments ) - main function to control physics, rigid bodies, static collisions, shapes. Works in simillar way as handling functions. mixed physicsGetProperties( any physics element, physics-property ) - same as above, but getting properties bool physicsDrawDebug( physics ) - use to visualization of world, must be used in render function bool physicsSetDebugMode( physics-debug-mode, enabled ) - use to turn off/on debugging features bool physicsBuildCollisionFromGTA( physics ) - used to create static collisions in specified world from original collisions, doesn't create whole world instantly, require to move player around world to load collision data. physics-constraint physicsCreateConstraint( physics, physics-rigid-body, physics-rigid-body, constraint-type, mixed arguments ) - use to connecting two or more rigid bodies into one entity bool physicsApplyForce( physics-rigid-body, vector from, vector to ) - pushing rigid body in particular point you choosed. bool physicsApplyCentralForce( physics-rigid-body, vector direction ) - apply force from central position of rigid, it's more like "accelereate", should be used more than once at the some period of time bool physicsApplyCentralImpulse( physics-rigid-body, vector direction ) - setting position from center of rigid bool physicsApplyDamping( physics-rigid-body, float force ) - i'm not sure, but it should slow down velocity and rotation of model by specified amount of units physicsApplyImpulse( physics-rigid-body, vector direction ) - i'm not sure how it works physicsApplyTorque( physics-rigid-body, vector rotation ) - same as physicsApplyCentralForce but for rotation physicsApplyTorqueImpulse( physics-rigid-body, vector rotation ) - setting rotation speed physics-properties: "mass", "position" ,"rotation", "sleepingthresholds", "restitution", "scale" "debugcolor", "filtermask", "filtergroup", "stiffness" `sleepingthresholds` means how slow rigid must move/rotate to sleep, it makes stops moving at all but still can be pushed by other rigids `restitution` bounciness, between 0-1 but accept any value above `stiffness` - for fixed constraint `filtermask` i still figuring out how it work, but should let you use 32 bit mask to set which rigid with which should collide Bullet documentation: page 13 contains useful information when which shape should be used physics-constraints: "pointtopoint", "hidge", "fixed", "slider" Physics-shapes: "box", "sphere", "capsule", "cone", "cylinder", "heightfieldterrain", "compound", "trianglemesh", "convexhull" `compound` is used for constructing rigid made of various shapes Plans for future: "heightfieldterrain" shape type accept black-white texture for faster creation Support for cloths, soft bodies Media: Videos are availiable at my youtube channel screenshots and gifs of current progress: Documentation i use: I'm waiting for your suggestions Topic not finished
  6. That mean s0beit will work?
  7. that been 5 years ago, do now it is possible ?
  8. I want to hook gta function into mta, but i dont know how can i skip function and continue function. here's my code but crashing game. can someone explain me how can i do this? void __cdecl CWorld::RemoveFallenPeds() offset 0x565CB0
  9. - place random object from category, example random tree, random rock, random bush etc. with option random rotation - move multiple objects at once - support for water, colzones, occolusion zones, custom models - save in various methods, as .map, .lua, .sql, compress file ( example: dont set interior=0 if by default interior = 0, dont set posX = 123.0000005 ) - simple permission system, example provilages to: edit, create, destroy, save, load, map settings - upgrade remove world object, now, some object are impossible to remove ( if you click but nothing you clicked, then script find nearest 10 world objects and show you in list ) - import map to current map which able to marge multiple maps into one, and export part of map into separated files ( example you can export all object which in colshape )
  10. CrosRoad95

    Lua 5.3?

    bitwise operators goto statement more metamethods new function table.move new function string.pack new function string.unpack new function string.packsize this is only few
  11. CrosRoad95

    Lua 5.3?

    Not change to lua 5.3, but trying copy stuff from lua 5.3
  12. CrosRoad95

    Lua 5.3?

    This topic was considered many times, mta team said that "this can break already existed scripts" but there can be option to change version of lua, by default: 5.1
  13. Hi, i'm writing becose i was developer of over a dozen servers and now i still develop yet another server. I know lua very well and i sometimes see walls which was placed by mta team, mostly for scripting: Enable disabled functions ( mainly: `require` ) Files and dirs, listing them, read/write binary, edit files from directories above resources Importing script from other resource ( something like c++ `include` ) Exporting classes, I can create server with 1 big resource but this make no sens Sandboxes like sub-resource, few functions which allow to make your own resource system. Extended modules api ( more events, example for editing resource while loading ( possible macros ) ), allow to load clientside modules ( example module with custom animations @saml1er ) if user agree. ( yes, user can be stupid and agree to install ransomware ¯\_(ツ)_/¯ ) This options could be enabled by secret setting in mtaserver.conf. Hosting providers can easly disable this like `maxslots` now. If someone install resources from others people ( or don't checking them ) them he has problem. This isn't argument to not doing this.
  14. Custom animations are in progress! Thanks Saml1er
  15. i mean protect my resources after sold in order to someone don't give that resource anyone else until meta.xml isn't compiled, i can crack EVERY resource on the internet i can modify meta.xml and add script which overwrite all security functions function addDebugHook()end function fetchRemote() return true end function checkResourceLicense() return true end
  16. i'm writing because in mta there is impossible to make safe shop with resources, to improve this, mta team should implements one of my example solution or come up with your own, better ones. Resource as `executable file` - should allow to pack every script with meta into 1 file `myResource.mtaexe` which is recognize as normal resource but you cant add your own code before/after resource start. You can't overwrite my functions, you can't change meta.xml. If you want to use files. Also tag <file> should receive attribute `checksum` to verify external files. This executable file could be simple obfuscated .zip file. function `restoreOriginalFunction( functionName )` - this function resource original function, but if you have N lua script, then for each script this function will be overwritten, currently example function `outputChatBox` is registered once per resource and other script can overwrite them in other file. This function allow to protect other functions before overwriting For both should be added function to disable addDebugHook for this resource.
  18. this should be as standalone function, isPointInPolygon(x,y,x1,y1,x2,y2,x3,y3,...) -- return true or false
  19. in mtaserver.conf or in meta.xml i doesn't metter,
  20. server can have optional config like <lua_version>5.1</lua_version> by default 5.1 Back compatibility confirmed
  22. why .obj and .mtl? becose it are text files. i can do function which move selected vertex to other position 348957349857398573x easier than dff & col function like convertOBJtoCOL(input,output) and convertOBJtoDFF(input,output) and convertMTLtoTXD(input,output) allow to make blender/3ds max/z moddeler in mta <3