The International Simutrans Forum

 

Author Topic: About pak the vehicle  (Read 4694 times)

0 Members and 1 Guest are viewing this topic.

Offline alexko

  • *
  • Posts: 19
  • Languages: EN,ZH
About pak the vehicle
« on: May 29, 2015, 01:16:14 PM »
When I  follow the step to pak my aircraft into pak file, however, it is not successful. May I ask whether the step is correct or not?

Step 1: use base colour of RGB 231,255,255 with 1024px x 128px
Step 2: draw 8 directions of the aircraft
Step 3: use notepad to enter data and save as .dat file
Step 4: create a new file and copy the .dat file into the new file
Step 5: create new file and copy the aircraft into new file
Step 6: save as .png file in the new file
Step 7: use 128.bat to create pak file

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5493
  • Languages: EN, NO
Re: About pak the vehicle
« Reply #1 on: May 29, 2015, 02:28:40 PM »
Sted 4 and 5 makes no sense to me, although your mention of 128.bat suggest you use some tool that is not part of core Simutrans.

You draw something in a certain way and save it as png, you write some (cryptic) commands in a .dat file in the same directory using a plain text editor of your choice, then you run makeobj (somehow) on the dat file. That's how it works. Other tools may hide these details. I don't know about them.

Offline alexko

  • *
  • Posts: 19
  • Languages: EN,ZH
Re: About pak the vehicle
« Reply #2 on: June 02, 2015, 02:22:57 AM »
Sted 4 and 5 makes no sense to me, although your mention of 128.bat suggest you use some tool that is not part of core Simutrans.

You draw something in a certain way and save it as png, you write some (cryptic) commands in a .dat file in the same directory using a plain text editor of your choice, then you run makeobj (somehow) on the dat file. That's how it works. Other tools may hide these details. I don't know about them.

Would you mind to recommend which software can be used to test whether the pak can be worked or not?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5493
  • Languages: EN, NO
Re: About pak the vehicle
« Reply #3 on: June 02, 2015, 04:58:43 AM »
Would you mind to recommend which software can be used to test whether the pak can be worked or not?

I can't. I don't know of any. All I have used is makeobj, plus the simple (to someone who know such concepts) build system of pak64. They don't test anything, they compile the pak (set) or fail trying.

Offline gauthier

  • Devotee
  • *
  • Posts: 3629
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: About pak the vehicle
« Reply #4 on: June 02, 2015, 09:07:35 AM »
Step 4,5,6: could you explain why are you doing those ?

Could you upload your .dat file and also 128.bat please ?

Offline alexko

  • *
  • Posts: 19
  • Languages: EN,ZH
Re: About pak the vehicle
« Reply #5 on: June 22, 2015, 01:52:08 PM »
Step 4,5,6: could you explain why are you doing those ?

Could you upload your .dat file and also 128.bat please ?

my content of dat file

#Airbus A330-200   
#Passenger intercontinental/continental transport
#-------------------------------------------------------------------------------
obj=vehicle
name=Dragonair_A330
waytype=air
engine_type=diesel
freight=Passagiere
copyright=Alex
payload=250
speed=920
power=23000
weight=120
gear=80
cost=1000000
runningcost=500
intro_year=1900
intro_month=4
sound=5
smoke=-1
Constraint[Prev][0]=none
Constraint[Next][0]=none
EmptyImage[W]=HKA_A330.1.0,-24,-36
EmptyImage[NW]=HKA_A330.1.1,-24,-36
EmptyImage[N]=HKA_A330.1.2,-24,-36
EmptyImage[NE]=HKA_A330.1.3,-24,-36
EmptyImage[E]=HKA_A330.1.4,-24,-36
EmptyImage[SE]=HKA_A330.1.5,-24,-36
EmptyImage=HKA_A330.1.6,-24,-36
EmptyImage[SW]=HKA_A330.1.7,-24,-36



May I ask that would someone could help me to convert the file into pak 128?
« Last Edit: June 24, 2015, 01:22:22 AM by Isaac.Eiland-Hall »

