Custom Contracts API broken behavior
When using the modding API to add a custom contract to contract blocks, the contracts do not appear for contract blocks on Economy stations. They do appear for contract blocks that have been placed by a player or admin, even after changing ownership of the blocks to an NPC faction. But the contracts will not appear on the contract blocks on stations and bases spawned by the Economy system. As a modder, the expected behavior is that when adding a contract to a contract block, it will appear. (I have ensured the NPC factions that own the contract blocks on the Economy stations have enough money to cover the contract.)
Custom Contracts do not award or penalize reputation when they are completed or failed.
Both of these issues affect one of my mods, which allows players to haul actual grids between destinations, using the contract system. Unfortunately the two issues above cause problems. I need to spawn in a completely separate set of trading stations with contract blocks in order for players to find the contracts. And the reputation issue means that none of the contracts will modify reputation, simple as that.
Lastly, there is a bug in the contract type system. When creating a new type of contract, the name is not displayed correctly in the contract type dropdown. This is the dropdown where you select "Acquisition" or "Escort" or "Search" or whatever. The new contracts display as this "ContractType NameLocalizationKey." Some investigation in the Keen discord led me to believe I needed to provide a .resx file and another file to provide that localization information, but after creating it, the display name did not change. I later learned that in this specific case, the contract system does not actually read from the .resx file. So there's no way to actually set that displayed information.
Please let me know if you need any additional information or would like to look at the code I'm using.
This is the Freight Contracts mod: https://steamcommunity.com/sharedfiles/filedetails/?id=2915223144&tscn=1673372483
Thank you very much!
I believe Keen made some gestures in 2022 to make the game more modder friendly... especially working with modders. This is, again, one of those situations. Here's a feature that should have better hooks in the API since NPC faction disposition factors into any modded game or SCENARIO with NPCs. Completing a modded task or quest for the NPC as well as query the disposition allows for better world building.
I believe Keen made some gestures in 2022 to make the game more modder friendly... especially working with modders. This is, again, one of those situations. Here's a feature that should have better hooks in the API since NPC faction disposition factors into any modded game or SCENARIO with NPCs. Completing a modded task or quest for the NPC as well as query the disposition allows for better world building.
This is very important for new content. It should be on the list.
This is very important for new content. It should be on the list.
Here is a code for loading localization:
Here is a code for loading localization:
Yes its i wanted feature ! Pls if we can fix it that would be great !
Yes its i wanted feature ! Pls if we can fix it that would be great !
I love this mod idea and it would be great if the API could be fixed so it worked with economy stations
I love this mod idea and it would be great if the API could be fixed so it worked with economy stations
Hello Patrick Heney,
Localization works fine.
You need translate "ContractType_NameLocalizationKey_FreightContract" key, instead of "FreightContract".
Also in your scripts, I dont see localization loading logic (something that I posted above)
Hello Patrick Heney,
Localization works fine.
You need translate "ContractType_NameLocalizationKey_FreightContract" key, instead of "FreightContract".
Also in your scripts, I dont see localization loading logic (something that I posted above)
Hello, Patrick and other Engineers!
Thank you so much for reporting this.
This thread can be basically split to three topics:
1) the contracts do not appear in the contract blocks on economy stations
2) when contracts are placed manually in player spawned station, it is not affecting reputation
3) the localization issue
I've reported the first two issues.
The third one should be solved if you use the piece of code and information from Gregory, which you can find above.
Kind Regards
Keen Software House: QA Department
Hello, Patrick and other Engineers!
Thank you so much for reporting this.
This thread can be basically split to three topics:
1) the contracts do not appear in the contract blocks on economy stations
2) when contracts are placed manually in player spawned station, it is not affecting reputation
3) the localization issue
I've reported the first two issues.
The third one should be solved if you use the piece of code and information from Gregory, which you can find above.
Kind Regards
Keen Software House: QA Department
Hi Ondrej! Thank you very much for taking the time to look at this issue. Please let me know if you need any additional information from me. :)
Hi Ondrej! Thank you very much for taking the time to look at this issue. Please let me know if you need any additional information from me. :)
Hello, Patrick,
so, our programmer team took a look on this thread and these issues.
They came to conclusion that only the second part bugged. I needed to close the first one (contract do not appear in the stations), as contracts on stations are only for that specific NPC faction not for players.
Still keeping this thread on Reported state though, because of the second issue (reputation not changing).
Kind Regards
Keen Software House: QA Department
Hello, Patrick,
so, our programmer team took a look on this thread and these issues.
They came to conclusion that only the second part bugged. I needed to close the first one (contract do not appear in the stations), as contracts on stations are only for that specific NPC faction not for players.
Still keeping this thread on Reported state though, because of the second issue (reputation not changing).
Kind Regards
Keen Software House: QA Department
Hello, I tried to implement custom contract in a simmilar manner. Contracts are being added properly to NPC contract blocks that are on NPC encounters or that are manually placed for example, but aren't added to the economy trade station contract blocs.
Hello, I tried to implement custom contract in a simmilar manner. Contracts are being added properly to NPC contract blocks that are on NPC encounters or that are manually placed for example, but aren't added to the economy trade station contract blocs.
The steps to replicate the issue (done via MyApiGateway.ContractSystem API)
Expected result
NPC contract owned by NPC faction is added to contract block on Economy station owned by same NPC faction.
Actual result
Contract does not appear in the contract block.
The steps to replicate the issue (done via MyApiGateway.ContractSystem API)
Expected result
NPC contract owned by NPC faction is added to contract block on Economy station owned by same NPC faction.
Actual result
Contract does not appear in the contract block.
Replies have been locked on this page!