Hargs' Articulation Woes

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

User avatar
hargs
Traffic Manager
Traffic Manager
Posts: 129
Joined: 13 Feb 2012 23:19
Location: Manchester. UK.

Re: Hargs' Articulation Woes

Post by hargs »

Right everything seems to be sorted from this round of questions, thanks again for the help.

Oh and here’s the code vehicle as it stands right now for any one who might find it helpful, doubtful but you never know.

Code: Select all

//----------------------------------------------------------
// E231-Kinkou Type (5 Car)
//----------------------------------------------------------
  715 * 79	 00 00 20 01 A4 //As far as vehicle ID
			00 7C 77	// First property to change 00 date of introduction days after 1920 read 7D 78 hex (30660)
			02 05		// reliability decay speed
			03 28 		// Vehicle life in years (40)
			04 FF 		// Model life in years FF (255) always?
			05 00 		// track type
			06 03 		// Cimate availablility
			07 \b16 		// Load speed (16) [16 units every 40 ticks] *Unused set by callback
			08 01 		// AI thing
			09 78 00 	// Speed 120
			0B FC 03	// Power 1020
			0D 3B 		// Running cost factor
			0E 3C 4C 00 00	// Running cost base
			12 FD 		// Sprite ID FD= new grf
			13 00 		// dual head flag
			14 96 		// Cargo capacity *Unused set by callback
			15 00 		// cargo type (00 passengers)
			16 87 		// Weight (135)
			17 21 		// Cost factor
			18 00 		// Engine rank AI thing ttd
			19 31 		// traction type 
			1A 1B 		// sort purchase list?
			1B 00 00 	// power added by each wagon
			1C 00 		// Refit cost
			1D 01 00 00 00	// cargo refitting types?
			1E 17			// Callback flags. Enable callbacks 10,11,12 and 16
			1F 1E 		// Tractive Effort
			20 02 		// air drag
			21 01 		// make vegicle shorter *Unused set by callback
			22 00 		// visual effect *Unused set by callback
			23 00 		// Powered wagon weight
			24 00		// weight high byte 
			27 04		// misc flags 04=mu
//
//Front
  716 * 4	 01 00 01 08
  717 f:\mps\ttwin95\sprites/EME231mh.pcx 2 40 01 21 8 -3 -13
  718 f:\mps\ttwin95\sprites/EME231mh.pcx 18 40 01 17 19 -12 -9
  719 f:\mps\ttwin95\sprites/EME231mh.pcx 50 40 01 12 28 -13 -8
  720 f:\mps\ttwin95\sprites/EME231mh.pcx 98 40 01 17 19 -6 -10
  721 f:\mps\ttwin95\sprites/EME231mh.pcx 130 40 01 21 8 -3 -13
  722 f:\mps\ttwin95\sprites/EME231mh.pcx 146 40 01 17 19 -12 -9
  723 f:\mps\ttwin95\sprites/EME231mh.pcx 178 40 01 12 28 -13 -8
  724 f:\mps\ttwin95\sprites/EME231mh.pcx 226 40 01 17 19 -6 -10
  725 * 9	 02 00 00 01 01 00 00 00 00
//Back
  726 * 4	 01 00 01 08
  727 f:\mps\ttwin95\sprites/EME231mh.pcx 2 72 01 21 8 -3 -13
  728 f:\mps\ttwin95\sprites/EME231mh.pcx 18 72 01 17 19 -12 -9
  729 f:\mps\ttwin95\sprites/EME231mh.pcx 50 72 01 12 28 -13 -8
  730 f:\mps\ttwin95\sprites/EME231mh.pcx 98 72 01 17 19 -6 -10
  731 f:\mps\ttwin95\sprites/EME231mh.pcx 130 72 01 21 8 -3 -13
  732 f:\mps\ttwin95\sprites/EME231mh.pcx 146 72 01 17 19 -12 -9
  733 f:\mps\ttwin95\sprites/EME231mh.pcx 178 72 01 12 28 -13 -8
  734 f:\mps\ttwin95\sprites/EME231mh.pcx 226 72 01 17 19 -6 -10
  735 * 9	 02 00 01 01 01 00 00 00 00
//Coach
  736 * 4	 01 00 01 04
  737 f:\mps\ttwin95\sprites/EME231mh.pcx 2 104 01 21 8 -3 -13
  738 f:\mps\ttwin95\sprites/EME231mh.pcx 18 104 01 17 19 -12 -9
  739 f:\mps\ttwin95\sprites/EME231mh.pcx 50 104 01 12 28 -13 -8
  740 f:\mps\ttwin95\sprites/EME231mh.pcx 98 104 01 17 19 -6 -10
  741 * 9	 02 00 02 01 01 00 00 00 00
//Panto 1
  742 * 4	 01 00 01 08
  743 f:\mps\ttwin95\sprites/EME231mh.pcx 2 136 01 21 8 -3 -13
  744 f:\mps\ttwin95\sprites/EME231mh.pcx 18 136 01 17 19 -12 -9
  745 f:\mps\ttwin95\sprites/EME231mh.pcx 50 136 01 15 28 -13 -11
  746 f:\mps\ttwin95\sprites/EME231mh.pcx 98 136 01 19 19 -6 -12
  747 f:\mps\ttwin95\sprites/EME231mh.pcx 130 136 01 21 8 -3 -13
  748 f:\mps\ttwin95\sprites/EME231mh.pcx 146 136 01 19 19 -12 -11
  749 f:\mps\ttwin95\sprites/EME231mh.pcx 178 136 01 15 28 -13 -11
  750 f:\mps\ttwin95\sprites/EME231mh.pcx 226 136 01 17 19 -6 -10
  751 * 9	 02 00 04 01 01 00 00 00 00
//Panto 2
  752 * 4	 01 00 01 08
  753 f:\mps\ttwin95\sprites/EME231mh.pcx 2 168 01 21 8 -3 -13
  754 f:\mps\ttwin95\sprites/EME231mh.pcx 18 168 01 19 19 -12 -11
  755 f:\mps\ttwin95\sprites/EME231mh.pcx 50 168 01 15 28 -13 -11
  756 f:\mps\ttwin95\sprites/EME231mh.pcx 98 168 01 17 19 -6 -10
  757 f:\mps\ttwin95\sprites/EME231mh.pcx 130 168 01 21 8 -3 -13
  758 f:\mps\ttwin95\sprites/EME231mh.pcx 146 168 01 17 19 -12 -9
  759 f:\mps\ttwin95\sprites/EME231mh.pcx 178 168 01 15 28 -13 -11
  760 f:\mps\ttwin95\sprites/EME231mh.pcx 226 168 01 19 19 -6 -12
  761 * 9	 02 00 05 01 01 00 00 00 00
//
//D0 
  762 * 28	 02 00 10 81 40 80 FF 00 \b5 \b4				
				00 00 00 00 // Front F//C//P//C//B  
				02 00 01 01 // 
				04 00 02 02 // 
				02 00 03 03 //
				01 00	
//D1
  763 * 28	 02 00 20 81 40 80 FF 00 \b5 \b4				
				00 00 00 00 // Front F//C//P//C//B 
				02 00 01 01 //
				05 00 02 02 //
				02 00 03 03	//	
				01 00	
//	
//check direction (D0 or D1):
  764 * 14	 02 00 30 82 FF 00 01 01 10 00 00 00 20 00
//
// set CB 16 (articulated vehicle)
  765 * 14	 02 00 11 81 10 00 FF 01
				7E 80 01 04	// 4 additional parts of veh-ID 7E (base articulated car NG)
				FF 80		// end articulated vehicle		
// set CB 1D (engine attach)
// 
  766 * 14	 02 00 12 81 40 10 FF 01
				FE 80 00 0F	//
				20 80		// error: "wrong number of cars" 

//
  767 * 18	 02 00 13 81 C6 00 FF 02
				12 00 A4 A4 //IDs of vehicles aloud to attach
				12 00 7E 7E
				21 80		// error: "wrong type of car"
//
//process callback 10 (powered wagon) D0
  768 * 14	 02 00 15 81 40 00 0F 01
				34 80 02 02
				40 80
//
//process callback 10 (powered wagon) D1
  769 * 14	 02 00 16 81 40 00 0F 01
				3C 80 02 02
				40 80
//check direction for callback 10:
  770 * 14	 02 00 17 82 FF 00 01 01 16 00 00 00 15 00			
//					
  771 * 14	 02 00 18 81 10 00 FF 01
				\b140 80 14 14
				30 00 
// switch between callback and graphics branch
  772 * 34	 02 00 19 81 0C 00 FF 06
		\b32 80 12 12 // CB 12 Loading Speed
          01 80 11 11 // CB 11 Shorten to 7/8
		  17 00 10 10 // CB 10 Callback for powered wagons, used for graphical purposes here.
          11 00 16 16 // CB 16 Enable callback 16 articulated vehicle.
          13 00 1D 1D // CB 1D Enables callback 1D, Can wagon be attached.
		  18 00 36 36 // CB 36 Enable capacity change
          30 00       // graphics
// 
//----------------------------------------------------------
// menu entry
//----------------------------------------------------------
  773 * 6	 01 00 01 FF 01 00
  774 f:\mps\ttwin95\sprites/EME231mh.pcx 18 8 01 16 54 -25 -10
  775 * 9	 02 00 00 01 01 00 00 00 00
//
  776 * 11	 02 00 A1 85 1A 00 \w700 00 00 80  //Total capacity 
//               
  777 * 14	 02 00 A2 81 10 00 FF 01
				A1 00 14 14
				00 00
//			
  778 * 18	 02 00 01 81 0C 00 FF 02
				22 80 23 23
				A2 00 36 36
				00 00    			
//
  779 * 30	 04 00 01 01 A4 "E231-Kinkou Type (5 car)" 00
//
  780 * 10	 03 00 01 A4 01 FF 01 00 19 00
//
  781 * 7	 03 00 81 7E 00 19 00
User avatar
hargs
Traffic Manager
Traffic Manager
Posts: 129
Joined: 13 Feb 2012 23:19
Location: Manchester. UK.

Re: Hargs' Articulation Woes

Post by hargs »

Ok so what I can't work out this time is, in this situation;

Code: Select all

468 * 34    02 00 10 81 40 00 0F 06
Where is the number that is being ANDed by 0F actually coming from.
If that makes any sense at all.

thanks again in advance.
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: Hargs' Articulation Woes

Post by michael blunck »

hargs wrote: Where is the number that is being ANDed by 0F actually coming from.
It´s the value of var 40 (position of vehicle in train consist). This is set by the game.

regards
Michael
Image
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Hargs' Articulation Woes

Post by Eddi »

hargs wrote:Ok so what I can't work out this time is, in this situation;
not sure what part you don't understand, so let's start with the very basics

Code: Select all

468 // this is the position of the sprite in the GRF (can be automatically calculated by NFOrenum)
* // this is a pseudosprite (no graphics)
34 // this is the length of the sprite (can be automatically calculated by NFOrenum)
   02 // This is an action 2 (graphics/callback switch)
   00 // ... about trains
   10 // This is the switch-ID which later actions can refer to
   81 // This acesses a byte-sized variable of the current vehicle
   40 // The variable with the number 0x40 is accessed
   00 // The value of this variable is not shifted, and no advanced stuff is done
   0F // The value of this variable is ANDed by 0xF (only the last 4 bits accessed)
   06 // 6 cases should be individually checked
[...] some parts are ommited here
so you check variable 40 for trains (position in consist), which has the format 00bbnnff. you only access the lowest byte, so the ff-part, which counts the position from the engine (starting with 0).

since you mask out the higher bits, trains of length >16 will give you repeated values.

Further questions?
User avatar
hargs
Traffic Manager
Traffic Manager
Posts: 129
Joined: 13 Feb 2012 23:19
Location: Manchester. UK.

Re: Hargs' Articulation Woes

Post by hargs »

It would seem to be the case of not knowing enough to ask the right question, thanks anyway.
User avatar
hargs
Traffic Manager
Traffic Manager
Posts: 129
Joined: 13 Feb 2012 23:19
Location: Manchester. UK.

Re: Hargs' Articulation Woes

Post by hargs »

yep me again.

this time I was wondering whether its possible to set up so the formation of trains consist can be set via the refit option;
eg. refit option 1 F-C-B-F-C-B repeating sets of 3 car consists
refit option 2 F-C-C-C-C-B repeating sets of 6 car conists

if that makes any sense at all.

Edit: I think I've worked this one out, but further input would still be appreciated.
User avatar
hargs
Traffic Manager
Traffic Manager
Posts: 129
Joined: 13 Feb 2012 23:19
Location: Manchester. UK.

Re: Hargs' Articulation Woes

Post by hargs »

Having trouble with a consist that changes based on trains length this time.

Code: Select all

  139 * 20	 02 00 16 81 40 80 FF 00 03 02
				05 00 02 02
				09 00 01 01
				06 00
  140 * 18	 02 00 17 81 40 00 04 02
				05 00 03 03
				09 00 01 02
				06 00			
  141 * 20	 02 00 18 81 40 80 FF 00 05 02
				05 00 04 04
				09 00 01 03
				06 00				
  142 * 18	 02 00 19 81 40 10 FF 02
				18 00 04 04
				17 00 03 03
				16 00		
I'm only getting the return value for Id 17. I'm sure it's another daft mistake but I'm not having any luck working it out.

Once again thanks in advance for the help.
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: Hargs' Articulation Woes

Post by michael blunck »

hargs wrote: [...] I'm only getting the return value for Id 17.
What exactly is the problem? I can´t understand it, just by reading the code.

regards
Michael
Image
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Hargs' Articulation Woes

Post by Eddi »

without any comments in the code, without you explaining what you see, and without you explaining what you expected to see instead, there's little we can do for you...
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Hargs' Articulation Woes

Post by PikkaBird »

Indeed. There's either an error in your logic or an error in your code. Providing a comment for each line saying what you're trying to do will make the problem much clearer to us, and to you.
User avatar
hargs
Traffic Manager
Traffic Manager
Posts: 129
Joined: 13 Feb 2012 23:19
Location: Manchester. UK.

Re: Hargs' Articulation Woes

Post by hargs »

Ah sorry, I've just been getting the impression that you all just sort of know what it means, one those things that comes with being a beginner.

Code: Select all

//choose sprites depending on position
  139 * 20    02 00 16 81 40 80 FF 00 03 02
            05 00 02 02
            09 00 01 01
            06 00
//choose sprites depending on position
  140 * 18    02 00 17 81 40 00 04 02
            05 00 03 03
            09 00 01 02
            06 00 
//choose sprites depending on position        
  141 * 20    02 00 18 81 40 80 FF 00 05 02
            05 00 04 04
            09 00 01 03
            06 00  
//choose to display different sprites based on length of consist          
  142 * 18    02 00 19 81 40 10 FF 02
            18 00 04 04 //if length of 5 choose Id 18
            17 00 03 03	//if length of 4 choose Id 19
            16 00    	//otherwise Id 16
what i was trying to get was
at 3 or 6 cars
Front-coach-Back-F-C-B
then at 4 cars
F-C-C-B
and at 5 cars
F-C-C-C-B

what i'm getting though is the 4 car version giving F-F-F-F.

Hopefully that makes some sort of sense.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Hargs' Articulation Woes

Post by PikkaBird »

hargs wrote:Ah sorry, I've just been getting the impression that you all just sort of know what it means, one those things that comes with being a beginner.
We may, but the problem is not in what the code does (this stuff has been around for a while and is relatively bug free), but in the difference between what it does and what you expect it to do, and that is impossible to diagnose without knowing what you expect it to do. :)

The problem is that in sprite 140 you're ANDing with 04 (bit 2, for possible values of "00" or 04") when you mean to AND with 03 (bits 0-1, for possible values of "00", "01", "02" and "03"). :) Bitmasks are certainly confusing at first!
User avatar
hargs
Traffic Manager
Traffic Manager
Posts: 129
Joined: 13 Feb 2012 23:19
Location: Manchester. UK.

Re: Hargs' Articulation Woes

Post by hargs »

PikkaBird wrote: :) Bitmasks are certainly confusing at first!
Yes, yes they really are.

Thanks again.
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: Hargs' Articulation Woes

Post by michael blunck »

hargs wrote:
PikkaBird wrote: :) Bitmasks are certainly confusing at first!
Yes, yes they really are.
Again! :cool:

Don´t mind, things like these are hard to spot. Will getting better soon. :)

regards
Michael
Image
User avatar
hargs
Traffic Manager
Traffic Manager
Posts: 129
Joined: 13 Feb 2012 23:19
Location: Manchester. UK.

Re: Hargs' Articulation Woes

Post by hargs »

Having some trouble with the shorten vehicles from CB36, I'm sure the mistake is an idiotically obvious one, but alas it continues to elude me.
Thanks again in advance.

Code: Select all

  546 * 14	 02 00 11 81 10 00 FF 01
				7B 80 01 01 //Articulate using vehicle 7B common tender
				FF 80		//end
  547 * 14	 02 00 02 81 10 00 FF 01
				04 80 21 21 // Shorten to 4/8
				00 00       // graphics
  548 * 18	 02 00 03 81 0C 00 FF 02
				11 00 16 16 //CB 16
				02 00 36 36 //CB 36
				00 00 
  549 * 14	 02 00 04 81 10 00 FF 01
				06 80 21 21 // Shorten to 2/8
				01 00       // graphics	
  550 * 14	 02 00 05 81 0C 00 FF 01
				04 00 36 36 //CB 36
				01 00
  551 * 14	 02 00 10 81 41 00 01 01
				03 00 00 00  //display train
				05 00	     //otherwise tender   
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Hargs' Articulation Woes

Post by Eddi »

again, there seems to be some information missing, so i'm rather trying to guess what looks odd.

i'll start at the end:

Code: Select all

  551 * 14	 02 00 10 81 41 00 01 01
var 41 is not valid on the purchase list, that means especially not during the articulated callback, you should put this check later, e.g. somewhere inside the CB36 chain, and in the graphics chain behind a var10 (extra callback info) check whether it's on the purchase list/news message/prototype offer (var not valid), or whether it's on the map/depot/vehicle info (var valid)

Code: Select all

				FF 80		//end
if you are using GRFv8, this should be "FF FF" instead

Code: Select all

				7B 80 01 01 //Articulate using vehicle 7B common tender
so what now, is it a "common" tender, or is it the same vehicle-ID as the front vehicle (which you ommited in your code snippet)... the rest of the code seems to assume same vehicle-ID, so this comment seems out of place
User avatar
hargs
Traffic Manager
Traffic Manager
Posts: 129
Joined: 13 Feb 2012 23:19
Location: Manchester. UK.

Re: Hargs' Articulation Woes

Post by hargs »

Ah sorry I thick we're proven explainations are not my strong point.
It is the make vehicle shorter part that is failing.
Eddi wrote:var 41 is not valid on the purchase list, that means especially not during the articulated callback, you should put this check later, e.g. somewhere inside the CB36 chain, and in the graphics chain behind a var10 (extra callback info) check whether it's on the purchase list/news message/prototype offer (var not valid), or whether it's on the map/depot/vehicle info (var valid)
Ah ok I'll rearenge that away from the end. The purchase menu has its on sprite and CB chain, but of course you can't know that if i don't include it *sigh*.
Eddi wrote:if you are using GRFv8, this should be "FF FF" instead
I've only just switched over so thanks the head up on that one.
Eddi wrote:so what now, is it a "common" tender, or is it the same vehicle-ID as the front vehicle (which you ommited in your code snippet)... the rest of the code seems to assume same vehicle-ID, so this comment seems out of place
Yes the tender is a vehicle with a different ID, your comment suggests this may (be part of) the issue.

Heres the whole thing if that helps;

Code: Select all

//----------------------------------------------------------
// 2-6-0 (8620)
//----------------------------------------------------------

  525 * 84	 00 00 21 01 B1 //As far as vehicle ID
			00 \w0	// First property to change 00 date of introduction days after 1920
			02 05		// reliability decay speed
			03 \b30		// Vehicle life in years
			04 \b20 	// Model life in years 
			05 00 		// track type
			06 03 		// Cimate availablility
			07 00 		// Load speed
			08 01 		// AI thing
			09 \w90 	// Speed
			0B \w750	// Power
			0D C8 		// Running cost factor
			0E 30 4C 00 00	// Running cost base
			12 FD 		// Sprite ID FD= new grf
			13 00 		// dual head flag
			14 00 		// Cargo capacity
			15 00 		// cargo type
			16 \b83 	// Weight
			17 12 		// Cost factor
			18 00 		// Engine rank AI thing ttd
			19 04 		// traction type 
			1A 1B 		// sort purchase list?
			1B 00 00 	// power added by each wagon
			1C 00 		// Refit cost
			1D 01 00 00 00	// cargo refitting types?
			1E FF 		// Callback flags
			1F 21 		// Tractive Effort 106kN
			20 00 		// air drag
			21 00 		// make vegicle shorter
			22 04 		// visual effect
			23 00 		// Powered wagon weight
			24 00		// weight high byte
			27 02		// misc flags 2=2cc
			2A \d01/01/1911 //D long-format introduction date