Offline gauthier

  • Devotee
  • *
  • Posts: 3629
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: About pak the vehicle
« Reply #6 on: June 23, 2015, 02:29:01 PM »
Ok now I understand about your private message ... There's no need to send me a message if you put things here. Please avoid double posts too, you can edit your posts.

Your dat file looks right. Could you also copy here your file named "128.bat" along with your source image if possible ?

Offline gauthier

  • Devotee
  • *
  • Posts: 3629
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: About pak the vehicle
« Reply #7 on: June 30, 2015, 09:04:25 AM »
The answer was easy but I did not pay enough attention to the dat file. The problem is in your image references, the first line of the image is 0, not 1, so that could not work. I attached the corrected dat file. Also take care of the image name, it is not the same in the .dat file you wrote.

I also advise you to update your makeobj, and to use 24 bits png (without alpha channel) instead of 32. Latest version of makeobj ignores alpha channel but if you had succeeded with your current version, you would have encountered this problem.

In your .bat file, add a file descriptor redirection to get error messages in a text file at the end of makeobj's execution. This would have told you the error immediatly.
Quote
makeobj pak128 ./ ./ 2>err.txt
Actually you could even just write
Quote
makeobj pak128 2>err.txt

Finally, some graphical advice: you rendered your plane so it faces wrong directions in game. On North-West and South-East (the horizontal ones) views, your plane even looks like leaning dangerously. Also you should notice that in pak128 planes are compiled as pak176 objects so the plane can be bigger. I'm not sure of how to do it but I assume that replacing "pak128" with "pak176" in your command line is enough.

Offline alexko

  • *
  • Posts: 19
  • Languages: EN,ZH
Re: About pak the vehicle
« Reply #8 on: July 15, 2015, 02:05:40 PM »
When I run it, it seems like that.
How to tackle with the issue?
Is it my computer's problem?

p.s: Thanks for gauthier's help. It is difficult to make the plane's pak file.

Offline gauthier

  • Devotee
  • *
  • Posts: 3629
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: About pak the vehicle
« Reply #9 on: July 16, 2015, 07:37:05 AM »
Don't worry, it's always difficult for beginners ;)

Your plane is too high on the source image or has a very bad offset in the .dat file. Check both. Explanation about offset here.

Offline alexko

  • *
  • Posts: 19
  • Languages: EN,ZH
Re: About pak the vehicle
« Reply #10 on: July 31, 2015, 04:17:44 PM »
After the adjustment, it also can't work

p.s: is there some software for me to check whether the content of .dat file is correct or not?
       And Is there some website or aircraft pak files?

Sorry for my mistake because i forgot to upload my file
« Last Edit: August 01, 2015, 04:42:47 PM by alexko »

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2866
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: About pak the vehicle
« Reply #11 on: July 31, 2015, 09:49:42 PM »
The source of many paksets can be found here:
http://sourceforge.net/p/simutrans/code/HEAD/tree/

Offline gauthier

  • Devotee
  • *
  • Posts: 3629
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: About pak the vehicle
« Reply #12 on: August 01, 2015, 02:33:34 AM »
Quote
it also can't work
If you want precise help, you will have to post precise description of your problem. Why can't it work ? Makeobj does not compile ? The plane does not appear in game ? something else ?

I don't know any software to check dat files, just run makeobj and see if there is any error message in the final report (err.txt if you use the commande "makeobj pak128 2>err.txt").

If you look for pak128's planes, they are here.

Offline alexko

  • *
  • Posts: 19
  • Languages: EN,ZH
Re: About pak the vehicle
« Reply #13 on: September 04, 2015, 05:12:45 AM »
Thx for all your help
Got successful for the pak

Next target maybe try to pak A330 of hong kong airlines (more difficult on painting and drawing)

Offline anglababy

  • *
  • Posts: 3
  • Languages: EN
Re: About pak the vehicle
« Reply #14 on: September 08, 2015, 03:20:55 AM »
 :DI think it is helpful!