Page 1 of 2

[OTTD] Modular Wider Bridges Set (v003 on Bananas 13-10-2020)

Posted: 13 Oct 2020 11:07
by Quast65
Modular Wider Bridges Set
Screenie01.png
Screenie01.png (161.45 KiB) Viewed 10608 times
This set replaces the three tubular bridges with three modular bridges that together can be used to visually make a wider bridge.
Or, via parameter, adds them as three extra bridges (JGR PatchPack only).
The middle piece could in theory also be used in combination with objects next to it (providing the sides and backs of a bridge), to make one-of-a-kind bridges.

The roadbridge has the look of the Highway from RattRoads, but will adapt to any other roadset, if that roadset provides bridge-overlay graphics.

The rail/mono/mlev-bridge has a dark grey concrete look. Vanilla rail/mono/mlev tracks will not be visible on this bridge!
Use a trackset that provides bridge-overlay graphics.

MAJOR ISSUE:
Cities and AI's will probably also build these bridges, but not as intended. :evil:
A lot of replacement may be required of the player :twisted:
So this is more for the eyecandy players, rather than for regular games :mrgreen:
Use this GRF in combination with JGR PatchPack v0.38.1 or newer and you will not have the above issue.

GRF can be found on Bananas.

Credits:
Code & Graphics based on Andrew350's magnificent American Bridges Set (Cable-Stayed roadbridge) and glorious RattRoads (Highway).
Many thanks to WallyWeb for helping with the Menu-sprite code.
Many thanks to JGR for the alterations to the code! :bow:

Sources v003:
viewtopic.php?p=1237644#p1237644




The GRF mentioned below is now obsolete:

Modular Wider Bridges Set for JGR PatchPack
I have also made a version for (recent) JGR Patchpack, this will not replace, but add the three bridges.
Screenie03.png
Screenie03.png (27.03 KiB) Viewed 10067 times
WILL NOT WORK ON REGULAR OpenTTD!!!!
GRF can be found on Bananas.

Credits:
Code & Graphics based on Andrew350's magnificent American Bridges Set (Cable-Stayed roadbridge) and glorious RattRoads (Highway).
Many thanks to WallyWeb for helping with the Menu-sprite code.

Sources vJGP1:
viewtopic.php?p=1237008#p1237008

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 13 Oct 2020 11:15
by Quast65
Sources v001:
modular_wider_bridges_v001_SOURCES.rar
(341.83 KiB) Downloaded 189 times

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 13 Oct 2020 13:04
by GarryG
Great idea for those who like to Eye candy their games .. I was looking some time ago doing the Sydney Harbour Bridge as modules, but didn't continue it because AI's not use it properly. Wonder some times if worth working on it again similar to what you did here.

Cheers pal

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 13 Oct 2020 14:07
by Quast65
GarryG wrote: 13 Oct 2020 13:04 Great idea for those who like to Eye candy their games .. I was looking some time ago doing the Sydney Harbour Bridge as modules, but didn't continue it because AI's not use it properly. Wonder some times if worth working on it again similar to what you did here.

Cheers pal
Yeah AI's and cities are the main issue, but in my games I dont let cities grow by themselves (and I will correct some strange bridges built during spawning myself if I stumble upon them) and I dont allow AI's to build anything (only for eyecandy vehicles basically).
So, this simple bridge set will work for those types of games.

But, as I mentioned, you could place objects next to the Middle bridge graphics (at the front and back, with some overlap pieces to let ships through) and so make an unique bridge...

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 13 Oct 2020 14:48
by temporal8
Finally someone thought about this, well done! :bow:

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 14 Oct 2020 00:55
by Gadg8eer
Can you make a version that makes use of bridge IDs 0D through 0F in JGR's Patch Pack? I tried editing your source code but I'm hopeless with NFO.

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 14 Oct 2020 07:24
by Quast65
Gadg8eer wrote: 14 Oct 2020 00:55 Can you make a version that makes use of bridge IDs 0D through 0F in JGR's Patch Pack? I tried editing your source code but I'm hopeless with NFO.
Thats not too difficult (just did a test and it worked), but I dont know how to give those extra bridges their own icon in the purchase menu.
I have been searching around various topics (here and on Simuscape), but cant find any good clear documentation (it's something to do with adding Prop14 to Action00 and then something else that adds the realsprites).

I'll quote Wallyweb here to draw his attention as I believe he has some knowledge about this.
wallyweb wrote: 10 Oct 2020 22:44 *knock knock* ;-)

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 14 Oct 2020 10:18
by wallyweb
Quast65 wrote: 14 Oct 2020 07:24 I'll quote Wallyweb here to draw his attention as I believe he has some knowledge about this.
wallyweb wrote: 10 Oct 2020 22:44 *knock knock* ;-)
Go away! I'm sleeping! :evil:

Oh! Quast65 and Gadg8eer!

Bridge Action 0 Property 14 is defined in the NewGRF Specifications.
It is supported by New Map Features (NMF) and JGR's patch pack.

1. You need to use Action D GRF Resource Management (GRM) to reserve space for your sprite.
2. Next Action 6 to access the real sprites to be added/modified.
3. Next Action A to define the real sprites to be added/modified. (This also defines the sprite IDs starting at 0x00, so keep count of the real sprites you worked on)
[ sample real sprite with ID noted - this is the 191st real sprite in the Action A, so the ID is 190 or 0xBE]
241 sprites\wallywebNMFBridgeSet_0F_CarbonNano.pcx 16 528 09 11 40 0 9 //BE 190

4. Now we have another Action 6
//-------------------------------------------------------------------------------------------
// Action6 - Modifies the contents of the following sprite
358 * 5 06 20 82 06 FF // Change 2 bytes starting at position 6 of the following Action0
//-------------------------------------------------------------------------------------------
5. Followed by an Action 0 for property 14
//-------------------------------------------------------------------------------------------
// Action0 - Bridge Properties
359 * 10 00 06 01 01 0F 14 BE 00 00 00 // 01 props; 01 info; bridge Id 0F; Prop 14; spritedata;
//-------------------------------------------------------------------------------------------

Note: If you are using nforenum, it does not know about property 14 and it will throw a fatal error hissy fit. Just ignore it.

Enjoy your new menu sprite. 8)

Next time call ahead and make an appointment with my secretary. :P

zzzzZZZZzzzzz ...

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 14 Oct 2020 15:57
by Quast65
wallyweb wrote: 14 Oct 2020 10:18 Go away! I'm sleeping! :evil:
Wakey wakey!! :tongue:

The American Bridges Set (on which my code is based) is coded slightly different than you do.

Main thing is that there are a lot of Action 0D's...
Here is the code of Bridge 0D:
[+] Spoiler

Code: Select all

///================
//    Bridge 0D
//================
                         //this number increases by 3 with each bridge
    3 * 31	 04 06 FF 03 27 DC "BACK" 00 "RAIL BACK" 00 "ROAD BACK" 00 //define texts first so we can reference them in properties below

