Questions from a noob modder

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

Questions from a noob modder

Postby nine2 » 25 May 2014, 05:52

So I'm a programmer and I want to start getting into UI modding. I have a few questions and I know the modders here are amazing and was wondering if anyone would have time to explain a few things - would speed me up quite a lot - thanks!

1. what are the best resources to learn? so far I have found
http://supcom.wikia.com/wiki/Beginners_ ... _Structure.
http://forums.gaspowered.com/viewtopic.php?t=2318
http://forums.gaspowered.com/viewtopic.php?t=12880

2. what extremely useful things to know are there? eg:
ctrl f10 - restarts with same params
can launch skirmish from command line

3. how to debug?
so far I've found console and log window

4. how to launch game in skirmish gameplay with cheats enabled? I can launch in skirmish game but not with cheats

5. how to launch game into skirmish lobby

My first mod will be to display the players current energy to mass ratio. I want to add a tiny window with a label in it and set the value. Or maybe I want to smush it somehow into the current eco window.

6. what mod would be a good one to look at that makes a window and displays some text and doesnt do much else? the reclaim window is a good example except it comes with a million other features - I want a tiny mod so I don't get tangled up with a million other things.

7. how, when cheating, do you change yourself to be the other team? so you see from their point of view, control their armies, etc.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Questions from a noob modder

Postby Sheeo » 01 Jun 2014, 15:32

A few inputs:

1.: Reading through the engine lua code is rather helpful. Most is found in mohodata.scd, but some fa-specific code is in schook.scd.

2.: Launching with /map <map_name> starts a skirmish game on that map with ais

3.: /debug and /showlog, as you know. I haven't gotten the debugger to work myself -- so for now LOG() and repr() are good friends to have.

4.: Don't think there's a switch for that. It's possible to make your own commandline switches though, so it's possible to mod that in.

6.: Read through the UI code for FAF.

7. SetFocusArmy <index> in console switches to given army.
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: Questions from a noob modder

Postby nine2 » 01 Jun 2014, 17:03

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

Re: Questions from a noob modder

Postby Domino » 22 Jun 2014, 11:59

hey,

so

alt + f2 which cheats enabled will bring up the unit window, you can place units etc but also if you dbl click on an army you switch to that army..

if you enable the console command debug altclick you can hold alt + click a unit to switch to that army..

i cant think of any small UI mods off the top of my head.. its not to hard though to create a small window some where on the screen..

as said log(' some text ' .. repr(variablename)) are you best friends when debugging lua is case sensertive so Variable is not the same as variable

anything outside of a function is global to that lua file unless its in an ...init.lua file in which case it becomes global to that lua state like siminit.lua globalinit.lua

frontend and user layers are the same layers except they are initialized at different game state time.. (not at same time either)

here are my modding command line params, added to the end of the FA shortcut in the target box

Code: Select all
-debug /enablediskwatch /purgecache /window 1024 768 /log "your path to FA folder/ Log.txt" /showlog


you cant start the game with cheats enabled, i havent found a successful way "yet" no idea what is needed, its not as simple as setting the param from the command line options.
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times


Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest