The International Simutrans Forum

PakSets and Customization => Pak128 => Topic started by: wernieman on September 17, 2008, 09:36:32 AM

Title: PAKMAP
Post by: wernieman on September 17, 2008, 09:36:32 AM
I try to use pykmap.py but .....
Code: [Select]
python pakmak.py
I don´t get a direktory with the PAK-Files ... can somebody help?

In the output is no error-text ...
Title: Re: PAKMAP
Post by: VS on September 17, 2008, 10:20:54 AM
This is what it should write first. Does any of these texts appear?

ps: Copying files takes long...
Title: Re: PAKMAP
Post by: wernieman on September 17, 2008, 10:24:00 AM
It begin with:
Code: [Select]
Image size is set to 128x128
writing invidual files to ./
   reading file ./old_powerplant.dat
   writing file ./factory.old_powerplant_kraftwerk.pak
      packing factory.old_powerplant_kraftwerk
   reading file ./autoshop.dat
   writing file ./factory.autoshop3.pak
      packing factory.autoshop3
   reading file ./factories-wood-128.dat
   writing file ./factory.Nutzwald.pak
      packing factory.Nutzwald
   writing file ./factory.Saegewerk.pak
      packing factory.Saegewerk
   writing file ./factory.Papierfabrik.pak
      packing factory.Papierfabrik
   writing file ./factory.Druckerei.pak
      packing factory.Druckerei
   writing file ./factory.Moebelfabrik.pak
      packing factory.Moebelfabrik
   writing file ./factory.Moebelhaus.pak
      packing factory.Moebelhaus
   reading file ./shaft-coalmine.dat
   writing file ./factory.shaft_coal_mine.pak
      packing factory.shaft_coal_mine
   reading file ./publisher.dat
   writing file ./factory.publisher.pak
      packing factory.publisher
   reading file ./factories-material-128.dat
   writing file ./factory.Stonequarry.pak
      packing factory.Stonequarry
   writing file ./factory.Sandquarry.pak
      packing factory.Sandquarry
   writing file ./factory.Cementmill.pak
      packing factory.Cementmill
   writing file ./factory.Concretefactory.pak
      packing factory.Concretefactory
   writing file ./factory.Materialswholesale.pak
      packing factory.Materialswholesale
   reading file ./factories-ethanol-128.dat
   writing file ./factory.cornfield.pak
      packing factory.cornfield
   writing file ./factory.ethanol_plant.pak
      packing factory.ethanol_plant
   writing file ./factory.modern_fuel_station.pak
      packing factory.modern_fuel_station
   reading file ./wind_tubine.dat
   writing file ./factory.wind_kraftwerk.pak
      packing factory.wind_kraftwerk
   reading file ./factories-food-128.dat
   writing file ./factory.grain_farm.pak

Bevor you ask, the pakmak.tab
Code: [Select]
simutrans@birgit ~/PAK/PAK128 $ cat pakmak.tab
FOLDERS
!factories
!houses commercial
!houses industrial
!houses residental
!special buildings
!vehicles
!citycars
!trees
!base


OPTIONS
size 128
clean yes
# target is always written with /
target simutrans/pak128
# don't write version and Volker Meyer and all that ;-)
cmd /home/simutrans/bin/makeobj QUIET


COMMANDS-BEFORE
delete ${target}
copy pak128.prototype ${target}


COMMANDS-MIDDLE


COMMANDS-AFTER
Title: Re: PAKMAP
Post by: VS on September 17, 2008, 11:27:01 AM
So you don't see anything written from Python? Like, a file with this...
Code: [Select]
print "hello world"
does nothing?
Title: Re: PAKMAP
Post by: wernieman on September 17, 2008, 11:41:18 AM
Code: [Select]
simutrans@birgit ~ $ python test.py
hello world
simutrans@birgit ~ $ cat test.py
print "hello world"

simutrans@birgit ~ $