//!!Error (141): ID 0D out of valid range (00..0C).
    4 * 32	 00 06 0A 01 0D //adjust properties of eleventh bridge (id 0D)
			 08 00 //intro date
			 09 00 //min length
			 0A FF //max length
			 0B 15 //cost factor
			 0C 96 02 //max speed
			 0E 01 //flags (set to 01 to disable far pillars)
			 0F 00 00 00 00 //long format intro date
			 10 27 DC //purchase text
			 11 28 DC //rail bridge info window
			 12 29 DC //road bridge info window

	//this reserves some sprites into temp. params
    5 * 9	 0D 00 \D= \DR FE FF 08 69 00 //this "main" param is used to allocate all of the graphics via the following action 6
    6 * 9	 0D 01 \D+ 00 FF 01 00 00 00 //each sprite then gets its own param # to use in the final action 6's which determine placement
    7 * 9	 0D 02 \D+ 00 FF 02 00 00 00
    8 * 9	 0D 03 \D+ 00 FF 03 00 00 00
    9 * 9	 0D 04 \D+ 00 FF 04 00 00 00
   10 * 9	 0D 05 \D+ 00 FF 05 00 00 00
   11 * 9	 0D 06 \D+ 00 FF 06 00 00 00
   12 * 9	 0D 07 \D+ 00 FF 07 00 00 00
   13 * 9	 0D 08 \D+ 00 FF 08 00 00 00
   14 * 9	 0D 09 \D+ 00 FF 09 00 00 00
   15 * 9	 0D 0A \D+ 00 FF 0A 00 00 00
   16 * 9	 0D 0B \D+ 00 FF 0B 00 00 00
   17 * 9	 0D 0C \D+ 00 FF 0C 00 00 00
   18 * 9	 0D 0D \D+ 00 FF 0D 00 00 00
   19 * 9	 0D 0E \D+ 00 FF 0E 00 00 00
   20 * 9	 0D 0F \D+ 00 FF 0F 00 00 00
   21 * 9	 0D 10 \D+ 00 FF 10 00 00 00
   22 * 9	 0D 11 \D+ 00 FF 11 00 00 00
   23 * 9	 0D 12 \D+ 00 FF 12 00 00 00
   24 * 9	 0D 13 \D+ 00 FF 13 00 00 00
   25 * 9	 0D 14 \D+ 00 FF 14 00 00 00
   26 * 9	 0D 15 \D+ 00 FF 15 00 00 00
   27 * 9	 0D 16 \D+ 00 FF 16 00 00 00
   28 * 9	 0D 17 \D+ 00 FF 17 00 00 00
   29 * 9	 0D 18 \D+ 00 FF 18 00 00 00
   30 * 9	 0D 19 \D+ 00 FF 19 00 00 00
   31 * 9	 0D 1A \D+ 00 FF 1A 00 00 00
   32 * 9	 0D 1B \D+ 00 FF 1B 00 00 00
   33 * 9	 0D 1C \D+ 00 FF 1C 00 00 00
   34 * 9	 0D 1D \D+ 00 FF 1D 00 00 00
   35 * 9	 0D 1E \D+ 00 FF 1E 00 00 00
   36 * 9	 0D 1F \D+ 00 FF 1F 00 00 00
   37 * 9	 0D 20 \D+ 00 FF 20 00 00 00
   38 * 9	 0D 21 \D+ 00 FF 21 00 00 00
   39 * 9	 0D 22 \D+ 00 FF 22 00 00 00
   40 * 9	 0D 23 \D+ 00 FF 23 00 00 00
   41 * 9	 0D 24 \D+ 00 FF 24 00 00 00
   42 * 9	 0D 25 \D+ 00 FF 25 00 00 00
   43 * 9	 0D 26 \D+ 00 FF 26 00 00 00
   44 * 9	 0D 27 \D+ 00 FF 27 00 00 00
   45 * 9	 0D 28 \D+ 00 FF 28 00 00 00
   46 * 9	 0D 29 \D+ 00 FF 29 00 00 00
   47 * 9	 0D 2A \D+ 00 FF 2A 00 00 00
   48 * 9	 0D 2B \D+ 00 FF 2B 00 00 00
   49 * 9	 0D 2C \D+ 00 FF 2C 00 00 00
   50 * 9	 0D 2D \D+ 00 FF 2D 00 00 00
   51 * 9	 0D 2E \D+ 00 FF 2E 00 00 00
   52 * 9	 0D 2F \D+ 00 FF 2F 00 00 00
   53 * 9	 0D 30 \D+ 00 FF 30 00 00 00
   54 * 9	 0D 31 \D+ 00 FF 31 00 00 00
   55 * 9	 0D 32 \D+ 00 FF 32 00 00 00
   56 * 9	 0D 33 \D+ 00 FF 33 00 00 00
   57 * 9	 0D 34 \D+ 00 FF 34 00 00 00
   58 * 9	 0D 35 \D+ 00 FF 35 00 00 00
   59 * 9	 0D 36 \D+ 00 FF 36 00 00 00
   60 * 9	 0D 37 \D+ 00 FF 37 00 00 00
   61 * 9	 0D 38 \D+ 00 FF 38 00 00 00
   62 * 9	 0D 39 \D+ 00 FF 39 00 00 00
   63 * 9	 0D 3A \D+ 00 FF 3A 00 00 00
   64 * 9	 0D 3B \D+ 00 FF 3B 00 00 00
   65 * 9	 0D 3C \D+ 00 FF 3C 00 00 00
   66 * 9	 0D 3D \D+ 00 FF 3D 00 00 00
   67 * 9	 0D 3E \D+ 00 FF 3E 00 00 00
   68 * 9	 0D 3F \D+ 00 FF 3F 00 00 00
   69 * 9	 0D 40 \D+ 00 FF 40 00 00 00
   70 * 9	 0D 41 \D+ 00 FF 41 00 00 00
   71 * 9	 0D 42 \D+ 00 FF 42 00 00 00
   72 * 9	 0D 43 \D+ 00 FF 43 00 00 00
   73 * 9	 0D 44 \D+ 00 FF 44 00 00 00
   74 * 9	 0D 45 \D+ 00 FF 45 00 00 00
   75 * 9	 0D 46 \D+ 00 FF 46 00 00 00
   76 * 9	 0D 47 \D+ 00 FF 47 00 00 00
   77 * 9	 0D 48 \D+ 00 FF 48 00 00 00
   78 * 9	 0D 49 \D+ 00 FF 49 00 00 00
   79 * 9	 0D 4A \D+ 00 FF 4A 00 00 00
   80 * 9	 0D 4B \D+ 00 FF 4B 00 00 00
   81 * 9	 0D 4C \D+ 00 FF 4C 00 00 00
   82 * 9	 0D 4D \D+ 00 FF 4D 00 00 00
   83 * 9	 0D 4E \D+ 00 FF 4E 00 00 00
   84 * 9	 0D 4F \D+ 00 FF 4F 00 00 00
   85 * 9	 0D 50 \D+ 00 FF 50 00 00 00
   86 * 9	 0D 51 \D+ 00 FF 51 00 00 00
   87 * 9	 0D 52 \D+ 00 FF 52 00 00 00
   88 * 9	 0D 53 \D+ 00 FF 53 00 00 00
   89 * 9	 0D 54 \D+ 00 FF 54 00 00 00
   90 * 9	 0D 55 \D+ 00 FF 55 00 00 00
   91 * 9	 0D 56 \D+ 00 FF 56 00 00 00
   92 * 9	 0D 57 \D+ 00 FF 57 00 00 00
   93 * 9	 0D 58 \D+ 00 FF 58 00 00 00
   94 * 9	 0D 59 \D+ 00 FF 59 00 00 00
   95 * 9	 0D 5A \D+ 00 FF 5A 00 00 00
   96 * 9	 0D 5B \D+ 00 FF 5B 00 00 00
   97 * 9	 0D 5C \D+ 00 FF 5C 00 00 00
   98 * 9	 0D 5D \D+ 00 FF 5D 00 00 00
   99 * 9	 0D 5E \D+ 00 FF 5E 00 00 00
  100 * 9	 0D 5F \D+ 00 FF 5F 00 00 00
  101 * 9	 0D 60 \D+ 00 FF 60 00 00 00
  102 * 9	 0D 61 \D+ 00 FF 61 00 00 00
  103 * 9	 0D 62 \D+ 00 FF 62 00 00 00
  104 * 9	 0D 63 \D+ 00 FF 63 00 00 00
  105 * 9	 0D 64 \D+ 00 FF 64 00 00 00
  106 * 9	 0D 65 \D+ 00 FF 65 00 00 00
  107 * 9	 0D 66 \D+ 00 FF 66 00 00 00
  108 * 9	 0D 67 \D+ 00 FF 67 00 00 00
  109 * 9	 0D 68 \D+ 00 FF 68 00 00 00


	//this allocates the following graphics (realsprites) into the sprites which were reserved earlier (in the order they are defined below)
  110 * 5	 06 00 02 03 FF 
	//sprite number 00 00 (the first sprite below) now gets changed to whatever number the grm picked for the first of the reserved sprites, then each subsequent sprite
	//is allocated that number + 1 (which corresponds to the number of the param above)
  111 * 5	 0A 01 69 00 00 
//rail
  112 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  1       1    66   41  -33  -10 normal //back flat x 00
  113 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  72      1    66   41  -31  -10 normal //back flat y 01
  114 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  143     1    65   35  -32  -12 normal //front flat x 02
  115 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  213     1    65   35  -31  -12 normal //front flat y 03
  116 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  283     1    64   33  -31   -2 normal //ramp back x 04
  117 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  352     1    64   33  -31   -2 normal //ramp back y 05
  118 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  421     1    64   42  -31  -11 normal //ramp front x 06
  119 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  490     1    64   42  -31  -11 normal //ramp front y 07
  120 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  559     1    38   24  -27  -13 normal //pillar x 08
  121 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  602     1    38   24   -9  -13 normal //pillar y 09
  122 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  1      53    65   34  -32   -6 normal //0-1-4 back x 0A
  123 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  67     53    33   20  -24   -2 normal //0-1-4 front x 0B
  124 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  101    53    65   34  -31   -6 normal //0-1-4 back y 0C
  125 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  171    53    33   20   -5   -1 normal //0-1-4 front y 0D
  126 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  209    53    64   87  -31  -59 normal //2 back x 0E
  127 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  276    53    32   74  -21  -54 normal //2 front x 0F
  128 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  311    53    64   87  -31  -59 normal //2 back y 10
  129 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  380    53    32   74   -9  -54 normal //2 front y 11
  130 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  417    53    65  103  -32  -75 normal //3 back x 12
  131 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  485    53    37   91  -26  -72 normal //3 front x 13
  132 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  525    53    65  103  -31  -75 normal //3 back y 14
  133 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  595    53    37   91   -9  -72 normal //3 front y 15
  134 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  637    53    64  103  -31  -75 normal //5 back x 16
  135 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  704    53    32   92  -21  -72 normal //5 front x 17
  136 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  739    53    64  103  -31  -75 normal //5 back y 18
  137 modular_wider_bridges/gfx/modular_back_rail.png  8bpp  808    53    32   92   -9  -72 normal //5 front y 19
//road
  138 modular_wider_bridges/gfx/modular_back_road.png  8bpp  1       1    66   41  -33  -10 normal //back flat x 1A
  139 modular_wider_bridges/gfx/modular_back_road.png  8bpp  72      1    66   41  -31  -10 normal //back flat y 1B
  140 modular_wider_bridges/gfx/modular_back_road.png  8bpp  143     1    65   35  -32  -12 normal //front flat x 1C
  141 modular_wider_bridges/gfx/modular_back_road.png  8bpp  213     1    65   35  -31  -12 normal //front flat y 1D
  142 modular_wider_bridges/gfx/modular_back_road.png  8bpp  283     1    64   33  -31   -2 normal //ramp back x 1E
  143 modular_wider_bridges/gfx/modular_back_road.png  8bpp  352     1    64   33  -31   -2 normal //ramp back y 1F
  144 modular_wider_bridges/gfx/modular_back_road.png  8bpp  421     1    64   42  -31  -11 normal //ramp front x 20
  145 modular_wider_bridges/gfx/modular_back_road.png  8bpp  490     1    64   42  -31  -11 normal //ramp front y 21
  146 modular_wider_bridges/gfx/modular_back_road.png  8bpp  559     1    38   24  -27  -13 normal //pillar x 22
  147 modular_wider_bridges/gfx/modular_back_road.png  8bpp  602     1    38   24   -9  -13 normal //pillar y 23
  148 modular_wider_bridges/gfx/modular_back_road.png  8bpp  1      53    65   34  -32   -6 normal //0-1-4 back x 24
  149 modular_wider_bridges/gfx/modular_back_road.png  8bpp  67     53    33   20  -24   -2 normal //0-1-4 front x 25
  150 modular_wider_bridges/gfx/modular_back_road.png  8bpp  101    53    65   34  -31   -6 normal //0-1-4 back y 26
  151 modular_wider_bridges/gfx/modular_back_road.png  8bpp  171    53    33   20   -5   -1 normal //0-1-4 front y 27
  152 modular_wider_bridges/gfx/modular_back_road.png  8bpp  209    53    64   87  -31  -59 normal //2 back x 28
  153 modular_wider_bridges/gfx/modular_back_road.png  8bpp  276    53    32   74  -21  -54 normal //2 front x 29
  154 modular_wider_bridges/gfx/modular_back_road.png  8bpp  311    53    64   87  -31  -59 normal //2 back y 2A
  155 modular_wider_bridges/gfx/modular_back_road.png  8bpp  380    53    32   74   -9  -54 normal //2 front y 2B
  156 modular_wider_bridges/gfx/modular_back_road.png  8bpp  417    53    65  103  -32  -75 normal //3 back x 2C
  157 modular_wider_bridges/gfx/modular_back_road.png  8bpp  485    53    37   91  -26  -72 normal //3 front x 2D
  158 modular_wider_bridges/gfx/modular_back_road.png  8bpp  525    53    65  103  -31  -75 normal //3 back y 2E
  159 modular_wider_bridges/gfx/modular_back_road.png  8bpp  595    53    37   91   -9  -72 normal //3 front y 2F
  160 modular_wider_bridges/gfx/modular_back_road.png  8bpp  637    53    64  103  -31  -75 normal //5 back x 30
  161 modular_wider_bridges/gfx/modular_back_road.png  8bpp  704    53    32   92  -21  -72 normal //5 front x 31
  162 modular_wider_bridges/gfx/modular_back_road.png  8bpp  739    53    64  103  -31  -75 normal //5 back y 32
  163 modular_wider_bridges/gfx/modular_back_road.png  8bpp  808    53    32   92   -9  -72 normal //5 front y 33
