Coding Troubles, Test GRF of the train has been released
Moderator: Graphics Moderators
Coding Troubles, Test GRF of the train has been released
Alright i read the .nfo coding tutorials and i tried to code a vehicle i had drawn, but i hit a snag.
after i encoded the file, TTDPatch says the file has more sprites than specified.. But i have 1 set of sprites that consists of 8 sprites, and so is specified in the nfo file(ignore the offsets for now, i haven't touched them yeat).
What exactly is wrong with the code, besides the obivius wrong offsets?
[EDIT]See http://www.tt-forums.net/viewtopic.php?p=388922#388922 for the GRF.
after i encoded the file, TTDPatch says the file has more sprites than specified.. But i have 1 set of sprites that consists of 8 sprites, and so is specified in the nfo file(ignore the offsets for now, i haven't touched them yeat).
What exactly is wrong with the code, besides the obivius wrong offsets?
[EDIT]See http://www.tt-forums.net/viewtopic.php?p=388922#388922 for the GRF.
- Attachments
-
- 2te10u.zip
- the pcx file & nfo
- (2.19 KiB) Downloaded 118 times
Last edited by Villem on 30 Dec 2005 17:01, edited 1 time in total.
success then? screenies!
James

James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
First view with correct offsets, though the train is going the wrong way..
and i still need to make it doubleheaded..
The Train is the Russian 2TE10U(usually its doubleheaded but the 2 head's can be seperated). Its quite a monster at pulling heavy freight trains.
[edit] im gona proceed and bang my head on the table cause i don't get what is wrong with my speed & power action 0's, but according to nforenum and ttdpatch theres something wrong with them
//!!Warning (99): Offset 8: No more data was expected.
14 * 11 00 00 01 01 13 09 31 30 30 12 FD
//!!Warning (99): Offset 8: No more data was expected.
15 * 12 00 00 01 01 13 0B 35 39 30 30 12 FD
and i still need to make it doubleheaded..
The Train is the Russian 2TE10U(usually its doubleheaded but the 2 head's can be seperated). Its quite a monster at pulling heavy freight trains.

[edit] im gona proceed and bang my head on the table cause i don't get what is wrong with my speed & power action 0's, but according to nforenum and ttdpatch theres something wrong with them
//!!Warning (99): Offset 8: No more data was expected.
14 * 11 00 00 01 01 13 09 31 30 30 12 FD
//!!Warning (99): Offset 8: No more data was expected.
15 * 12 00 00 01 01 13 0B 35 39 30 30 12 FD
- Attachments
-
- Image1.png (1.77 KiB) Viewed 4038 times
Why make it complicated ...
a) change all properties for 1 vehicle in the same sprite :
b) now what else was wrong :
. there is no property 30, at least until today.
. power is a word, i.e. it is 2 bytes long, unless that 30 30 was that new property.
a) change all properties for 1 vehicle in the same sprite :
Code: Select all
-1 * 11 00 00 03 01 13 09 31 0B 35 39 12 FD
. there is no property 30, at least until today.
. power is a word, i.e. it is 2 bytes long, unless that 30 30 was that new property.
Last edited by OzTrans on 29 Dec 2005 22:09, edited 1 time in total.
Well, 100 km/h is 64h and 5900 hp is 0Ch 17h (in little endian).
If you want to define those properties seperately, that's ok; but now your code should then look as follows :
Just keep going and you'll soon get the hang of it.
EDIT: corrected that property 09 code.
If you want to define those properties seperately, that's ok; but now your code should then look as follows :
Code: Select all
-1 * 7 00 00 01 01 13 12 FD
-1 * 8 00 00 01 01 13 09 64 00
-1 * 8 00 00 01 01 13 0B 0C 17
EDIT: corrected that property 09 code.
Last edited by OzTrans on 29 Dec 2005 22:41, edited 1 time in total.
ah so, str2hex gives incorrect numbers, thanks for the help. ![Pleased :]](./images/smilies/pleased.gif)
but nforenum doesn't like that you gave only 64 for the value in speed, it would want 1 more byte set(so i added 00 after it and it accepted it and values are right ingame)..
![Pleased :]](./images/smilies/pleased.gif)
but nforenum doesn't like that you gave only 64 for the value in speed, it would want 1 more byte set(so i added 00 after it and it accepted it and values are right ingame)..
Last edited by Villem on 30 Dec 2005 11:07, edited 1 time in total.
Alright i want to make the train multihead by default, but i can't find the wiki page in ttdpatch wiki that tells about coding multihead trains.
Also i tried implementing the misc.switch that makes the train 2 company coloured, but after i added it what i think was correct it still wasn't 2 cc(and i had drawn in the proper 2cc colour too).
Also i tried implementing the misc.switch that makes the train 2 company coloured, but after i added it what i think was correct it still wasn't 2 cc(and i had drawn in the proper 2cc colour too).
Code: Select all
15 * 12 00 00 02 01 13 0B 0C 17 02 00
You should get NFORenum (see DaleStan's sig for a link) to check your NFO files.
Broken down, your sprite does this:
00 = action 0
00 = feature 0 (trains)
02 = two properties are set
01 = for one vehicle
13 = vehicle ID 13
0B = property 0B, power
0C 17 = power value, 170C hex = 5900 HP
02 = property 02, reliability decay speed
00 = no reliability decay
Instead of setting property 02 to 00, you probably want to set property 27 (misc flags) to 02 (bit 1 set = uses 2CC). And to make it multiheaded, set property 13 to 01.
Broken down, your sprite does this:
00 = action 0
00 = feature 0 (trains)
02 = two properties are set
01 = for one vehicle
13 = vehicle ID 13
0B = property 0B, power
0C 17 = power value, 170C hex = 5900 HP
02 = property 02, reliability decay speed
00 = no reliability decay
Instead of setting property 02 to 00, you probably want to set property 27 (misc flags) to 02 (bit 1 set = uses 2CC). And to make it multiheaded, set property 13 to 01.
Alright, with most(i hope)of the bugs squished, i need some help to squish out the remaining of them.
Thus i release the GRF, note the intorduction date is not correct, i have not yeat changed it. it should come out at 1958-1959 range, Arctics/Tropics only.
Known Bugs However Are:
1). The Train clips with its name in the depot buylist, i have no idea how to fix it thus far.
2). The Train clips with TTD's wagons in the buylist & ingame, and TTD wagons generally look out of place with it. i will try to fix this in near future.
And these are the following persons who i want to thank for helping me code this grf, and teaching me how to draw the train in it.
Patchman, the one who helped me to make this train multihead and use 2 company colour support.
Pikkabird, pointed me to nforenum that got me to my first beta.
Flamelord, he was right afterall, the lines did change more than 1 property!
OzTransLtd, helped me to get the power & speed action0's to work.
Purno, without your drawing tutorials that train would not have graphics.
DaleStan, without your nforenum tool this grf would not be here.
eis_os, your ingame sprite aligning tool was invaluable, without it, this grf probably would not be here.
and those who made all that nfo coding info at the ttdpatch wiki avaible, you provided my first steps to nfo.
Thus i release the GRF, note the intorduction date is not correct, i have not yeat changed it. it should come out at 1958-1959 range, Arctics/Tropics only.
Known Bugs However Are:
1). The Train clips with its name in the depot buylist, i have no idea how to fix it thus far.
2). The Train clips with TTD's wagons in the buylist & ingame, and TTD wagons generally look out of place with it. i will try to fix this in near future.
And these are the following persons who i want to thank for helping me code this grf, and teaching me how to draw the train in it.
Patchman, the one who helped me to make this train multihead and use 2 company colour support.
Pikkabird, pointed me to nforenum that got me to my first beta.
Flamelord, he was right afterall, the lines did change more than 1 property!
OzTransLtd, helped me to get the power & speed action0's to work.
Purno, without your drawing tutorials that train would not have graphics.
DaleStan, without your nforenum tool this grf would not be here.
eis_os, your ingame sprite aligning tool was invaluable, without it, this grf probably would not be here.
and those who made all that nfo coding info at the ttdpatch wiki avaible, you provided my first steps to nfo.
- Attachments
-
- 2te10u.grf
- Please use Alpha 69 when using this grf. 2 Company Colours are supported.
- (1.66 KiB) Downloaded 117 times
It is somewhat a dangerous practice to only define a few vehicle properties; whatever you have not defined will be copied from a vehicle with the same ID as yours from another trainset that happens to be activated; thus giving you unpredictable results. As far as alignment goes, you need to further work on that. Best is to put some box cars between the 2 heads and make adjustments against their alignment.
In the purchase list, there is only room for about 56 pixels; in order to make your engine fit, you need to provide another set of sprites with shorter horizontal views (cut out 4 pixel columns each) and then reference that in action-3 as follows (you'll need another action-2, of course) :
xx = the set ID, probably 01 in your case.
BTW, FF is the cargo ID for the purchase list entry.
In the purchase list, there is only room for about 56 pixels; in order to make your engine fit, you need to provide another set of sprites with shorter horizontal views (cut out 4 pixel columns each) and then reference that in action-3 as follows (you'll need another action-2, of course) :
Code: Select all
12 * 10 03 00 01 13 01 FF xx 00 00 00
BTW, FF is the cargo ID for the purchase list entry.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 16 guests