Testing environment for non-mod changes

Post here if you want to help developing something for FAF.

Testing environment for non-mod changes

Postby Thim » 14 Sep 2015, 03:33

I had talked about contributing code to FAF before, but now I'm at a point in my life where I'm ready to actually branch the github and get some real work done. The question I wanted to ask was this: When you are working on a change that involves editing core code (something you can't toggle as a stand-alone mod, how do you go about testing it? I used to just change the .lua files directly and work that way, but it's kind of hackish and doesn't seem to work at all with FAF. Secondly, is there a way to run the program with a console you can print out to? I see console.log statements in code, but the only way I have figured out to print out anything is to encode my messages as numbers, have the number be the damage value all attacks, and shoot something to see how much damage was dealt!
I would appreciate any other info you can pass. I realize I will have some learning to do, and I'm ready to pay my dues.
Thim
Crusader
 
Posts: 26
Joined: 08 Nov 2014, 02:48
Has liked: 0 time
Been liked: 1 time
FAF User Name: Thim

Re: Testing environment for non-mod changes

Postby speed2 » 14 Sep 2015, 09:07

And what if you go to this page and scroll down a bit to readme https://github.com/FAForever/fa is that any helpful?
User avatar
speed2
Contributor
 
Posts: 3189
Joined: 05 Jan 2013, 15:11
Has liked: 636 times
Been liked: 1119 times
FAF User Name: speed2

Re: Testing environment for non-mod changes

Postby nine2 » 14 Sep 2015, 12:00

Thim wrote:I used to just change the .lua files directly and work that way, but it's kind of hackish and doesn't seem to work at all with FAF.


In this case the correct thing to do is edit the core faf .lua files. It's not hackish, it's development. To test you need to launch FA in a special way (see the readme that speed2 refers to), otherwise your changes will be disregarded. You cannot edit the normal FAF game (otherwise you could cheat and desync) ... so you get it working on your own local version, then make a pull request, sheeo merges, then after 6 months it gets published :) and everyone gets your change.

Thim wrote:Secondly, is there a way to run the program with a console you can print out to?


You write LOG("blah") statements and they appear in both the log text file and the log window, which you show with F9.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Testing environment for non-mod changes

Postby Thim » 14 Sep 2015, 22:49

Thanks. Perhaps I should try scrolling down on a page before asking questions :)
Thim
Crusader
 
Posts: 26
Joined: 08 Nov 2014, 02:48
Has liked: 0 time
Been liked: 1 time
FAF User Name: Thim

Re: Testing environment for non-mod changes

Postby Thim » 15 Sep 2015, 00:25

Ok, so I have it all running from the cloned repo, but when I try skirmish or multiplayer modes, I can't load the map in the lobby (it's also supcom's origonal lobby, not FAF's). Cloneing the lobby repo into the same place didn't fix it, although I haven't finished trying to compile the python there, so if that fixes it I almost have it done. Any ideas?
Thim
Crusader
 
Posts: 26
Joined: 08 Nov 2014, 02:48
Has liked: 0 time
Been liked: 1 time
FAF User Name: Thim

Re: Testing environment for non-mod changes

Postby nine2 » 15 Sep 2015, 03:45

You shouldn't be dealing with python. You clone the fafs version of FA lua code.

You launch the ingame lobby from a shorcut you create on your desktop.

It will be the skirmish ui, which looks slightly different from the custom network game ui (which is what you normally see when you play through official FAF).

Launch game
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Testing environment for non-mod changes

Postby quark036 » 16 Sep 2015, 06:04

As an example, here is my dev shortcut:

C:\ProgramData\FAForever\bin\ForgedAlliance.exe /init "init_dev.lua" /EnableDiskWatch /showlog /nomovie /nosound /noverify /nomusic /windowed 800 800

Make sure you have created the init_dev.lua correctly as it tells you to in the readme on github.
quark036
Avatar-of-War
 
Posts: 165
Joined: 11 Mar 2015, 03:17
Has liked: 10 times
Been liked: 26 times
FAF User Name: Quark036

Re: Testing environment for non-mod changes

Postby Thim » 16 Sep 2015, 23:58

Tried it again an hour later; it's working. Now my issue is that changes to my files cloned from the git repo don't seem to do anything. Interestingly, changing the path to them to a file I know doesn't exist doesn't cause any kind of issue. I'm sure I'll get it worked out though. Thanks for all the help!
Thim
Crusader
 
Posts: 26
Joined: 08 Nov 2014, 02:48
Has liked: 0 time
Been liked: 1 time
FAF User Name: Thim

Re: Testing environment for non-mod changes

Postby Korbah » 13 Oct 2015, 11:02

Thim wrote:Tried it again an hour later; it's working. Now my issue is that changes to my files cloned from the git repo don't seem to do anything. Interestingly, changing the path to them to a file I know doesn't exist doesn't cause any kind of issue. I'm sure I'll get it worked out though. Thanks for all the help!



Did you get this working? My FA-develop dump doesn't seem to work any more. Not sure why!
Korbah
Avatar-of-War
 
Posts: 225
Joined: 01 May 2012, 16:27
Has liked: 7 times
Been liked: 12 times
FAF User Name: Korbah

Re: Testing environment for non-mod changes

Postby nine2 » 14 Oct 2015, 12:22

Hi Korbah, I was afk when you messaged me. Post your full Korbah_mod_log.txt here and i will take a look
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Next

Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest