News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Removing contracts from factories

Started by Vladki, October 16, 2017, 08:02:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vladki

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 ;)

jamespetts

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.

Vladki

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


jamespetts

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.

Vladki

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)


jamespetts

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.

Vladki

Well, you can save as xml, and the result looks like XML, but cannot be loaded.

jamespetts

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.

Vladki

It did one or two years ago. I'll check latest nightly tonight.

Sent from my ONEPLUS A3003 using Tapatalk


jamespetts

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.

Vladki

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.

wlindley

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. 

Vladki

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

jamespetts

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.

TurfIt

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.

jamespetts

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.