The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: Vladki on October 16, 2017, 08:02:20 PM

Title: Removing contracts from factories
Post by: Vladki 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 ;)
Title: Re: Removing contracts from factories
Post by: jamespetts 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.
Title: Re: Removing contracts from factories
Post by: Vladki on October 16, 2017, 11:21:11 PM
Quote from: jamespetts 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.
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

Sent from my ONEPLUS A3003 using Tapatalk

Title: Re: Removing contracts from factories
Post by: jamespetts on October 16, 2017, 11:23:10 PM
Where is the equivalent option in Standard, may I ask?
Title: Re: Removing contracts from factories
Post by: Vladki on October 17, 2017, 07:03:49 PM
Quote from: jamespetts on October 16, 2017, 11:23:10 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:


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)

Title: Re: Removing contracts from factories
Post by: jamespetts on October 17, 2017, 10:12:33 PM
Do I understand that XML loading and saving does not work at all in Extended?
Title: Re: Removing contracts from factories
Post by: Vladki on October 17, 2017, 10:21:09 PM
Well, you can save as xml, and the result looks like XML, but cannot be loaded.
Title: Re: Removing contracts from factories
Post by: jamespetts on October 17, 2017, 10:58:06 PM
And does XML loading work in Standard?
Title: Re: Removing contracts from factories
Post by: Vladki on October 18, 2017, 07:16:05 AM
It did one or two years ago. I'll check latest nightly tonight.

Sent from my ONEPLUS A3003 using Tapatalk

Title: Re: Removing contracts from factories
Post by: jamespetts on October 18, 2017, 09:19:44 AM
Thank you.
Title: Re: Removing contracts from factories
Post by: Vladki 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.
Title: Re: Removing contracts from factories
Post by: wlindley 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. 
Title: Re: Removing contracts from factories
Post by: Vladki on October 18, 2017, 10:41:29 PM
Quote from: wlindley 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.

Wow! It really works! Another hidden ctrl-click feature, thanks for the hint
Title: Re: Removing contracts from factories
Post by: jamespetts 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.
Title: Re: Removing contracts from factories
Post by: TurfIt 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.
Title: Re: Removing contracts from factories
Post by: jamespetts 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?