//mono
  164 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  1       1    66   41  -33  -10 normal //back flat x 34
  165 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  72      1    66   41  -31  -10 normal //back flat y 35
  166 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  143     1    65   35  -32  -12 normal //front flat x 36
  167 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  213     1    65   35  -31  -12 normal //front flat y 37
  168 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  283     1    64   33  -31   -2 normal //ramp back x 38
  169 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  352     1    64   33  -31   -2 normal //ramp back y 39
  170 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  421     1    64   42  -31  -11 normal //ramp front x 3A
  171 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  490     1    64   42  -31  -11 normal //ramp front y 3B
  172 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  559     1    38   24  -27  -13 normal //pillar x 3C
  173 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  602     1    38   24   -9  -13 normal //pillar y 3D
  174 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  1      53    65   34  -32   -6 normal //0-1-4 back x 3E
  175 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  67     53    33   20  -24   -2 normal //0-1-4 front x 3F
  176 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  101    53    65   34  -31   -6 normal //0-1-4 back y 40
  177 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  171    53    33   20   -5   -1 normal //0-1-4 front y 41
  178 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  209    53    64   87  -31  -59 normal //2 back x 42
  179 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  276    53    32   74  -21  -54 normal //2 front x 43
  180 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  311    53    64   87  -31  -59 normal //2 back y 44
  181 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  380    53    32   74   -9  -54 normal //2 front y 45
  182 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  417    53    65  103  -32  -75 normal //3 back x 46
  183 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  485    53    37   91  -26  -72 normal //3 front x 47
  184 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  525    53    65  103  -31  -75 normal //3 back y 48
  185 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  595    53    37   91   -9  -72 normal //3 front y 49
  186 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  637    53    64  103  -31  -75 normal //5 back x 4A
  187 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  704    53    32   92  -21  -72 normal //5 front x 4B
  188 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  739    53    64  103  -31  -75 normal //5 back y 4C
  189 modular_wider_bridges/gfx/modular_back_mono.png  8bpp  808    53    32   92   -9  -72 normal //5 front y 4D
//mlev
  190 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  1       1    66   41  -33  -10 normal //back flat x 4E
  191 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  72      1    66   41  -31  -10 normal //back flat y 4F
  192 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  143     1    65   35  -32  -12 normal //front flat x 50
  193 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  213     1    65   35  -31  -12 normal //front flat y 51
  194 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  283     1    64   33  -31   -2 normal //ramp back x 52
  195 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  352     1    64   33  -31   -2 normal //ramp back y 53
  196 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  421     1    64   42  -31  -11 normal //ramp front x 54
  197 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  490     1    64   42  -31  -11 normal //ramp front y 55
  198 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  559     1    38   24  -27  -13 normal //pillar x 56
  199 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  602     1    38   24   -9  -13 normal //pillar y 57
  200 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  1      53    65   34  -32   -6 normal //0-1-4 back x 58
  201 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  67     53    33   20  -24   -2 normal //0-1-4 front x 59
  202 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  101    53    65   34  -31   -6 normal //0-1-4 back y 5A
  203 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  171    53    33   20   -5   -1 normal //0-1-4 front y 5B
  204 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  209    53    64   87  -31  -59 normal //2 back x 5C
  205 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  276    53    32   74  -21  -54 normal //2 front x 5D
  206 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  311    53    64   87  -31  -59 normal //2 back y 5E
  207 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  380    53    32   74   -9  -54 normal //2 front y 5F
  208 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  417    53    65  103  -32  -75 normal //3 back x 60
  209 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  485    53    37   91  -26  -72 normal //3 front x 61
  210 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  525    53    65  103  -31  -75 normal //3 back y 62
  211 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  595    53    37   91   -9  -72 normal //3 front y 63
  212 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  637    53    64  103  -31  -75 normal //5 back x 64
  213 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  704    53    32   92  -21  -72 normal //5 front x 65
  214 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  739    53    64  103  -31  -75 normal //5 back y 66
  215 modular_wider_bridges/gfx/modular_back_mlev.png  8bpp  808    53    32   92   -9  -72 normal //5 front y 67
//Bridge Icon
  216 modular_wider_bridges/gfx/gui_icons.png  8bpp  290     2    43   20   0    0 normal //bridge icon 68


  217 * 5	 06 20 82 06 FF
//!!Error (141): ID 0D out of valid range (00..0C).
//!!Fatal Error (47): Offset 5: Invalid property 14.
  218 * 10	 00 06 01 01 0D 14 68 00 00 00


   //and finally these action 6's tell where to place each of the reserved sprites (organized by table layout for easier viewing)
   //Ack, I had to split them up individually because there aren't enough hex ids to do all in one
  219 * 50	 06
			 0A 02 08    0B 02 0C    //rail x (part 0 should probably never have pillars set)
			 0C 02 18    0D 02 1C    //rail y
			 24 02 28    25 02 2C    //road x
			 26 02 38    27 02 3C    //road y
			 3E 02 48    3F 02 4C    //mono x
			 40 02 58    41 02 5C    //mono y
			 58 02 68    59 02 6C    //mlev x
			 5A 02 78    5B 02 7C    //mlev y
			 FF

