Jump to content
Sign in to follow this  
Double Doppler

Worth learning to script?

Recommended Posts

Im learning C++ at the moment, and I just thought is it worth learning to script in GTA IV? I mean, can it give experience using the programming language and a good window to try out syntax with the GTA IV engine as a base? I thought it might be a good idea to improve on skills and such, and do something useful while at it. After learning the syntax, and possibly some windows APIs, is it worth learning it the time and effort for experience?

Can the C++ language be used to write scripts in GTA IV? Also, what namespaces does it operate in, and is there an API with a list of in-built functions and variables used by the game? Is there a GTA IV scripting command/object reference?

I dont know much about scripting for GTA IV, but scripting/programming in general is nothing new for me. I am already a scripter for Arma 2 so I know what it is like to code in a game engine (but not through an external API).

Share this post


Link to post
Share on other sites

I didn't understand any of that lol XD but there isnt much point unless your doing it for practice because by the time you learn GTA V will be near released and a lot of people will leave GTA IV (im probably completely wrong but oh well!) :)

Share this post


Link to post
Share on other sites

Learning new things is always helpful, but the LCPD:FR mod and many others are actually done in C# and use the Microsoft .NET Framework. It more or less revolves around injecting code into active memory more than reverse engineering the game itself, from what I understand. C# and C++ are closely related (hence the names), and although C# is a simpler language, it's still somewhat powerful. C++ is the one to learn though, if you're trying to write a large, complex program like the next Adobe product or a large scale video game. You could convert everything in C# done to C++, but if you ever work with other developers such as the G17 staff to script things for GTA IV, it's going to be a lot harder trying to work together with you writing in one language, and them writing in another. I hate to say "learn what everyone else is using", but that's the easiest way to collaborate.

Share this post


Link to post
Share on other sites

C# and C++ have similar syntax, but they are extremely different languages. C++ is much lower-level, and generally does not run in a managed environment. C# is Microsoft's version of Java, basically. C++ is based off C, which is high-level assembly.

From what I've heard, C++ scripting for GTA is a pain. .NET scripting is much nicer. LCPDFR has some C++ functions (that's what AdvancedHook is), but is mostly .NET. If you are wondering about C++, ask LMS.

Share this post


Link to post
Share on other sites

Syntax is really what made or broke learning programming languages for me. C#, C++ and Java were really relate-able languages despite the fact that they were for different purposes, which is what you seemed to be saying above. When you learn one, it makes understanding the next one a bit easier. As said before, if you're looking to program a professional application that you're going to mass market, C++ is by far the more powerful and more important language out of the three. I think C# and .NET makes a lot of sense for scripting, however if you're trying to do what G17 is doing with LCPD:FR.

I guess the basic question is;

What are your intentions with this, Double Doppler?

Edited by unr3al

Share this post


Link to post
Share on other sites

If .Net: The SHDN download has a good starting point for developers. [Link]

If C++: The C++SH has a SDK to help get started, not that useful if new to C++. [Link]

Share this post


Link to post
Share on other sites

Syntax is really what made or broke learning programming languages for me. C#, C++ and Java were really relate-able languages despite the fact that they were for different purposes, which is what you seemed to be saying above. When you learn one, it makes understanding the next one a bit easier. As said before, if you're looking to program a professional application that you're going to mass market, C++ is by far the more powerful and more important language out of the three. I think C# and .NET makes a lot of sense for scripting, however if you're trying to do what G17 is doing with LCPD:FR.

I guess the basic question is;

What are your intentions with this, Double Doppler?

I was thinking about learning to use programming in GTA IV to write scripts, so that I could gain experience using the C++ syntax and do something productive at the same time, such as write some handy supplementary mods for LCPDFR like some of the other good authors around here. But seeing as GTA IV's spotlight-life seems to be coming to an end, Im starting to think it might not be worth the time learning it. Its the same story with Arma at the moment, Arma 2 is going out of date soon, and Arma 3 is on the way, but there is still no fixed release date.

If .Net: The SHDN download has a good starting point for developers. [Link]

If C++: The C++SH has a SDK to help get started, not that useful if new to C++. [Link]

Thanks. I took a look at those links. So it seems to be that there is no native programming language for GTA IV, but user/community made APIs? And so there are two paths one can take, for programming, the C++ script hook for using the C++ syntax, and the .NET one for people who are more accustomed for using .NET? Is .NET a separate language, or is it a name for a specific programming interface?

Share this post


Link to post
Share on other sites

It's sort of using community-made APIs. You can hook in to native functions, but, at least with .NET, much/most of what you do uses community-made wrappers on top of those.

.NET is a Microsoft program framework. It's essentially Microsoft's version of the Java environment (standard library, JVM, everything but the language itself). C# and Visual Basic are languages that run on .NET. I believe C++ can also use .NET, but it is much less common. The biggest difference between running on .NET and not is that .NET is a managed environment (which means that it handles things such as memory for you).

In terms of GTA scripting, I know that SHDN gives a lot of nice features. For one thing, a crash in a .NET script doesn't crash the whole game. You can also reload the script while the game is running, meaning that you can, without restarting GTA, tweak the code, compile it, and test the changes.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×