//
  526 * 4	 01 00 01 08
  527 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp   2  40   8  15   -3  -12 normal
  528 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  18  40  14  12   -3  -10 normal chunked
  529 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  35  40  16  11    0   -7 normal
  530 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  54  40  14  12    4   -2 normal chunked
  531 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  70  40   8  15   -3    1 normal
  532 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  80  40  14  12  -14   -2 normal chunked
  533 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  98  40  16  11  -17   -7 normal
  534 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp 118  40  14  13   -9  -10 normal chunked
  535 * 9	 02 00 00 01 01 00 00 00 00
  536 * 4	 01 00 01 08
  537 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp   2  60   8   9   -3   -8 normal
  538 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  18  60   9   9    0   -7 normal chunked
  539 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  34  60   9   9    7   -5 normal
  540 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  50  60  10   9    5   -1 normal chunked
  541 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  66  60   8   9   -3    5 normal
  542 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  82  60   9   9  -12    0 normal chunked
  543 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp  98  60   9   9  -17   -5 normal
  544 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp 114  60  10   9   -7   -7 normal chunked
  545 * 9	 02 00 01 01 01 00 00 00 00
// 
  546 * 14	 02 00 11 81 10 00 FF 01
				7B 80 01 01 //Articulate using vehicle 7B common tender
				FF FF		//end
  547 * 14	 02 00 02 81 10 00 FF 01
				04 80 21 21 // Shorten to 4/8
				00 00       // graphics
  548 * 18	 02 00 03 81 0C 00 FF 02
				11 00 16 16 //CB 16
				02 00 36 36 //CB 36
				00 00 
  549 * 14	 02 00 04 81 10 00 FF 01
				06 80 21 21 // Shorten to 2/8
				01 00       // graphics	
  550 * 14	 02 00 05 81 0C 00 FF 01
				04 00 36 36 //CB 36
				01 00
  551 * 14	 02 00 10 81 41 00 01 01
				03 00 00 00  //display train
				05 00	     //otherwise tender   
//----------------------------------------------------------
// menu entry
//----------------------------------------------------------
  552 * 6	 01 00 01 FF 01 00
  553 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp   18  8   54  16   -25  -8 normal
  554 * 9	 02 00 00 01 01 00 00 00 00 			
//
  555 * 25	 04 00 01 01 B1 "2-6-0 Mogul (Steam)" 00
// 
  556 * 10	 03 00 01 B1 01 FF 00 00 10 00			
  557 * 7	 03 00 81 7B 00 04 00 
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Hargs' Articulation Woes

Post by Eddi »

Code: Select all

  557 * 7	 03 00 81 7B 00 04 00 
don't you mean 05 here?

Code: Select all

  556 * 10	 03 00 01 B1 01 FF 00 00 10 00			
this one needs further thought, you certainly need to put the articulation callback into the FF chain as well, and you should use 03 directly, not 10.
User avatar
hargs
Traffic Manager
Traffic Manager
Posts: 129
Joined: 13 Feb 2012 23:19
Location: Manchester. UK.

Re: Hargs' Articulation Woes

Post by hargs »

I stripped it down to just the CB36 chain (I think at least), still doesn't seem to want to play.
I must be doing something more intrinsically wrong.

Code: Select all

// 
//--above as before
  544 * 14	 02 00 02 81 10 00 FF 01
				04 80 21 21 // Shorten to 4/8
				00 00       // graphics
  545 * 14	 02 00 03 81 0C 00 FF 01
	//			11 00 16 16 //CB 16
				02 00 36 36 //CB 36
				00 00 
//----------------------------------------------------------
// menu entry
//----------------------------------------------------------
  546 * 6	 01 00 01 FF 01 00
  547 f:\mps\ttwin95\sprites/mogul01.pcx 8bpp   18  8   54  16   -25  -8 normal
  548 * 9	 02 00 00 01 01 00 00 00 00 			
//
  549 * 25	 04 00 01 01 B1 "2-6-0 Mogul (Steam)" 00
// 
  550 * 10	 03 00 01 B1 01 FF 00 00 03 00	
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Hargs' Articulation Woes

Post by PikkaBird »

You've got code in there that picks between loco and tender graphics, but then you're using seperate IDs for the tender anyway.

You're being told things you should change, and then leaving out those parts from your next post, so we have no idea whether you changed them or not.

The obvious thing that would cause this problem is that you're using GRF v<8, since CB36 only replaced CB11 for shorter wagons in GRF v8. Note that "GRF v8" and "GRF container v2" are not the same thing. Can we see your action 8 please?
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: Semrush [Bot] and 12 guests