Forged Alliance Forever Forged Alliance Forever Forums 2016-01-10T22:00:38+02:00 /feed.php?f=45&t=9209 2016-01-10T22:00:38+02:00 2016-01-10T22:00:38+02:00 /viewtopic.php?t=9209&p=117439#p117439 <![CDATA[Re: Getting started with modding]]>
Anihilnine wrote:
... What sort of changes do you have in mind for it?

Thanks for this guide and your modding resources.

Latest version (3.2) BabeLua and all previous versions as far I know have the following issues:
- no syntax highlighting for lua files saved with file extensions other than .lua (e.g. .bp)
- no support for standard Lua comments "---" instead each function must have comments with "[Comment]" keyword in order so see them in IntelliSense
- no support for "continue" keyword and as result Outline Explorer is not populated with members/functions which means no navigation in lua files with continue keyword :(

So I got source code for this VS extension and implemented all above features but then I realized that https://babelua.codeplex.com/SourceControl/latest has very old version of BabeLua (v1.5) without Outline Explorer (a must-have feature for me). I think that I will go back using Notepad++ with FunctionList plugin unless I get source code for BabeLua 3.2. Which version of BabeLua are you using and how do you navigate within lua files?

Statistics: Posted by HUSSAR — 10 Jan 2016, 22:00


]]>
2016-01-10T08:36:40+02:00 2016-01-10T08:36:40+02:00 /viewtopic.php?t=9209&p=117350#p117350 <![CDATA[Re: Getting started with modding]]> viewtopic.php?f=45&t=11447#p117347

I use babelua too - it's pretty nice. What sort of changes do you have in mind for it?

Statistics: Posted by nine2 — 10 Jan 2016, 08:36


]]>
2016-01-09T10:19:47+02:00 2016-01-09T10:19:47+02:00 /viewtopic.php?t=9209&p=117284#p117284 <![CDATA[Re: Getting started with modding]]>
Anihilnine wrote:
putting this together but takes a while

there's is no rush and I look forward to go through your scripts and tools. Btw, I found really nice tool called BabeLua for working with Lua in Visual Studio: https://babelua.codeplex.com

It is open source and I plan to extend it to support new functionalities focused on FA game.

Statistics: Posted by HUSSAR — 09 Jan 2016, 10:19


]]>
2016-01-09T08:02:36+02:00 2016-01-09T08:02:36+02:00 /viewtopic.php?t=9209&p=117281#p117281 <![CDATA[Re: Getting started with modding]]> Statistics: Posted by nine2 — 09 Jan 2016, 08:02


]]>
2016-01-05T06:38:16+02:00 2016-01-05T06:38:16+02:00 /viewtopic.php?t=9209&p=117064#p117064 <![CDATA[Re: Getting started with modding]]>
Anihilnine wrote:
...
Starting guide...

If you want, I can provide those scripts I mentioned and the actual command line args I use. I also have a excel spreadsheet I made that contains all of the functions available ...


Really nice guide and I learned a few things. Can you send me those scripts, command line args, and the excel spreadsheet? So I can compare with my testing setup and perhaps improve it.

Statistics: Posted by HUSSAR — 05 Jan 2016, 06:38


]]>
2015-04-05T13:10:15+02:00 2015-04-05T13:10:15+02:00 /viewtopic.php?t=9209&p=97731#p97731 <![CDATA[Re: Getting started with modding]]>
viewtopic.php?f=41&t=8700#p83509

Statistics: Posted by Dragonfire — 05 Apr 2015, 13:10


]]>
2015-04-05T13:02:20+02:00 2015-04-05T13:02:20+02:00 /viewtopic.php?t=9209&p=97730#p97730 <![CDATA[Re: Getting started with modding]]> Statistics: Posted by nine2 — 05 Apr 2015, 13:02


]]>
2015-04-05T12:22:53+02:00 2015-04-05T12:22:53+02:00 /viewtopic.php?t=9209&p=97729#p97729 <![CDATA[Re: Getting started with modding]]> Statistics: Posted by Dragonfire — 05 Apr 2015, 12:22


]]>
2015-04-05T12:20:56+02:00 2015-04-05T12:20:56+02:00 /viewtopic.php?t=9209&p=97728#p97728 <![CDATA[Re: Getting started with modding]]>
Dragonfire wrote:
Debugging is possible:

http://forums.gaspowered.com/viewtopic.php?t=1847

Maybe start a new wiki page for all the stuff?

Yes! Wiki is just waiting for you guys to contribute. Feel free to unleash your furies there and write as much as you can.

Statistics: Posted by speed2 — 05 Apr 2015, 12:20


]]>
2015-04-05T12:19:23+02:00 2015-04-05T12:19:23+02:00 /viewtopic.php?t=9209&p=97727#p97727 <![CDATA[Re: Getting started with modding]]> Statistics: Posted by nine2 — 05 Apr 2015, 12:19


]]>
2015-04-05T12:07:01+02:00 2015-04-05T12:07:01+02:00 /viewtopic.php?t=9209&p=97726#p97726 <![CDATA[Re: Getting started with modding]]>
http://forums.gaspowered.com/viewtopic.php?t=1847

Maybe start a new wiki page for all the stuff?

Statistics: Posted by Dragonfire — 05 Apr 2015, 12:07


]]>
2015-04-04T19:19:25+02:00 2015-04-04T19:19:25+02:00 /viewtopic.php?t=9209&p=97699#p97699 <![CDATA[Re: Getting started with modding]]>
I already bookmarked the wiki page, just didn't start going through it yet. :) I'll definitely try the /enablediskwatch parameter too.

