Page 14 of 42

Posted: 21 Apr 2005 04:21
by Wile E. Coyote
Not working again! :( I have in action 0 for short wagons properties 21 02 1E 02 (and in loco's action 0 property 1E 02), and normal actions 2 and 3. Are more actions 2 or 3 needed for wagons? Or maybe something not needed? :?:

Posted: 21 Apr 2005 05:03
by DaleStan
I just tested it on the Baat, and it worked fine for me.
Unless NFORenum can figure out what's wrong with it, you'll have to post everything.

I changed the Baat's Action0 to:
*26 00 00 0A 01 1B 00 00 00 06 07 05 00 14 34 15 00 16 0F 17 02 12 FD 21 02 1E 02
and just copy/pasted the pseudo-sprites I posted, replacing all the action 2s and 3s in sinobus.grf, with the one exception that the first action2 is 9 bytes long, not 10.

Posted: 21 Apr 2005 07:21
by Wile E. Coyote
What patch you use?

Posted: 21 Apr 2005 07:22
by DaleStan
Alpha 48

Posted: 22 Apr 2005 04:10
by Wile E. Coyote
And which settings? If you post your ttdpatch.cfg? (Because still not working good to me)

Posted: 22 Apr 2005 04:59
by DaleStan
Here's ttdpatch.cfg, though the only line that should make any difference is "newtrains on".

Did NFORenum find any problems in your GRF? Did your GRF find any problems in NFORenum? Did you fix the problems in your GRF file? Does it still not work?

Can you just post the GRF that isn't working? (The whole thing, including all wagons, and an ID list.)

Posted: 22 Apr 2005 21:19
by Wile E. Coyote
Here are: sinobus's grf, wagons grf (corrected with your suggestions) and ttdpatch.cfg. It still don't works good :(

Posted: 22 Apr 2005 21:53
by Lakie
I'll take a look at it sometime too.
Just to see if what I recommended worked ;)

Although, it'll be a while before I can test it...

[edit] DaleStan Beat me to saying it, but it is because you refered to the wrong action2 id in the override :)

~ Lakie

Posted: 22 Apr 2005 22:06
by DaleStan
Sprite 12 in Sinobus[w].NFO needs to look like *this*:

Code: Select all

12*19 03 00 8D 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 00 01 00
Note that the second to last byte is an 01, not the 00 that you have.

This is minor, but you're reliably listing one sprite too many in your sprite 0. Start counting sprites from sprite 1, not sprite 0.

Posted: 22 Apr 2005 22:31
by Wile E. Coyote
YES, THAT'S IT! Now it works! Thanx and welcome to team! :D Could you tell me what is this error?
Lakie: Did you solved errors in EMU's GRF I sent you?

Posted: 22 Apr 2005 23:21
by DaleStan
With the 00, the Var.02 on variable 0C (sprite 12) never gets used, so the callback for wagon length, although called, does not return a result. TTDPatch falls back to the corresponding property, and, as a result, you get 5/8 length instead of the 8/8 length you wanted.

Posted: 23 Apr 2005 10:53
by Lakie
Wile E. Coyote wrote:Could you tell me what is this error?
Since you never refered to the callback action2 to change the length of the wagon, the length of the wagons remained the same.
Wile E. Coyote wrote:Lakie: Did you solved errors in EMU's GRF I sent you?
No, Sorry.

I'm been busy with revision for the up coming exams.
I'll take a look at it this weekend.

~ Lakie

Posted: 23 Apr 2005 12:07
by Wile E. Coyote
Thanx everybody for help, suggestions and explanations! :D New versions of wagons and locos (including 'Sinobus') is uploaded. Now I have problems to code Purno's great MUs sprites. Here iz 'Beovoz' GRF with following errors:
1. I obtain two front engines, not front and rear.
2. I don't know how to insert callbacks for Baat and Daa.
Thanx!

Posted: 23 Apr 2005 12:36
by Lakie
Well, I believe since you got multihead = 1 (action0 property 13, value 01)

if so you will have to change lines 33-47 to this.

Code: Select all

// Offset of 08 FF to make it count from the last vehicle in the train
// Although, if the wagons do not appear inside you will get the same bug.
   33 * 14	 02 00 1A 81 40 08 FF 01 02 00 00 00 00 00
// Callback to avoid problems with the wrong length wagons.
// Basicly the same one as before, just refers to the carrage graphic now.
   34 * 14	 02 00 1B 81 0C 00 FF 01 00 FF 11 11 01 00
// Just changed it to refer to the action2 id above
   35 * 7	 03 00 01 37 00 1A 00
// Grouped all the override action3's, also refered them to the callback.
   36 * 18	 03 00 8D 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 00 1B 00
That the train head graphics should come out correctly.
I believe there might be a problem in the buy list though.

[edit #1] don't forget to change the sprite count at the start of the grf ;)

[edit #2]Another method would be to make the last wagon always the end engine graphic. (like the emu680)

You would have to change Action0 property 13 (multihead) to a value of 00 (No) to get this method to work.
then you would have to change lines 33-47 to this.

Code: Select all

// Offset of 08 FF to make it count from the last vehicle in the train
// If it's not the last vehicle it will be the wagon override graphics
   33 * 14	 02 00 1A 81 40 08 FF 01 02 00 00 00 01 00
// Callback to avoid problems with the wrong length wagons.
// Refers to the above action2 id
   34 * 14	 02 00 1B 81 0C 00 FF 01 00 FF 11 11 1A 00
   35 * 7	 03 00 01 37 00 00 00
// Grouped all the override action3's, also refered them to the callback.
   36 * 18	 03 00 8D 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 00 1B 00
Hope That helps,
~ Lakie

Posted: 23 Apr 2005 17:09
by Wile E. Coyote
Great! :D Thanx, Lakie! One little thing: now in purchase list are both rear engines. How to fix that?

Posted: 23 Apr 2005 17:29
by Lakie
Thats something I thought might happern, honest answer I don't know.
I normally use the second method. ;)

Sorry,
~ Lakie

Posted: 23 Apr 2005 21:48
by Wile E. Coyote
Never mind, it works good anyway. (There are more little things to fix - for example, prices). I uploaded new version with two Purno's MUs coded by Lakie and little by me. Try and post your opinions, suggestions and bugs you found! Thanx!

Posted: 24 Apr 2005 16:21
by Wile E. Coyote
Please help me again! I'm trying to code a steamer. I don't know how to get loco and tender together. I coded them separately in 2 IDs. Is it neceserry? Here's GRF. Thanx!

Posted: 25 Apr 2005 04:05
by DaleStan
Wile E. Coyote wrote:I coded [the loco and tender] separately in 2 IDs. Is it neceserry?
It's common to use one ID for all tenders, but I'm not convinced it's necessary to have a tender ID at all. I think you should be able to use var. 41 to return the correct graphics/lengths/&c. for the different parts. I won't give out advice on how that might work until I have a chance to test it. Oracle, do you want to chime in here?

Clicky
I see several problems:
- The engine's action 0 does not have bit 4 of prop 1E set.
- The tender's action 3 needs to be a livery override action 3.
- You'll need at least one Var.02 that checks variable 0C[0]
- You'll need at least one Var.02 that checks variable 10

[0] You'll need two if your tenders aren't all the same length, one in the tender's chain and one in the engine's chain.

Posted: 25 Apr 2005 17:12
by Wile E. Coyote
Still got no point how to do that, I just know to code simple things. If you can code it, please? I changed tender's ID (if it's necesserry for tender to have separate ID). Thanx!
(BTW, there is only one steamer drawn now, so I don't know for future steamers length of their tenders.)