//ACHTERKANT (0D)
//!!Error (141): ID 0D out of valid range (00..0C).
  220 * 136	 00 06 01 01 0D 0D 00 01 //action 00 bridges(06), 01 property, 01 ID, ID 0D, prop 0D, tableID 00, 01 tables
//table 00 - offset starts at 08, add 16 for each row
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail X: Back&Floor, Front, Pillars, 0 //08, 0C, 10, 14
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail Y: Back&Floor, Front, Pillars, 0 //18, 1C, 20, 24
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road X: Back&Floor, Front, Pillars, 0 //28, 2C, 30, 34
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road Y: Back&Floor, Front, Pillars, 0 //38, 3C, 40, 44...
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono Y: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev Y: Back&Floor, Front, Pillars, 0 //78, 7C, 80, 84

  221 * 50	 06
			 0A 02 08    0B 02 0C    //rail x
			 0C 02 18    0D 02 1C    //rail y
			 24 02 28    25 02 2C    //road x
			 26 02 38    27 02 3C    //road y
			 3E 02 48    3F 02 4C    //mono x
			 40 02 58    41 02 5C    //mono y
			 58 02 68    59 02 6C    //mlev x
			 5A 02 78    5B 02 7C    //mlev y
			 FF

//table 01
//!!Error (141): ID 0D out of valid range (00..0C).
  222 * 136	 00 06 01 01 0D 0D 01 01
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail X: Back&Floor, Front, Pillars, 0 //08, 0C, 10, 14
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail Y: Back&Floor, Front, Pillars, 0 //18, 1C, 20, 24
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road X: Back&Floor, Front, Pillars, 0 //28, 2C, 30, 34
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road Y: Back&Floor, Front, Pillars, 0 //38, 3C, 40, 44...
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono Y: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev Y: Back&Floor, Front, Pillars, 0 //78, 7C, 80, 84

  223 * 50	 06
			 0E 02 08    0F 02 0C    //rail x
			 10 02 18    11 02 1C    //rail y
			 28 02 28    29 02 2C    //road x
			 2A 02 38    2B 02 3C    //road y
			 42 02 48    43 02 4C    //mono x
			 44 02 58    45 02 5C    //mono y
			 5C 02 68    5D 02 6C    //mlev x
			 5E 02 78    5F 02 7C    //mlev y
			 FF

//table 02
//!!Error (141): ID 0D out of valid range (00..0C).
  224 * 136	 00 06 01 01 0D 0D 02 01
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail X: Back&Floor, Front, Pillars, 0 //08, 0C, 10, 14
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail Y: Back&Floor, Front, Pillars, 0 //18, 1C, 20, 24
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road X: Back&Floor, Front, Pillars, 0 //28, 2C, 30, 34
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road Y: Back&Floor, Front, Pillars, 0 //38, 3C, 40, 44...
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono Y: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev Y: Back&Floor, Front, Pillars, 0 //78, 7C, 80, 84

  225 * 74	 06
			 12 02 08    13 02 0C    08 02 10    //rail x
			 14 02 18    15 02 1C    09 02 20    //rail y
			 2C 02 28    2D 02 2C    22 02 30    //road x
			 2E 02 38    2F 02 3C    23 02 40    //road y
			 46 02 48    47 02 4C    3C 02 50    //mono x
			 48 02 58    49 02 5C    3D 02 60    //mono y
			 60 02 68    61 02 6C    56 02 70    //mlev x
			 62 02 78    63 02 7C    57 02 80    //mlev y
			 FF

//table 03
//!!Error (141): ID 0D out of valid range (00..0C).
  226 * 136	 00 06 01 01 0D 0D 03 01
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail X: Back&Floor, Front, Pillars, 0 //08, 0C, 10, 14
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail Y: Back&Floor, Front, Pillars, 0 //18, 1C, 20, 24
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road X: Back&Floor, Front, Pillars, 0 //28, 2C, 30, 34
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road Y: Back&Floor, Front, Pillars, 0 //38, 3C, 40, 44...
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono Y: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev Y: Back&Floor, Front, Pillars, 0 //78, 7C, 80, 84

  227 * 50	 06
			 0A 02 08    0B 02 0C    //rail x
			 0C 02 18    0D 02 1C    //rail y
			 24 02 28    25 02 2C    //road x
			 26 02 38    27 02 3C    //road y
			 3E 02 48    3F 02 4C    //mono x
			 40 02 58    41 02 5C    //mono y
			 58 02 68    59 02 6C    //mlev x
			 5A 02 78    5B 02 7C    //mlev y
			 FF

//table 04
//!!Error (141): ID 0D out of valid range (00..0C).
  228 * 136	 00 06 01 01 0D 0D 04 01
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail X: Back&Floor, Front, Pillars, 0 //08, 0C, 10, 14
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail Y: Back&Floor, Front, Pillars, 0 //18, 1C, 20, 24
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road X: Back&Floor, Front, Pillars, 0 //28, 2C, 30, 34
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road Y: Back&Floor, Front, Pillars, 0 //38, 3C, 40, 44
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono Y: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev Y: Back&Floor, Front, Pillars, 0 //78, 7C, 80, 84

  229 * 74	 06
			 16 02 08    17 02 0C    08 02 10    //rail x
			 18 02 18    19 02 1C    09 02 20    //rail y
			 30 02 28    31 02 2C    22 02 30    //road x
			 32 02 38    33 02 3C    23 02 40    //road y
			 4A 02 48    4B 02 4C    3C 02 50    //mono x
			 4C 02 58    4D 02 5C    3D 02 60    //mono y
			 64 02 68    65 02 6C    56 02 70    //mlev x
			 66 02 78    67 02 7C    57 02 80    //mlev y
			 FF

