Modding - Is This What I Need to Learn First?

Everything about mods can be found here.

Moderator: Morax

Modding - Is This What I Need to Learn First?

Postby Crazy Cossack » 09 Jun 2014, 08:24

After annoying a few people with silly questions. I have realised how much I need to learn before even attempting a mod. Here's my best guess, correct me if necessary.

1. I need to learn Lua. Fortunately, my son (3rd year electrical and software engineering) can program Python among other languages. He took one look at Lua and understood 99% of it straight away. Now, I just have to bribe him to teach me and help me. I used to program Borland Turbo Pascal many years ago so I understand basic programming concepts. But I am as rusty as hell and I haven't used object oriented langauages or modern script languages like Lua.

2. I need to learn where all the relevant files and scripts are in the GPG directory. Is there a guide or a tool or both for finding the relevant files, scripts and data as needed?

3. I need to understand the best development and testing environment for my mod, not to mention file housekeeping and backups. Any hints or guides to this kind of thing?

4. I need to fully understand what hooking is (destructive and non-destructive is that right?). Any good descriptions of this?

5. Which version should I actually mod? The last GPG version or should I mod FAF SC? I can see advantages to modding FAF SC. If Zep has fixed many bugs (and I am sure he has) that were in last GPG version then I guess I want to mod FAF's more de-bugged version. Am i right or not about this?

I will appreciate any helpful comments and then I will go away and study how to do this. No more silly questions until I have learnt something.
Crazy Cossack
Avatar-of-War
 
Posts: 53
Joined: 13 Mar 2013, 12:44
Has liked: 0 time
Been liked: 9 times
FAF User Name: Crazy_Cossack

Re: Modding - Is This What I Need to Learn First?

Postby IceDreamer » 09 Jun 2014, 13:30

IceDreamer
Supreme Commander
 
Posts: 2607
Joined: 27 Dec 2011, 07:01
Has liked: 138 times
Been liked: 488 times

Re: Modding - Is This What I Need to Learn First?

Postby Crazy Cossack » 11 Jun 2014, 05:54

Thanks Ice for message. I have that document and it is very useful. However I have more questions.

1. Which version do I mod? Do I mod the FAF version? Maybe not the last GPG version as that will lack useful fixes and balances that Zep has done? On the other hand, if I am going to extensively change the game anyway maybe the modding last GPG version is best as it in itself is now un-changing.

2. What are the methods of hooking? Which is the best method and how should I implement it?
Crazy Cossack
Avatar-of-War
 
Posts: 53
Joined: 13 Mar 2013, 12:44
Has liked: 0 time
Been liked: 9 times
FAF User Name: Crazy_Cossack

Re: Modding - Is This What I Need to Learn First?

Postby IceDreamer » 11 Jun 2014, 14:41

If you want your mod to be used, you mod FAF because that's where people play. Simply hook mods will automatically integrate FAF's changes assuming you launch via the lobby.

For a basic unit change like HP or whatever, juts use a basic blueprint merge. For unit script changes you could use a do/end merge, but personally at that point I juts do a hard overwrite of the entire unit. It makes the file bigger, but it gets rid of any possibility of errors.
IceDreamer
Supreme Commander
 
Posts: 2607
Joined: 27 Dec 2011, 07:01
Has liked: 138 times
Been liked: 488 times

Re: Modding - Is This What I Need to Learn First?

Postby Sheeo » 11 Jun 2014, 15:14

Crazy Cossack wrote:Thanks Ice for message. I have that document and it is very useful. However I have more questions.

1. Which version do I mod? Do I mod the FAF version? Maybe not the last GPG version as that will lack useful fixes and balances that Zep has done? On the other hand, if I am going to extensively change the game anyway maybe the modding last GPG version is best as it in itself is now un-changing.


If you want FAF-players to play with your mods, obviously you'll need to mod the FAF version.

FAF is very 'un-changing' (stable?) as well. All the changes can be easily seen on bitbucket, so keeping up shouldn't be a major concern.

Crazy Cossack wrote:2. What are the methods of hooking? Which is the best method and how should I implement it?


A few. Unless you want to mess with the lobby or certain other lua files, all you need is to use the common method of hooking.

You simply put files in a directory called 'hook' in your mod, with names corresponding to the files from the game you want to hook into.

At load-time, you file is simply appended to the game file before it's run. This means that in order to hook a function from a file, and have other code run your version of the function, you need to keep a reference to the old function, and call it first thing in your new function, which then overrides the old variable.

Searching around will yield more modding resources that I suggest reading as well.
Support FAF on patreon: https://www.patreon.com/faf?ty=h

Peek at our continued development on github: https://github.com/FAForever
Sheeo
Councillor - Administrative
 
Posts: 1038
Joined: 17 Dec 2013, 18:57
Has liked: 109 times
Been liked: 233 times
FAF User Name: Sheeo

Re: Modding - Is This What I Need to Learn First?

Postby Crazy Cossack » 12 Jun 2014, 06:05

Thank you to all who replied. That gives me a clearer idea. Now I just have to get my son to teach me Lua in his holidays. He is a very good Python programmer and as soon as he saw Lua he understood it without any trouble.
Crazy Cossack
Avatar-of-War
 
Posts: 53
Joined: 13 Mar 2013, 12:44
Has liked: 0 time
Been liked: 9 times
FAF User Name: Crazy_Cossack


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest