Jump to content

C++ as the universal language


Deepu

Recommended Posts

I know that this seems vague.. but.. C++ is actually good when it comes to game scripting and game programming whether its scripting MTA or whether you're working with OpenGL rendering or with Ogre3D.. C++ is the best. C++ has unique set of class wise instruction set which is useful when you're like trying to link the objects of the class to a real world object.. As an Example:

 class guy{   int skin_id;   char*nick; // character pointer to use it as a string.. just for instance.   public:   void getSkin(void);}; guy child; // created object. child.getSkin(); // see? its useful to code it for MTA.. 

why am I suggesting it to make it a universal language of MTA for the next update?? I am tired of using modules... They are showing a whole bunch of errors in Code::blocks.. it says missing header files.. when I did include them and many more silly stuffs.. So please do add this like lua in the next release.. its really fun coding in C++ please :(

Link to comment

I know that this seems vague.. but.. C++ is actually good when it comes to game scripting and game programming whether its scripting MTA or whether you're working with OpenGL rendering or with Ogre3D.. C++ is the best. C++ has unique set of class wise instruction set which is useful when you're like trying to link the objects of the class to a real world object.. As an Example:

  
class guy{ 
   int skin_id; 
   char*nick; // character pointer to use it as a string.. just for instance. 
   public: 
   void getSkin(void); 
}; 
  
guy child; // created object. 
  
child.getSkin(); // see? its useful to code it for MTA.. 
  

why am I suggesting it to make it a universal language of MTA for the next update?? I am tired of using modules... They are showing a whole bunch of errors in Code::blocks.. it says missing header files.. when I did include them and many more silly stuffs.. So please do add this like lua in the next release.. its really fun coding in C++ please :(

Link to comment

What? C++ is also one of the most complicated language, as far as I know.

Lua is quite simple and we just can't put C++ like this.

It will be horrifying for scripters, they will have to learn alot of things again and that also in more complicated way.

Let Lua be there.

Link to comment

What? C++ is also one of the most complicated language, as far as I know.

Lua is quite simple and we just can't put C++ like this.

It will be horrifying for scripters, they will have to learn alot of things again and that also in more complicated way.

Let Lua be there.

Link to comment

Something like that will never happen.

C++ is a programming language that compiles into native code and is not appropriate for embedding it as a scripting language. Via native code you would be able to do everything you want - including installing and distributing malware.

There are of course possibilities to sandbox it, but writing such a secure environment (which is most likely still exploitable, see Chrome sandbox) requires much more effort than embedding a C++-like scripting language or even writing a new scripting language that looks similar to C++.

Finally, it doesn't make sense at all as C++ is too complicated for small scripting tasks. So each language has its own purpose.

And btw: You can do OOP in Lua as well (via sbx320' classlib for example: https://github.com/sbx320/lua_utils)

Link to comment

Something like that will never happen.

C++ is a programming language that compiles into native code and is not appropriate for embedding it as a scripting language. Via native code you would be able to do everything you want - including installing and distributing malware.

There are of course possibilities to sandbox it, but writing such a secure environment (which is most likely still exploitable, see Chrome sandbox) requires much more effort than embedding a C++-like scripting language or even writing a new scripting language that looks similar to C++.

Finally, it doesn't make sense at all as C++ is too complicated for small scripting tasks. So each language has its own purpose.

And btw: You can do OOP in Lua as well (via sbx320' classlib for example: https://github.com/sbx320/lua_utils)

Link to comment
  • 3 weeks later...
How about C# ?

Like literally hard working servers will be destroyed. They have to create everything again.

Why would adding a programming language to mta cause servers to be destroyed?

Read the title well.

They mean to remove Lua and add C++ or C#

Link to comment
  • 2 weeks later...

C# is great oop language. There could be an option to choose between Lua and C# so ppl won't need to remake his scripts. Lua is bad if we are talking about oop. Many programmers prefer OOP over procedural cause it's better and cleaner.

Link to comment
  • 2 weeks later...

@Anubhav I didn't say that Lua has to be stopped. I said that Lua is not flexible for OOP else people would have made minecraft with lua.. right? C++ is flexible because it has its own class support and object oriented systems development resources.

If yu know crystalMV then.. even he likes using C or C++ because its more easier and more simpler to learn and to program. so we all can do it with C++.

Link to comment
@Anubhav I didn't say that Lua has to be stopped. I said that Lua is not flexible for OOP else people would have made minecraft with lua.. right? C++ is flexible because it has its own class support and object oriented systems development resources.

If yu know crystalMV then.. even he likes using C or C++ because its more easier and more simpler to learn and to program. so we all can do it with C++.

It's not simple to learn. It is very high-level language, and is very complicated language for me. It's your opinion. My opinion is it to be not added, it gives MTA team extra work which is not needed. They will need to disable alot of libraries to prevent abuse of C++, which will cause million years of work.

Link to comment

To your knowledge.. @Anubhav, C++ has public, private and protected visibility modes. Ensuring safety among privacy. MTA was written in C++. GTA was written in C++/DirectX. GTA V was written in C++/OpenGL. So.. if MTA makes C++ coordination dll. then we can start MTA 5 or MTA 4 or something like that for GTA 4 and GTA V.

Link to comment
  • Discord Moderators
To your knowledge.. @Anubhav, C++ has public, private and protected visibility modes. Ensuring safety among privacy. MTA was written in C++. GTA was written in C++/DirectX. GTA V was written in C++/OpenGL. So.. if MTA makes C++ coordination dll. then we can start MTA 5 or MTA 4 or something like that for GTA 4 and GTA V.

I'm not a pro C++ developer, but clearly you got some things wrong there.

DirectX is nothing more than Microsoft Windows' 3D graphics library, so it is not a language by itself, to start with. GTA V, on the other hand, uses DirectX, not OpenGL (have you ever seen the DirectX version option that GTA V has in its graphics settings?). And I have never heard the words "coordination dll". GTA: SA, GTA IV and GTA V are very different games, and making a mod like MTA: SA work with any of them is a very difficult task, because although MTA tries to build its own engine on top of GTA: SA, it still depends on assembly hooks and memory manipulation of the game itself. And, as you can probably conclude, GTA: SA executable and memory has (almost) nothing in common with GTA IV or GTA V ones.

Back to the topic, I think that Lua is fine to use as a MTA: SA scripting language. Sure, it is not the fastest and most known thing out there, but it is designed with embedding in mind, it has a good learning curve, it is well documented, it is powerful and, most importantly, safe. C++, on the other hand, is lower-level, and things like memory manipulation are difficult to sandbox without reducing functionality. So, in the end, C++ doesn't simply cut it.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...