Moderators IIYAMA Posted November 10, 2013 Moderators Share Posted November 10, 2013 I have heard some things about the OOP system, about that it is faster etc. But is this all ready possible and able to use? If "yes" were can I find how to use it? Because I have never seen an OOP system. Thank you Link to comment
tosfera Posted November 10, 2013 Share Posted November 10, 2013 As far as I know, LUA doesn't have a way to be used in an OOP. Wish they made it, gawd that would be awesome. But it's not up to the MTA team to do so, it's up to the creators of LUA. Excuse me, LUA does have the ability to be used in an OOP-application. ._.' It is just... different haha http://lua-users.org/wiki/ObjectOrientationTutorial Link to comment
Moderators IIYAMA Posted November 10, 2013 Author Moderators Share Posted November 10, 2013 Meta tables, hmm I have never tried to use them because they never had any extra use for me. I always did things like this: local myTable Information = Table1[variable] or Table2[vaiable] So it is possible to set a meta table from client to serverside? Bedankt! Link to comment
tosfera Posted November 10, 2013 Share Posted November 10, 2013 hahaha that randomly dutch word there. Ehh I'm not sure. I have never used the OOP shizzle for MTA. It's worth a try I guess? Let me know how it turned out ( if you're going to try, I'll try it too in a sec ) Link to comment
Moderators IIYAMA Posted November 10, 2013 Author Moderators Share Posted November 10, 2013 To be honest I have no idea how to connect those tables. When you send them over with triggerClientEvent, only a copie remains of the table from serverside. Also when you set the lua file as client and serverside, you also will have a copie. But I will try to find this secret. Ik weet niet hoever dit mogelijk is. Link to comment
tosfera Posted November 10, 2013 Share Posted November 10, 2013 as far as I came, I couldn't recall the class in the other side ( created it in client-side, server side couldn't recall it ). Link to comment
Moderators IIYAMA Posted November 10, 2013 Author Moderators Share Posted November 10, 2013 yes, I had same result. Link to comment
Castillo Posted November 10, 2013 Share Posted November 10, 2013 As far as I know, MTA will have OOP in a future version, example ( I think ): local vehicle = createVehicle ( ) vehicle:position ( 0, 0, 0 ) vehicle:health ( 500 ) Link to comment
tosfera Posted November 10, 2013 Share Posted November 10, 2013 As far as I know, MTA will have OOP in a future version, example ( I think ): local vehicle = createVehicle ( ) vehicle:position ( 0, 0, 0 ) vehicle:health ( 500 ) is that already built in, or will that be update. If so, Can't wait to rewrite everything! Link to comment
Castillo Posted November 10, 2013 Share Posted November 10, 2013 It'll be in a future release if I'm right. Link to comment
TAPL Posted November 10, 2013 Share Posted November 10, 2013 From the wiki meta: https://wiki.multitheftauto.com/wiki/Meta.xml FROM VERSION 1.4.0 r5313 ONWARDS todo. false: todo. true: todo. Link to comment
Jesseunit Posted November 10, 2013 Share Posted November 10, 2013 https://wiki.multitheftauto.com/wiki/Cl ... ng_Classes https://wiki.multitheftauto.com/wiki/Cr ... ss_Example Link to comment
ixjf Posted November 10, 2013 Share Posted November 10, 2013 As far as I know, MTA will have OOP in a future version, example ( I think ): local vehicle = createVehicle ( ) vehicle:position ( 0, 0, 0 ) vehicle:health ( 500 ) MTA 1.4 will have an OOP alternative which can be enabled in the metadata file, yes. I'm working on the official OOP documentation but haven't finished it yet. local vehicle = Vehicle.create(411, 0, 0, 0) vehicle:setPosition(Vector3(0, 20, 0)) vehicle:setHealth(500) -- or local vehicle = Vehicle.create(411, 0, 0, 0) vehicle.position = Vector3(0, 20, 0) vehicle.health = 500 The 1st link mentioned by Jesseunit is the documentation of all classes and their members, which might be outdated now. I'll update it soon and start working on examples. EDIT: It looks like qaisjp had to mess up with it so I need to fix this later. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now