//table 05
//!!Error (141): ID 0D out of valid range (00..0C).
  230 * 136	 00 06 01 01 0D 0D 05 01
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail X: Back&Floor, Front, Pillars, 0 //08, 0C, 10, 14
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail Y: Back&Floor, Front, Pillars, 0 //18, 1C, 20, 24
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road X: Back&Floor, Front, Pillars, 0 //28, 2C, 30, 34
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Road Y: Back&Floor, Front, Pillars, 0 //38, 3C, 40, 44...
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mono Y: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev X: Back&Floor, Front, Pillars, 0
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //Mlev Y: Back&Floor, Front, Pillars, 0 //78, 7C, 80, 84

  231 * 98	 06
			 00 02 08    01 02 0C    02 02 10    03 02 14    //rail flat
			 04 02 18    05 02 1C    06 02 20    07 02 24    //rail ramp
			 1A 02 28    1B 02 2C    1C 02 30    1D 02 34    //road flat
			 1E 02 38    1F 02 3C    20 02 40    21 02 44    //road ramp
			 34 02 48    35 02 4C    36 02 50    37 02 54    //mono flat
			 38 02 58    39 02 5C    3A 02 60    3B 02 64    //mono ramp
			 4E 02 68    4F 02 6C    50 02 70    51 02 74    //mlev flat
			 52 02 78    53 02 7C    54 02 80    55 02 84    //mlev ramp
			 FF

//table 06
//!!Error (141): ID 0D out of valid range (00..0C).
  232 * 136	 00 06 01 01 0D 0D 06 01
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail flat: northern end X, northern end Y, southern end X, southern end Y //08, 0C, 10, 14
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //rail ramp: northern end X, northern end Y, southern end X, southern end Y //18, 1C, 20, 24
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //road flat: northern end X, northern end Y, southern end X, southern end Y //28, 2C, 30, 34
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //road ramp: northern end X, northern end Y, southern end X, southern end Y //38, 3C, 40, 44
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //mono flat: northern end X, northern end Y, southern end X, southern end Y 
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //mono ramp: northern end X, northern end Y, southern end X, southern end Y 
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //mlev flat: northern end X, northern end Y, southern end X, southern end Y 
00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00 //mlev ramp: northern end X, northern end Y, southern end X, southern end Y //78, 7C, 80, 84




I added line 109 as the Action 0D for the menu sprite
Line 110 is then that first Action 06
Then the Action 0A, with on line 216 the menu sprite
Line 217 the second Action 06
And finally line 218 the Action 00 Prop 14

But it doesnt work:
Screenie02.png
Screenie02.png (16.46 KiB) Viewed 10272 times
It doesnt show the menu sprite anymore of one of the Tubular Bridges, so thats good ;-)
But not the good menu sprite either… Changing value 68 in line 218 gives strange results (random pieces of the actual bridge)

Any idea what could be wrong?

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 14 Oct 2020 16:44
by wallyweb
I may be wrong about this. I haven't worked on my bridge code in over a year.

Code: Select all

//this reserves some sprites into temp. params
    5 * 9	 0D 00 \D= \DR FE FF 08 69 00 //this "main" param is used to allocate all of the graphics via the following action 6
    6 * 9	 0D 01 \D+ 00 FF 01 00 00 00 //each sprite then gets its own param # to use in the final action 6's which determine placement
    7 * 9	 0D 02 \D+ 00 FF 02 00 00 00
    8 * 9	 0D 03 \D+ 00 FF 03 00 00 00
...
...
Where is the param# for sprite 00?

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 14 Oct 2020 17:14
by wallyweb

Code: Select all

 217 * 5	 06 20 82 06 FF
//!!Error (141): ID 0D out of valid range (00..0C).
//!!Fatal Error (47): Offset 5: Invalid property 14.
  218 * 10	 00 06 01 01 0D 14 68 00 00 00
Move this to after table 6.

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 14 Oct 2020 17:21
by Quast65
I dunno… But it works ;-)

The only thing I understand from bridge-coding is how to replicate the code and what I need to change (ID's) to get more bridges.

Is it possible to add that menu-thing as a separate block?

So, starting with its own 0D, 06, 0A, one sprite, 06 and Action 0 prop 14?

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 14 Oct 2020 17:36
by wallyweb
Quast65 wrote: 14 Oct 2020 17:21 I dunno… But it works ;-)
:D
Is it possible to add that menu-thing as a separate block?
Probably but I don't recommend it.
The reason moving it worked is that it's real sprite was the last one defined in the Action D block.
You now have something that works. Don't mess with success. 8)

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 14 Oct 2020 19:53
by JGR
Preventing towns and AI/GS scripts from building a particular bridge type is easy to implement, so I've gone ahead and added a property to do that.

A GRF which uses the extra bridge IDs, or the menu icon property, or the above property, will only work on sufficiently new patchpack versions.
Users on trunk will just get an unhelpful cryptic error (and then post bug reports, etc).

