Forged Alliance Forever Forged Alliance Forever Forums 2016-08-24T17:44:55+02:00 /feed.php?f=41&t=12969 2016-08-24T17:44:55+02:00 2016-08-24T17:44:55+02:00 /viewtopic.php?t=12969&p=133448#p133448 <![CDATA[Re: How to make my mod FAF compatible ?]]>
Selective solution from game version is a good option for me. I think it's always a good idea to make the mod compatible with original FA since this version is carved in stone and because it's already functionnal for me.

Statistics: Posted by Franck75 — 24 Aug 2016, 17:44


]]>
2016-08-23T23:57:16+02:00 2016-08-23T23:57:16+02:00 /viewtopic.php?t=12969&p=133399#p133399 <![CDATA[Re: How to make my mod FAF compatible ?]]>
However, just don't support non-FAF. No one plays it :)

Statistics: Posted by nine2 — 23 Aug 2016, 23:57


]]>
2016-08-23T20:01:12+02:00 2016-08-23T20:01:12+02:00 /viewtopic.php?t=12969&p=133380#p133380 <![CDATA[Re: How to make my mod FAF compatible ?]]>

if you need a destructive hook (Overwriting the original function) then you need 2 versions of your function.

You could ask for the gameversion and decide then what function you will have to use.

Code:
local version = string.gsub(GetVersion(), '1.5.', '')
version = string.gsub(version, '1.6.', '') -- steam
if version > '3649' then
    LOG('Gameversion '..GetVersion()..' detected. hooking for FAF will follow')
else
    LOG('Gameversion '..GetVersion()..' detected. hooking for vanilla/steam will follow')
end

Statistics: Posted by Uveso — 23 Aug 2016, 20:01


]]>
2016-08-23T16:30:12+02:00 2016-08-23T16:30:12+02:00 /viewtopic.php?t=12969&p=133360#p133360 <![CDATA[Re: How to make my mod FAF compatible ?]]>
By hooking, it supposes that the original function is called before or after the moded code.
Code:
local OldModFunction = ModFunction
function ModFunction()
OldModFunctions()
-- my added code
end

or
Code:
local OldModFunction = ModFunction
function ModFunction()
-- my added code
OldModFunctions()
end

or
Code:
local OldModFunction = ModFunction
function ModFunction()
-- my added code
OldModFunctions()
-- my added code
end


This add a constraint if some of my code need to be called into the original function.

So if i want to solve this matter i'm seeing 2 solutions :

1. I try to solve this by architectural modification on my mod in order to make my code called before or after the original code.

2. If it can't be possible, i need to do some destructive hooking by modifying the function.

Code:
function ModFunction()
-- modifiying and adding my code
end


With Destructive Hooking, if i understand well, i may need to make 2 versions of my mod (if FAF changed the original FA modded file) : FA friendly and FAF friendly. Destructive Hooking will modify FA and FAF different files.

Am i wrong ? thanks for your help.

Statistics: Posted by Franck75 — 23 Aug 2016, 16:30


]]>
2016-08-23T15:11:48+02:00 2016-08-23T15:11:48+02:00 /viewtopic.php?t=12969&p=133355#p133355 <![CDATA[Re: How to make my mod FAF compatible ?]]>
There are a lot of files. I go back working ^^

Statistics: Posted by Franck75 — 23 Aug 2016, 15:11


]]>
2016-08-23T15:07:40+02:00 2016-08-23T15:07:40+02:00 /viewtopic.php?t=12969&p=133354#p133354 <![CDATA[Re: How to make my mod FAF compatible ?]]>
Franck75 wrote:
But i need an answer : What lua files are modded by FAF ?

Thanks for you help.

These files https://github.com/FAForever/fa

Statistics: Posted by speed2 — 23 Aug 2016, 15:07


]]>
2016-08-23T15:09:00+02:00 2016-08-23T15:03:50+02:00 /viewtopic.php?t=12969&p=133353#p133353 <![CDATA[Re: How to make my mod FAF compatible ?]]>
My mod is working properly on orginal FA.

I did some test on FAF, and it crashed but i may be fixed i think. I need to make my code more readable in order requesting your help. I'm currently in dev and i'm not paying attention to make it easy.
I'm on 3k new lines of code now. I will take a little time.

But may i try by myself if i understand the FAF constraints.

I think i need to make my code hooking properly and editing not directly the full lua files. I suppose that lua files from original FA and from FAF are different.
I will try to do this.

But i need an answer : What lua files are modded by FAF ?

Thanks for you help.

Statistics: Posted by Franck75 — 23 Aug 2016, 15:03


]]>
2016-08-23T13:47:47+02:00 2016-08-23T13:47:47+02:00 /viewtopic.php?t=12969&p=133351#p133351 <![CDATA[Re: How to make my mod FAF compatible ?]]>
ie: if you aren't hosting through FAF then no, your test doesn't prove anything

Statistics: Posted by nine2 — 23 Aug 2016, 13:47


]]>
2016-08-22T21:10:34+02:00 2016-08-22T21:10:34+02:00 /viewtopic.php?t=12969&p=133304#p133304 <![CDATA[Re: How to make my mod FAF compatible ?]]>
theoretical yes.

But you could also post a link to your mod, an we can have a look at it.
Then we can say yes or no. (We need to see the error log)

Statistics: Posted by Uveso — 22 Aug 2016, 21:10


]]>
2016-08-22T14:41:01+02:00 2016-08-22T14:41:01+02:00 /viewtopic.php?t=12969&p=133276#p133276 <![CDATA[How to make my mod FAF compatible ?]]>
I saw on this forum that lots of mods broke when new FAF patches are released.

I have latest FAF installed on my computer, does it mean that if my mod is working it will be ok with FAF ?

Thanks for your help.

Statistics: Posted by Franck75 — 22 Aug 2016, 14:41


]]>