Cantr2Projects program

General out-of-character discussion among players of Cantr II.

Moderators: Players Department, Public Relations Department

User avatar
NiKnight
Posts: 791
Joined: Thu Jun 23, 2005 8:32 pm

Cantr2Projects program

Postby NiKnight » Sat Jun 21, 2008 4:50 pm

I want to share a small program which helps to calculate Cantr machine projects.

Screenshot
Image

Download

Requirements

Any OS with installed Java Enviroment in version at least 1.5

License
This program is free for everyone. Use it as you want but the author does not take any responsibility for damages caused by the use of this program.

How to start

To start program simply double click on Cantr2Projects.jar or use command:

Code: Select all

java -jar Cantr2Projects.jar


How to configure

There is cantr2projects.properties file in program's directory. Modify its contents to customize path to data files or other stuff.

Every machine is described by xml file in data directory. If you want to add new machine or project modify this files or create new ones.

For example project for smelting iron looks like this:

Code: Select all

   <project name="Refining iron ore (coal)">
      <productName>Iron</productName>
      <dailyQuantity>350</dailyQuantity>
      <description></description>
      <semiProduct name="Iron ore" quantity="700" />
      <semiProduct name="Coal" quantity="420" />
      <semiProduct name="Limestone" quantity="1400" />
   </project>

I think i don't have to add comments as contents of project is simply to understand. But you should write amounts of product and semi products in daily quantities to get overall time (in days) needed to finish the project.


If you find mistakes in xml files or bugs PM me.

I hope this program helps to save some time :wink:
Ni Ni Ni Ni!
User avatar
Tangential
Posts: 958
Joined: Tue Oct 10, 2006 3:51 am

Postby Tangential » Sat Jun 21, 2008 9:23 pm

AWESOME! 8)

heck yes it'll save time. Now I don't have to do ratio calculations - Sweet!

Works great. Thanks, man.
User avatar
trexdino
Posts: 1094
Joined: Sun Sep 09, 2007 1:54 am
Location: the planet earth, or is it?...

Postby trexdino » Sat Jun 21, 2008 10:56 pm

Wanted to see what somebody else had to say before I downloaded it. Sorry, but little paranoid about downloading stuff.
When you hope for something, you often believe in something. When you believe in something, you often have pride in it. Being proud often leads to a hating of some group.
As you can see, the Jedi are hypocrites.
User avatar
Tangential
Posts: 958
Joined: Tue Oct 10, 2006 3:51 am

Postby Tangential » Sat Jun 21, 2008 11:08 pm

haha yea.. it's safe. I use ESET NOD32 as my antivirus, so it's completely safe and the program works easily. I totally recommend it. thanks again!
toon
Posts: 948
Joined: Wed Nov 07, 2007 11:00 pm

Postby toon » Sat Jun 21, 2008 11:28 pm

Do I need to do something else If I am using Vista? Because I can't get it to come up.
User avatar
marol
Posts: 3728
Joined: Sun Jul 17, 2005 11:45 am
Location: Kraków, PL
Contact:

Postby marol » Sat Jun 21, 2008 11:43 pm

NiKnight, too bad you have decided to do it own your own. You could have asked me to prepare XML file to you. It's probably too late, but here's PHP script that generates all the machines in XML:

http://cantr.net/app/niknight.php

You need to modify your viewer a little bit, so it can read many machines from single XML file.

@toon:
It runs fine on my Vista x64. Are you sure you have Java Runtime Machine installed?
(SRVPRC)
Image
Voltenion
Posts: 2286
Joined: Sat Aug 25, 2007 3:52 am
Location: "Portugalija" como dizem alguns filhos da mãe
Contact:

Postby Voltenion » Sun Jun 22, 2008 1:47 am

nerds.... xD
"Delete Fu Island" activist.
User avatar
Pilot
Administrator Emeritus
Posts: 7603
Joined: Thu Sep 21, 2006 3:32 pm

Postby Pilot » Sun Jun 22, 2008 1:57 am

I've been using this one for months now:
http://www.smrw.lodz.pl/%7Empni/cantr/ 8)
toon
Posts: 948
Joined: Wed Nov 07, 2007 11:00 pm

Postby toon » Sun Jun 22, 2008 3:09 am

Still not working for me..
User avatar
joo
Posts: 5021
Joined: Fri Jun 17, 2005 2:26 pm
Location: London, UK

Postby joo » Sun Jun 22, 2008 7:21 am

I'd download and use it of two things were changed:

  • The program downloads the new XML data every time it is run, to keep up with changing project parameters.
  • The numbers are given in fields, so values can be copied and pasted AND changing a field updates all the other fields

If the program author doesn't want to make these changes I'll make my own program that does this and share it.

Note: there would be no need for this if my suggestion were implemented.
User avatar
NiKnight
Posts: 791
Joined: Thu Jun 23, 2005 8:32 pm

Postby NiKnight » Sun Jun 22, 2008 8:01 am

Thank for suggestion :)

First: where do you want to store updated data? I think it should be on Cantr server (and updated every change made in machine projects). Disadvantage of this solution is additional lags.

Changing representation of data isn't difficult, i can replace slider by spinner if more people want that. As to other fields and updates, it is necessary to change that? I think setting slider at given position is fast enough and btw you can easier optimize project.
Ni Ni Ni Ni!
User avatar
Tangential
Posts: 958
Joined: Tue Oct 10, 2006 3:51 am

Postby Tangential » Sun Jun 22, 2008 4:09 pm

Toon, maybe describe your process?

It should be fairly easy if you have the tools, so maybe that's the problem. You need winRAR (or some .rar opening software) to be able to open the downloaded file and unzip it. After you do that, you locate the file, open it, and open the jar executable file. You'll be able to open this if you have Java 1.5+. Then you should be set.
User avatar
joo
Posts: 5021
Joined: Fri Jun 17, 2005 2:26 pm
Location: London, UK

Postby joo » Mon Jun 23, 2008 9:30 am

NiKnight wrote:First: where do you want to store updated data? I think it should be on Cantr server (and updated every change made in machine projects). Disadvantage of this solution is additional lags.


The PHP script that marol gave builds an XML file from the cantr database, so you have your solution right there.

NiKnight wrote:Changing representation of data isn't difficult, i can replace slider by spinner if more people want that. As to other fields and updates, it is necessary to change that? I think setting slider at given position is fast enough and btw you can easier optimize project.


If often find myself having to restrict a project based on what resources I have available, and to have this facility automated would stop people from having to then calculate every other resource in the project to see if they have enough of them.

Do you really think that downloading one XML file once per session outwieghs loading wiki pages and switching between the project, manufacturing and objects pages?
User avatar
marol
Posts: 3728
Joined: Sun Jul 17, 2005 11:45 am
Location: Kraków, PL
Contact:

Postby marol » Mon Jun 23, 2008 9:52 am

Joo's suggestion has been already accepted, so I guess this program will become less usable soon.
(SRVPRC)

Image
User avatar
NiKnight
Posts: 791
Joined: Thu Jun 23, 2005 8:32 pm

Postby NiKnight » Sun Jul 06, 2008 8:56 am

New version is available now.

Data is updated from Cantr server via Marol's script.

Every time program is started it loads data to data directory, so even there is no network connection program will be working.

I suggest to set the cantr2projects.data.update property to no when we are sure that data is up-to-date as all data is downloaded from Cantr server.
Ni Ni Ni Ni!

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest