[Posting] Re: Special friendly codes from add-ons in PCC2
From:streu
Thread:Special friendly codes from add-ons in PCC2
Forum:Bugs
In reply to:Special friendly codes from add-ons in PCC2
Date:Tue, 2020-11-10 19:59 GMT

Is there a way to teach PCC2 special friendly codes from add-ons? Can I simply create xtrfcode.txt in my game directory?

Yes.

I tried to get a list of friendly codes from PlanetsCentral Host by sending "send fcodes" command. That did not work. I did not receive any additional file.

You did receive the file, just not in a way you expect: it was included within your util.dat file.

PCC 1.x (and, as far as I know, VPA) would have asked you during unpack to receive the file. It seems this feature is still missing in PCC2.

I have reconfigured the server so it will include the xtrfcode.txt file with the player files archive starting with the next run. You can then download the file from the game page.

Is their a way to get the friendly codes from add-ons into the friendly code selection lists in PCC2?

The "official" way is unfortunately very undocumented in PCC2 (but documented in PCC1). You can create a file "fcodes.usr" in your game directory that looks like this:

TM1,b,Transmit 1000 mc
TM2,b,Transmit 2000 mc
...
RMT,b,Receive megacredits

to define friendly codes with an explanation string that will be shown on the friendly-code dialog. Alternatively, make a script that uses the AddFCode command to feed such lines into PCC2. xtrfcode.txt will only mark the codes special (so they will not accidentally be randomly generated), but not add them to the dialog.

--Stefan