I'd suggest checking whether these are available using the feature testing mechanism described here, and then falling back to not using them or showing a nicer error message if not.

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 15 Oct 2020 08:18
by Quast65
wallyweb wrote: 14 Oct 2020 17:36 Probably but I don't recommend it.
You now have something that works. Don't mess with success. 8)
Screenie03a.png
Screenie03a.png (493.6 KiB) Viewed 10079 times
:P
Screenie03.png
Screenie03.png (27.03 KiB) Viewed 10079 times
Adding this code-block at the end of every bridge-type worked (indeed, ignore the errors) :

Code: Select all

  229 * 9	 0D 00 \D+ 00 FF 00 00 00 00
  230 * 5	 06 00 02 03 FF
  231 * 5	 0A 01 01 00 00
//Bridge Icon
  232 modular_wider_bridges/gfx/gui_icons.png  8bpp  290     2    43   20   0    0 normal //bridge icon 00
  233 * 5	 06 00 02 06 FF
//!!Error (141): ID 0D out of valid range (00..0C).
//!!Fatal Error (47): Offset 5: Invalid property 14.
  234 * 10	 00 06 01 01 0D 14 00 00 00 00
In the Action0 (in this case line 234), replace 0D with 0E or 0F for the other two extra bridges)

EDIT:
I spoke too soon ;-)
Didnt test it enough, the above code also replaces the first sprite of the bridges with the Menu sprite ;-)
This should work:

Code: Select all

  229 * 9	 0D 00 \D= \DR FE FF 08 01 00
  230 * 5	 06 00 02 03 FF
  231 * 5	 0A 01 01 00 00
//Bridge Icon
  232 modular_wider_bridges/gfx/gui_icons.png  8bpp  340     2    43   20   0    0 normal //bridge icon 00
  233 * 5	 06 00 02 06 FF
//!!Error (141): ID 0D out of valid range (00..0C).
//!!Fatal Error (47): Offset 5: Invalid property 14.
  234 * 10	 00 06 01 01 0D 14 00 00 00 00


JGR wrote: 14 Oct 2020 19:53 Preventing towns and AI/GS scripts from building a particular bridge type is easy to implement, so I've gone ahead and added a property to do that.
That will indeed be very handy (and will give other bridge-designers some more freedom to add unique looking bridges), thnx! :bow:
JGR wrote: 14 Oct 2020 19:53 A GRF which uses the extra bridge IDs, or the menu icon property, or the above property, will only work on sufficiently new patchpack versions.
Users on trunk will just get an unhelpful cryptic error (and then post bug reports, etc).
For now I hope that this will be enough:
Screenie04.png
Screenie04.png (28.04 KiB) Viewed 10079 times

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 15 Oct 2020 08:22
by Quast65
Sources Modular Wider Bridges Set for JGR PatchPack:
modular_wider_bridges_vJGP1_SOURCES.rar
(209.47 KiB) Downloaded 173 times

EDIT:

The code wasnt exactly correct, this should be better:
modular_wider_bridges_vJGP2_SOURCES.rar
(209.47 KiB) Downloaded 178 times

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 15 Oct 2020 13:15
by Quast65
Showing off a bit ;-)
For my personal games I have modified this GRF to show highway graphics with an extra (fake) lane.
Combined with a (completely useless, except for visual pleasure) roadtype that looks like the centre-piece of the Dutch Roadfurniture, you can get these kind of bridges:
Screenie05.png
Screenie05.png (137.57 KiB) Viewed 10000 times
In summer:
Screenie06.png
Screenie06.png (132.24 KiB) Viewed 10000 times
(By using the roadtype I can get the centre of the bridge to appear snow-aware)


Showing what you can do if you place objects next to the middle piece (with just a road, nothing else) to make custom bridges:
Screenie07.png
Screenie07.png (56.27 KiB) Viewed 9990 times

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 15 Oct 2020 13:48
by Quast65
Finally, to show why I REALLY needed these kind of bridges…
Screenie08.png
Screenie08.png (167.45 KiB) Viewed 9983 times
More on this coming (soon) in another thread... :twisted:

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 15 Oct 2020 17:15
by michael blunck
JGR wrote: I'd suggest checking whether these are available using the feature testing mechanism described here [...]
Some time ago, I already included that particular feature into m4nfo, but was lazy in documenting it.

Example for bridge pillars on station tiles:

Code: Select all

grfinit(
    ...
    feature_test(
        feature(STAT_PILLARS) // test if feature 'define pillars on stations' is available
        feature_version(1)
    )
    feature_test(
        feature(PROP_MAPPING) // test if feature 'property mapping' is available
        feature_version(1)
    )
    feature_propertymapping(
        mapping(STAT_PILLARS, {bridge_pillars}) // link user-supplied function 'bridge_pillars' with next available station property
        fallback(0)
    )
)

...

property_mapping({bridge_pillars}) // set up user-supplied function

...

skipif(1, FEATURE, !=, STAT_PILLARS) // don't use it for station IDs 7 .. 9 if feature is not available
setproperties(7 .. 9,
    bridge_pillars(3,3,3,3)
)
OTOH, bridge set developers seem to be notoriously unwilling to give up their inherited nfo copy/paste style. So ... :P

regards
Michael

Re: [OTTD] Modular Wider Bridges Set (v001 on Bananas 13-10-2020)

Posted: 01 Nov 2020 21:06
by JGR
Hope you don't mind, but I went ahead and did a bit of editing of your NFO.

I've added the flags to stop AIs/GSs and towns from building these bridges.
I also added the pillar flags for completeness' sake.
I moved whether to use bridge slots 10-12 or 13-15 to a parameter, such that the GRF works both with trunk and JGRPP.