How to look at code for engine function?

Everything about mods can be found here.

Moderator: Morax

How to look at code for engine function?

Postby Zavindur » 20 Apr 2020, 04:17

Hello,

I've been able to override a function just fine, but I would like to know what the function does.
The specific function I'm referencing is OkayToMessWithArmy

I've searched around and found it referenced here: https://github.com/FAForever/fa/blob/de ... ne/Sim.lua

but that doesn't list the actual code; I've tried searching within the gamedata folder, but all the zipped lua files in there only reference the function and don't actually contain it.

The end result I'm trying to achieve is to update the "SharedArmies" mod so it works; I've gotten to where it transfers the units to the 'team leader', and sets the army focus to that players, but every attempt to do something states the player is "trying to cheat." (allowing cheats makes it work, but I don't want that)
Originally the mod used the ArmyGetHandicap function to allow another player to control the army, but that function seems to no longer take 3 arguments- there original code was like this "pcall(ArmyGetHandicap, army - 1, CommandSources[player] - 1, allowControl) ";

I'm hoping that if I can see the OkayToMessWithArmy code, that i'll be able to see if there is some variable or something that I can set to authorize one player to control another players units.

Any help or advice would be appreciated.
Thanks,
Zav
Zavindur
Crusader
 
Posts: 14
Joined: 23 Feb 2019, 05:03
Has liked: 4 times
Been liked: 1 time
FAF User Name: Zavindur

Re: How to look at code for engine function?

Postby keyser » 20 Apr 2020, 10:43

the sharedarmy mod is working i think ?
There is few known bugs but I've hosted few tourneys with this mod the past years. Could have been broken recently i guess, i didn't try it.
Zockyzock:
VoR is the clan of upcoming top players now
keyser
Councillor - Game
 
Posts: 1870
Joined: 17 May 2013, 14:27
Has liked: 424 times
Been liked: 540 times
FAF User Name: keyser

Re: How to look at code for engine function?

Postby Zavindur » 22 Apr 2020, 23:20

the function that the original version uses doesn't work, i was able to locate the new function and have added it;
I'm working on final testing now.
Zavindur
Crusader
 
Posts: 14
Joined: 23 Feb 2019, 05:03
Has liked: 4 times
Been liked: 1 time
FAF User Name: Zavindur

Re: How to look at code for engine function?

Postby Zavindur » 23 Apr 2020, 02:11

Yay, its working now, named it sharedarmies2

ended up browsing the functions until i found the one that did what i needed.
Zavindur
Crusader
 
Posts: 14
Joined: 23 Feb 2019, 05:03
Has liked: 4 times
Been liked: 1 time
FAF User Name: Zavindur


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest