Author Topic: Removing contracts from factories  (Read 604 times)

0 Members and 1 Guest are viewing this topic.

Offline Vladki

Removing contracts from factories
« on: October 16, 2017, 08:02:20 PM »
Hello,

in public player tools there is a tool to make a contract between two factories. Would it be too hard to make a tool that will cancel a contract?

I sucessfully did such hack in standard by saving the game as xml, but extended does not offer such save format. It could be useful for other hacks/debugging ;)

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15820
  • Total likes: 404
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Removing contracts from factories
« Reply #1 on: October 16, 2017, 11:11:36 PM »
I have never looked into creating such a tool - in principle, the same result could be achieved by deleting and rebuilding the industry and then adding all but the offending connexion. It would probably be possible, but a non-trivial amount of work (and it would take a fair bit of work just to work out where to change to code to add such a tool).

Are you sure that Extended cannot save files in XML? I do not remember changing that part of the code.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: Removing contracts from factories
« Reply #2 on: October 16, 2017, 11:21:11 PM »
I have never looked into creating such a tool - in principle, the same result could be achieved by deleting and rebuilding the industry and then adding all but the offending connexion. It would probably be possible, but a non-trivial amount of work (and it would take a fair bit of work just to work out where to change to code to add such a tool).

Are you sure that Extended cannot save files in XML? I do not remember changing that part of the code.
The problem with deleting factory is that it will delete also its suppliers and and recipients, that have a contract only with the deleted factory.

I wanted to save as xml but could not find the option to do it. Only save version but not xml/binary




Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15820
  • Total likes: 404
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Removing contracts from factories
« Reply #3 on: October 16, 2017, 11:23:10 PM »
Where is the equivalent option in Standard, may I ask?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: Removing contracts from factories
« Reply #4 on: October 17, 2017, 07:03:49 PM »
Where is the equivalent option in Standard, may I ask?

OK, you win :) - nowhere, just in simuconf.tab. I was under the impression that I was able to change it in advanced settings dialogue. No, I can't do that even in standard.

So now I have a xml save (the demo game), but it does not load:

Code: [Select]
Message: karte_t::load():       Prepare for loading
World destroyed.
Warning: karte_t::load: Fileversion: 120004
FATAL ERROR: loadsave_t::start_tag() - expected "/roadsign_t", got "koord3d>
  ��������������������������������������"
Aborting program execution ...

For help with this error or to file a bug report please see the Simutrans forum at
http://forum.simutrans.com
Neúspěšně ukončen (SIGABRT)

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15820
  • Total likes: 404
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Removing contracts from factories
« Reply #5 on: October 17, 2017, 10:12:33 PM »
Do I understand that XML loading and saving does not work at all in Extended?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: Removing contracts from factories
« Reply #6 on: October 17, 2017, 10:21:09 PM »
Well, you can save as xml, and the result looks like XML, but cannot be loaded.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15820
  • Total likes: 404
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Removing contracts from factories
« Reply #7 on: October 17, 2017, 10:58:06 PM »
And does XML loading work in Standard?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: Removing contracts from factories
« Reply #8 on: October 18, 2017, 07:16:05 AM »
It did one or two years ago. I'll check latest nightly tonight.




Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15820
  • Total likes: 404
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Removing contracts from factories
« Reply #9 on: October 18, 2017, 09:19:44 AM »
Thank you.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Vladki

Re: Removing contracts from factories
« Reply #10 on: October 18, 2017, 06:57:57 PM »
I have tested with standard. XML save/load worked fine for pak128 and pak128.CS, but not for pak128.Britain - it saved as binary, and crashed on loading one 2,5 years old save.

Tried pak.sweden with simutrans-extended and it fails with the same error as pak.britain.

Offline wlindley

Re: Removing contracts from factories
« Reply #11 on: October 18, 2017, 09:15:30 PM »
as to original topic: Already exists, does it not? Clicking one industry and then another with the Link Industries tool (at least in the Britain pak) creates a contract; doing the same with Ctrl+Click cancels that contract. 

Offline Vladki

Re: Removing contracts from factories
« Reply #12 on: October 18, 2017, 10:41:29 PM »
as to original topic: Already exists, does it not? Clicking one industry and then another with the Link Industries tool (at least in the Britain pak) creates a contract; doing the same with Ctrl+Click cancels that contract.

Wow! It really works! Another hidden ctrl-click feature, thanks for the hint

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15820
  • Total likes: 404
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Removing contracts from factories
« Reply #13 on: October 18, 2017, 11:27:48 PM »
Thank you for testing the XML saving/loading and noting the CTRL+click feature of which even I was unaware respectively - that is most helpful.

It seems as though XML saving is really not working properly even in Standard - I think that it is virtually deprecated.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline TurfIt

Re: Removing contracts from factories
« Reply #14 on: October 19, 2017, 12:12:51 AM »
XML saving/loading works fine, if hideously slow...XML_zipped much more tolerable.  (in Standard)
Pak128.Britain's issue is malformed simuconf inappropriately containing "system" settings like the save format.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 15820
  • Total likes: 404
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Removing contracts from factories
« Reply #15 on: October 19, 2017, 10:33:45 AM »
I cannot find these settings in Pak128.Britain-Ex's simuconf.tab - are these only in the Standard version?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.