Statistics: Posted by Ksi — 04 Apr 2015, 19:19


]]>
2015-04-04T18:55:05+02:00 2015-04-04T18:55:05+02:00 /viewtopic.php?t=9209&p=97698#p97698 <![CDATA[Re: Getting started with modding]]>
Ksi wrote:
One challenge I'm facing right now is that I'm lacking a fast way to test the code changes I've made (I'm learning a lot by "reverse engineering" available mods, but restarting the game through FAF after every small change is getting tedious).



/EnableDiskWatch

Add that line to the Target line of a shortcut to the FAF ForgedAlliance.exe. This allows the engine to monitor any changes to game files. If a change has been made it will try to re-load the file. This is especially handy when editing units, but you need to build / spawn a new unit for the new changes. Kind off handy when you want to compare changes: build a unit, make the file changes, and then build another unit. Now you have two units with different stats so you can see how they play out.

I do not know how that will work out for UI elements. I know there are console commands to turn on and off the UI, so maybe that can work.

As an example, here is what my target line for my shortcut is:
C:\ProgramData\FAForever\bin\ForgedAlliance.exe /log Maklog.txt /enablediskwatch

Here is a listing of other command line switches as well as other useful information.

You really need to go through the old wiki that I linked for you back in January.

Statistics: Posted by The Mak — 04 Apr 2015, 18:55


]]>
2015-04-04T17:33:23+02:00 2015-04-04T17:33:23+02:00 /viewtopic.php?t=9209&p=97692#p97692 <![CDATA[Re: Getting started with modding]]>
Got a couple ideas for mods so far. The second one is a long-term plan, considering my current lack of coding skills. :) If you have any tips or suggestions, I would really appreciate a helping hand in getting to grips with the basics.

Smart build queue
-Allow adding specially flagged units in the queue, which bypass the infinite repeat function. (Click on the build icon with a modifier key). Useful for quickly getting a couple of air scouts or a transport out of an air fac that's churning out ASFs on infinite repeat.
-When dragging unit(s) all the way to the left in the queue, don't cancel the currently building unit, but instead add the dragged units after the one under construction.

Classic RTS UI
-Minimap displayed at bottom left. Display units as small blips instead of as strategic icons (think Starcraft minimap)
-At bottom center display either the selection list, or build queue if a builder or a group of similiar builders are selected.
-At bottom right diplay a multimode command grid that displays the following, depending on selection:
[*]Unit orders (attack/move/etc.)
[*]Unit orders with a hotkey to access the build grid (for mobile builders)
[*]Build grid for buildings, with tabs to access different tech tiers and upgrades (mobile builders)
[*]Build grid for units, with tabs to access different tech tiers (factories etc.)

One challenge I'm facing right now is that I'm lacking a fast way to test the code changes I've made (I'm learning a lot by "reverse engineering" available mods, but restarting the game through FAF after every small change is getting tedious).

partytime wrote:
If you want, I can provide those scripts I mentioned and the actual command line args I use. I also have a excel spreadsheet I made that contains all of the functions available ... kind of like luadoc but with heaps more in it that weren't mentioned. I built the spreadsheet by repr'ing all of the modules..

Yes please! Exactly what I need to speed up the code testing. :)

PS. For those looking for a good IDE, I'm using Sublime Text myself, and I find it works quite nicely, as it allows finding function definitions pretty quickly with the search function that spans all the files and folders included in the project folder.

Statistics: Posted by Ksi — 04 Apr 2015, 17:33


]]>
2015-02-07T07:54:00+02:00 2015-02-07T07:54:00+02:00 /viewtopic.php?t=9209&p=93116#p93116 <![CDATA[Re: Getting started with modding]]>
Jeroen De Dauw wrote:
partytime wrote:Disclaimer 1: I am a noob myself.
Disclaimer 2: I'm doing this from memory so the exact keywords are incorrect.


Thank you for the info!

Starting guide. There are lots of tidbits floating around on different forums with examples but normally just find a mod that does something similar and look at it's code. Critically, the FA code is overridden by the FAF code which is overridden by your mod.

partytime wrote:
IDE - no way. No go to definition or test runner. Think notepad. I use visual studio because it's just a nice text editor. You can get plugins that understand lua (syntax highlighting) but I don't use them. Basically all you need is something that can find text across many files at once quickly.


I installed the lua plugin into my IntelliJ IDE. (Cannot link it due to derp forum restrictions.) This has things such as go to definition. I've yet to see how well this works for the FAF codebase.

partytime wrote:
Feedback cycle. ...


I'd like to do this on my Linux box, which means booting the game is not an option. (Well, I guess I could go the VM route, though that is a lot of hassle I rather avoid.)

One question I have now that has not been answered as far as I can see is to what extend the code one typically touches with mods can be executed (and thus tested) without running the game itself. And to what extend this code depends on Windows.


The lua plugin for intellij's "Goto definition" feature works sporadically, so you can't be certain that it points you in the right direction (This is not taking hook files into account!). Use double-shift and do a search for your definition to be sure.


With a few regex tricks to replace GPG's custom lua syntax, you can execute the game code with a lua 5.0 interpreter.

We use luac5.2 as a fancy syntax-checker on our FA repo: https://github.com/FAForever/fa/blob/develop/.travis.yml.

There are no unit tests, and to actually execute useful code, you'll need to define some functions from the engine API. Work on this hasn't really gone further.

Statistics: Posted by Sheeo — 07 Feb 2015, 07:54


]]>