• Welcome to SC4 Devotion Forum Archives.
 

News:

The SC4 Devotion Forums are no longer active, but remain online in an archived, read-only "museum" state.  It is not possible for regular members to post or use the private messaging system, and no technical support will be provided for any issues pertaining to the forums in their current state.  Attachments (those that still work) are accessible without login.

The LEX has been replaced with SC4Evermore (SC4E), and SC4E maintains an active Discord server.  For traditional forums, we recommend Simtropolis.

Main Menu

NAM tool public BETA to download here

Started by GoaSkin, December 06, 2008, 05:49:15 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Pat

#20
Well Goaskin I tried even the new folder option and that didnt work at all it just went back into the infinate loop... As far as the NAM folder I dont know where I burried that folder to test it...

EDIT: found it and tried again... No luck still a endless loop of wanting to find the folder...

Don't forget the SC4D Podcast is back and live on Saturdays @ 12 noon CST!! -- The Podcast soon to Return Here Linkie

GoaSkin

So there may be a windows-specific bug. On Mac, the function breaks if you click cancel and runs again when trying to export or read the documentation as lang as the location isn't saved. The function shall accept the folder if there is a file 'networkaddonmod1.dat' (the real file name of it).

I will reboot now and test it out.
download SC4Config public BETA (RC1)

sithlrd98

I'm not sure why Pat is having problems...It tried to "loop" on me last night, but I just pointed it to the main folder of my NAM and it works.


Jayson

GoaSkin

I also tested it and also wasn't able to reproduce it.

The test function has the following work processes:

1.) it looks in the folder where namconfig.exe is for a file namconfig.conf. If so, it reads out it contents (the nam path)
2.) it tests if this path does exist
3.) it looks in this folder for the networkaddon DATs.

If one or more of this steps fail:
4.) it opens a dialog to ask for the NAM dir and repeats steps 2 and 3 until successful.
5.) it scans for a list of opsolete files and asks what to do with it
6.) it returns the NAM dir and saves the namconfig.conf containing the path

The function is called whenever the NAM path is requested. All these steps normally require only once an interaction and never again - until the NAM location has been moved or the namconfig.conf deleted


The problem may be:
- the checked file (NetworkAddonMod1.dat) has been renamed or does not exist because the NAM version is too old
- saving namconfig.conf fails because there is no write permission on the folder

Because there may be any bug I don't see, I post you the code of the function. Maybe anybody else will see any thing that may fail but also may not fail:


// test if the NAM is set up well to use this program
QString SC4C::getNamDir()
{
QString check;
QFile config("namconfig.conf");
QDir appDir=QDir::current();
QDir namDir;
bool needsSetup=false;
if(QFile::exists("namconfig.conf")==false)
needsSetup=true;
if(needsSetup==false)
{
config.open(QIODevice::ReadOnly | QIODevice::Text);
QTextStream data(&config);
namDir = data.readAll();
config.close();
if(!namDir.exists())
needsSetup=true;
else
QDir::setCurrent(namDir.path());
}
if(needsSetup==false)
if(!(QFile::exists("NetworkAddonMod1.dat")))
needsSetup=true;
if(needsSetup==true)
do
{
QMessageBox::warning(this, tr("NAM directory"), tr("The program could not recognize the folder of your <I>Network Addon MOD</I> installation. Click OK to select the NAM folder now!"));
namDir=QFileDialog::getExistingDirectory(this, tr("select the NAM folder"),appDir.path(),QFileDialog::ShowDirsOnly);
QDir::setCurrent(namDir.path());
QMessageBox::warning(this, tr("NAM directory"), QDir::current().path());
}
while(!(QFile::exists("NetworkAddonMod1.dat")));
QDir::setCurrent(appDir.path());
config.open(QIODevice::WriteOnly);
QByteArray data;
data.append(namDir.path());
config.write(data);
config.close();
// test now if there are some files to delete or to move
check=namDir.path();
check.append("/Automata Controller");
removePlugins(tr("Automata Controllers"),check);
check=namDir.path();
check.append("/Traffic Controller");
removePlugins(tr("Traffic Controllers"),check);
check=namDir.path();
check.append("/Plugins/NetworkAddonMod_Custom_Highway_Menu_Plugin_Optional.dat");
removePlugins(tr("Custom Highway Menu"),check);
check=namDir.path();
check.append("/Plugins/NetworkAddonMod_Custom_Misc_Transport_Menu_Plugin_Optional.dat");
removePlugins(tr("Custom Misc Transport Menu"),check);
check=namDir.path();
check.append("/Plugins/NetworkAddonMod_Custom_Rail_Menu_Plugin_Optional.dat");
removePlugins(tr("Custom Rail Menu"),check);
check=namDir.path();
check.append("/Plugins/NetworkAddonMod_Rail_Viaduct_Style_Red.dat");
removePlugins(tr("Red Railroad Viaducts"),check);
check=namDir.path();
check.append("/Plugins/NetworkAddonMod_Rail_Viaduct_Style_Brown.dat");
removePlugins(tr("Brown Railroad Viaducts"),check);
return namDir.path();
}