I hope it help ...
Title: Re: PAKMAP
Post by: VS on September 17, 2008, 11:42:46 AM
But it doesn't write "pakmak.tab found...."?
Title: Re: PAKMAP
Post by: wernieman on September 17, 2008, 11:43:36 AM
When I delete the pakmak.tab, then he write it ....
Title: Re: PAKMAP
Post by: VS on September 17, 2008, 11:46:51 AM
Hm. In pakmak.tab, change "clean yes" to "clean no" - after it runs, are there pak files in source folders? Does folder simutrans/pak128 somewhere?
Title: Re: PAKMAP
Post by: wernieman on September 17, 2008, 12:28:46 PM
After running it ...
Code: [Select]
simutrans@birgit ~/PAK/PAK128 $ find simutrans/pak128/ -name "*.pak"
simutrans/pak128/compatibility/1.0.0/vehicle.AvG_Post_Truck.pak
simutrans/pak128/compatibility/1.0.0/vehicle.Post_Trailer_0.pak
simutrans/pak128/compatibility/1.0.0/vehicle.Post_Trailer_1.pak
simutrans/pak128/compatibility/1.0.0/vehicle.RVg_Type_S_Grain.pak
simutrans/pak128/compatibility/1.0.0/vehicle.moha2100.pak
simutrans/pak128/compatibility/1.0.0/vehicle.Goods_Trailer_4.pak
simutrans/pak128/compatibility/1.0.0/vehicle.PMNV_0-10-0.pak
simutrans/pak128/compatibility/1.0.0/vehicle.PMNV_0-10-1.pak
simutrans/pak128/compatibility/1.0.0/vehicle.CB_476.pak
simutrans/pak128/compatibility/1.0.0/vehicle.LV115_Ford_Mail_Van.pak
simutrans/pak128/compatibility/1.0.0/vehicle.AvG_Goods_Trailer_0.pak
simutrans/pak128/compatibility/1.0.0/vehicle.AvG_Goods_Truck.pak
simutrans/pak128/compatibility/1.0.0/vehicle.Goods_Truck_6.pak
simutrans/pak128/compatibility/1.0.0/vehicle.jiha6010.pak
simutrans/pak128/compatibility/1.0.0/vehicle.Standard_tender.pak
simutrans/pak128/compatibility/1.0.0/vehicle.3Diesellokomotive.pak
simutrans/pak128/compatibility/1.0.0/vehicle.LV116_Ford_Mail_Van.pak
simutrans/pak128/compatibility/1.0.0/vehicle.Road_Horses_0.pak
simutrans/pak128/compatibility/1.2.3/vehicle.PMNV_Plastic_Trailer_0.pak
simutrans/pak128/compatibility/1.2.3/vehicle.Plastic_car_0.pak
simutrans/pak128/compatibility/1.2.3/vehicle.Freighter_Plastic.pak
simutrans/pak128/compatibility/1.2.3/vehicle.Plastic_Truck_0.pak
simutrans/pak128/compatibility/1.2.3/vehicle.Staubkesselwagen.pak
simutrans/pak128/compatibility/1.2.3/vehicle.RVg-LK_Plastic_Truck.pak
simutrans/pak128/compatibility/1.2.3/vehicle.PMNV_Mack_Plastic_Trailer_L.pak
simutrans/pak128/compatibility/1.2.3/vehicle.PMNV_Mack_Plastic_Trailer_S.pak
simutrans/pak128/compatibility/1.2.9/building.BigTerminal1950_AirportBlg_E.pak
simutrans/pak128/compatibility/1.2.9/building.BigTerminal1950_AirportBlg_S.pak
simutrans/pak128/compatibility/1.2.9/building.Terminal1950_AirportBlg_E.pak
simutrans/pak128/compatibility/1.2.9/building.Terminal1950_AirportBlg_S.pak
simutrans/pak128/compatibility/1.2.9/building.BigTerminal1930_AirportBlg_E.pak
simutrans/pak128/compatibility/1.2.9/building.BigTerminal1930_AirportBlg_S.pak
simutrans/pak128/compatibility/1.2.9/building.Terminal1930_AirportBlg_E.pak
simutrans/pak128/compatibility/1.2.9/building.Terminal1930_AirportBlg_S.pak
simutrans/pak128/compatibility/1.2.9/building.LuftPost1950_AirportBlg_NS.pak
simutrans/pak128/compatibility/1.2.9/building.LuftPost1950_AirportBlg_OW.pak
simutrans/pak128/compatibility/1.4.3/factory.Stahlwerk.pak
simutrans/pak128/compatibility/1.4.3/factory.Kohlegrube.pak

