The m4nfo User manual and Technical Report

Bridges

Defining properties for and handling of bridges

Introduction

The code for bridges consists of three parts:

The definition sets the feature properties of a bridge ID (length, price, max speed, ...). Please note that a bridge definition may only occur after a prior grfinit() function call for the newGRF file.

The bridge's layout functions are used to allocate graphics sprites for the various bridge types and segments.

The bridge's graphics are supplied by use of one or more spriteblock() functions, overriding original TTD sprites, most probably those of the toyland climate.

Functions

FunctionMeaning
definebridge(<ID>, <block>)Bridge definition
layout(<ID>, <block>)Layout definition

Description

definebridge(<ID>, <block>)

This function defines a bridge. Its parameter is a fixed ID, and a block of property-defining functions, where the relative position of the property functions is irrelevant. Note that bridges have fixed IDs, in contrast to other features.

Example:
definebridge(0,
	intro(1950)
	minlength(3)
	maxlength(9)
	price(50)
	maxspeed(80 km/h)
	flags(NOFARPILLARS)
	purchasetext(_ptext)
	bridgerailtext(_railtext)
	bridgeroadtext(_roadtext)
)

References