Forget the addition message boxes! I added them to check myself some variables while testing.
download SC4Config public BETA (RC1)

j-dub

I don't know what the problem is at hand, but after trying the tool out on my Vista, it seems like a fairly simple interface, but don't know if it saved custom changes, or what your suppose to save. It did find some files to remove. Before this tool, I didn't know I could choose other tunnels.

wouanagaine

from your code, either the current directory is not set correctly for whatever reasons, or Pat doesn't have the "NetworkAddonMod1.dat"
I'm also wondering if the QFile::exists("NetworkAddonMod1.dat") is working on current dir or if you should better concat the Namdir + "\NetworkAddonMod1.dat"


New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

GoaSkin

While my tests, QFile::exists did not like full paths but only a single file name. It was always based on the path that has been set before.

d-jub: The custom content is saved into a file called NetworkAddonMod_Configuration.dat located in a newly created subdirectory "configuration" in the NAM folder. For that, you need to commit the change. The save button only saves the dialog settings into an XML file to be re-imported if needed.
download SC4Config public BETA (RC1)

sithlrd98

#27
I just changed the .conf file to a .txt to see where it was looking for the NAM :
C:/Documents and Settings/Jayson/My Documents/SimCity 4/Plugins/Network Addon Mod

Not sure if that helps , but it still works (as far as I can tell) fine for me.

Also , if it helps ...after you navigate to the Network Addon folder , you must select the folder , not just have it pointing to it . (does that explanation make any sense?)


Jayson

GoaSkin

Is there anything to alter on the english version? (bad vocabulary etc.)?
download SC4Config public BETA (RC1)

sithlrd98

None that I have seen...program works fine (once you get it to find the NAM). Creates a configuration folder with a .dat , haven't experienced any issues with gameplay. Great job!

Jayson

GoaSkin

For all who don't already have downloaded the tool: here is a new download link.

This version has a slightly modified GUI. The banner, the icon should fit now in the dialog. If there is nothing to modify on the english version, I will start with foreign language projects.
download SC4Config public BETA (RC1)

GoaSkin

I need some translators to support foreign languages, especially french and japanese but also any other possible foreign language. Please leave me a message if you want to translate text phrases in an XML file (about 100 phrases)!

German version exists, spanish version is half-finished and needs a native speaker. Other translations do not exist yet

download SC4Config public BETA (RC1)

plunderer

#32
I can translate into the Chinese, if you need...

by the way, the namconfig "tunnal and slope MOD" generated  "Placement Tuning Parametersfiles" exemplars of Elevated network will result in in-game Pylon of Elevated network (Elevated Rail, highway, monorail) disappear



GoaSkin

OK... thanks for the advice. We have to check the reason why...

To translate into chinese, it may be better to use the QT linguist (www.trolltech.com) because translating a XML file directly may result in encoding errors. I will attach a clean locale file for chinese.
download SC4Config public BETA (RC1)

plunderer

I've been translated into the simplified Chinese(if no problem, I'll add the traditional Chinese)
some proper noun I think shouldn't be translate, and if has any missing, let me know

P.S
in your attachment I didn't found the <message> section about button in quit dialog,


CasperVg

I'll do the Dutch translations, if you wish.
Follow my SimCity 4 Let's play on YouTube

GoaSkin

#36
Thanks for the translation...

The quit messages are standard messages and do not require translations. The operating system does it but it requires that the language itself is enabled. The program maps everything to english actually what is unsupported. When I apply the chinese translation, the quit dialog will also appear in chinese.

I added a prototype file for dutch to this posting.

When translating, please do not replace the source tag and put the translated text into the translation tag. I had to fix the chinese (succeeded now).

Edit: chinese version works fine now but for a strange reason I managed it that the program uses chinese as default if there is no translation for a specific locale.

What locale settings shall point to chinese? Do I have to use different locales for Taiwan and China? Beside, I found as system translation archives also zh_CN and zh_TW.


download SC4Config public BETA (RC1)

plunderer

Quote from: GoaSkin on December 19, 2008, 08:59:38 AM
Thanks for the translation...

The quit messages are standard messages and do not require translations. The operating system does it but it requires that the language itself is enabled. The program maps everything to english actually what is unsupported. When I apply the chinese translation, the quit dialog will also appear in chinese.

I added a prototype file for dutch to this posting.

When translating, please do not replace the source tag and put the translated text into the translation tag. I had to fix the chinese (succeeded now).

well, I'll attach the traditional Chinese tomorrow

GoaSkin

It's only necessary if anybody does not understand simplified chinese. The translation works fine and the dialogs are also translated.


download SC4Config public BETA (RC1)

plunderer

Quote from: GoaSkin on December 19, 2008, 10:13:08 AM
It's only necessary if anybody does not understand simplified chinese. The translation works fine and the dialogs are also translated.



in you posted image, the "tunnel and slope MOD" should appear "隧道与坡度 MOD"
but I checked the translated file, nothing wrong.... ()what()