Code: [Select]
simutrans@birgit ~/PAK/PAK128 $ find . -name "*.pak" | less
./home/simutrans/PAK/PAK128/simutrans/pak128/factories.all.pak
./!base/good.canned_food.pak
./!base/home/simutrans/PAK/PAK128/!trees/dat/home/simutrans/PAK/PAK128/simutrans/pak128/building.hq.all.pak
./!base/good.cotton.pak
./!base/schwebebahn_all/dat/building.MonorailDepot.pak
./!base/schwebebahn_all/dat/home/simutrans/PAK/PAK128/!trees/dat/home/simutrans/PAK/PAK128/simutrans/pak128/symbol.BigLogo.pak
./!base/schwebebahn_all/dat/home/simutrans/PAK/PAK128/!trees/dat/home/simutrans/PAK/PAK128/simutrans/pak128/GUI.128.pak
./!base/schwebebahn_all/dat/way.Schwebebahn_p_ground.pak
./!base/schwebebahn_all/dat/building.Suspended_Monorail_Bahnhof_Modern.pak
./!base/schwebebahn_all/dat/roadsign.choose_signal_monorail.pak
./!base/schwebebahn_all/dat/building.MonorailGround.pak
./!base/schwebebahn_all/dat/building.MonorailFoundation.pak
./!base/schwebebahn_all/dat/roadsign.preSignal_Monorail.pak
./!base/schwebebahn_all/dat/bridge.Schwebebahn_p_bridge.pak
./!base/schwebebahn_all/dat/way.Suspended_Monorail_Track.pak
./!base/schwebebahn_all/dat/schwebebahn.all.pak
./!base/schwebebahn_all/dat/building.MonorailStation.pak
./!base/schwebebahn_all/dat/roadsign.Signal_Monorail.pak
./!base/good.Bucher.pak
./!base/road_signs/dat/home/simutrans/PAK/PAK128/!trees/dat/home/simutrans/PAK/Plines 1-20
.......

So the pakmak have a problem with the copy
Title: Re: PAKMAP
Post by: wernieman on September 18, 2008, 10:54:33 AM
Sorry for the pushing but ....

can you help?
Title: Re: PAKMAP
Post by: VS on September 18, 2008, 11:19:42 AM
Test: in archive are 2 scripts and test folder "a" with files. Test1 copies it to "aa" - test2 again removes "aa". Please try if it is copied and then removed complete.

Structure of "a":

a - 1
   - 2
   - b - 3
        - 4
        - c - 5
             - 6
Title: Re: PAKMAP
Post by: wernieman on September 18, 2008, 12:11:05 PM
No Problem .. it work well ...
Title: Re: PAKMAP
Post by: VS on September 18, 2008, 12:30:09 PM
Hmmmm... then it must be something about relative paths?
Title: Re: PAKMAP
Post by: wernieman on September 18, 2008, 12:54:10 PM
The python work .. becouse the gentoo-emerge-tool is written in python ...

relative paths ... I htink that is the Problem. But .... where do you use it?

P.S: can you make a variable in pakmak.tab for the destination?
Title: Re: PAKMAP
Post by: VS on September 18, 2008, 01:32:10 PM
Variable, as in, take variable from parameter, or?

because there is line

"target simutrans/pak128"

and later you can use ${target}, like

delete ${target}
copy pak128.prototype ${target}

I used the same syntax as in the shell script...
Title: Re: PAKMAP
Post by: wernieman on September 18, 2008, 02:24:54 PM
Do you use it on a windows Maschine?

I make a new test with a fix Direktroy ..

like "/home/simutrans/test"

Edit:
Don´t look good:
target /home/simutrans/simutrans/pak128

Code: [Select]
simutrans@birgit ~/PAK/PAK128 $ python pakmak.py
pakmak.tab found in "/home/simutrans/PAK/PAK128", processing...
delete /home/simutrans/PAK/PAK128/home/simutrans/simutrans/pak128
Title: Re: PAKMAP
Post by: VS on September 18, 2008, 02:32:31 PM
Yes, I have only windows...

The target folder is deleted first because it's easier to rid of old data that way.

Can you please redirect output from python and attach that file?
Title: Re: PAKMAP
Post by: wernieman on September 18, 2008, 02:44:08 PM
No Problem ....

But ... when I set the folger to "/home/....." with a begin "/", it is an absolut paths and not a relative, but why he look at /home/simutrans/PAK/PAK128/home/simutrans/simutrans/pak128

Edit:
No Problem in 15 Minute .... ;o)
Title: Re: PAKMAP
Post by: VS on September 18, 2008, 02:48:51 PM
Ah, now that's better for diagnosis!

PS: you can remove some folders from pakmak.tab and make it faster :) Does it really take 15 minutes?
Title: Re: PAKMAP
Post by: wernieman on September 18, 2008, 02:59:17 PM
I must start it on the Server, then download it to my workstation and uploaded it ..... ;o)

http://www.wernieman.de/pak.zip (http://www.wernieman.de/pak.zip)

Edit:
The Programm create a /home/simutrans/simutrans/pak128/

It is creasy ... I think I must learn python...
Title: Re: PAKMAP
Post by: VS on September 18, 2008, 03:27:48 PM
I see... yes, crazy.

I think the problem may be in Python library, in functions that make absolute path and check if it is absolute... please try the attached script.

EDIT: or I use them wrong :(

---

Shell is asynchronous in unix or what? Makeobj writes first, then python? And there are some letters missing... reminds me of telnet
Title: Re: PAKMAP
Post by: wernieman on September 18, 2008, 04:34:16 PM
Code: [Select]
simutrans@birgit ~/test $ python test3.py
current folder: /home/simutrans/test
test path: test/test
abspath for test path: /home/simutrans/test/test/test
test path: /home/test/test
abspath for test path: /home/test/test
Title: Re: PAKMAP
Post by: VS on September 18, 2008, 08:26:50 PM
So the error is on my side.
Title: Re: PAKMAP
Post by: wernieman on September 18, 2008, 09:02:27 PM
O.K. ... I test it tomorow....

when it will be O.K. then I use it to make the PAK (and delete the "arbeite.sh" script)
Title: Re: PAKMAP
Post by: VS on September 18, 2008, 09:03:46 PM
Yes :) I am sorry... I will write here when it can be tested again.
Title: Re: PAKMAP
Post by: wernieman on September 19, 2008, 06:21:56 AM
There is a problem in your script with the direktroy change on unix ...

I found some:
!base/misc_GUI/dat/home/simutrans/PAK/PAK128/!trees/dat/home/simutrans/PAK/PAK128/simutrans/pak128/GUI.64.pak

I don´t think, that this is the right path ...

With the compat pak files it work well ....

The log files (and the destination direktory):
http://www.wernieman.de/pak.zip (http://www.wernieman.de/pak.zip)
Title: Re: PAKMAP
Post by: VS on September 19, 2008, 03:29:38 PM
I will install some virtual machine and linux...

---

Hello world from my first Linux! Well, not really first, I had some single floppy distro a few years back ;D

I am running pakmak.py on Ubuntu 8 with Python 2.5.2 and makeobj 49... and IT WORKS with the fix committed in r137.

Your turn! :)
Title: Re: PAKMAP
Post by: wernieman on September 20, 2008, 08:35:56 AM
I must look ... but I don't know if I have time at weekend ... ;o)
Title: Re: PAKMAP
Post by: VS on September 20, 2008, 08:43:38 AM
Monday then... No need to hurry.
Title: Re: PAKMAP
Post by: wernieman on September 20, 2008, 09:58:53 AM
It look good....

But I use it productive on Monday .. then I kill the "arbeite.sh" in the svn ...