Difference between revisions of "Callback: Visual effect and wagon power"
m (Create a separate page for each callback) |
Planetmaker (talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Visual effect and wagon power (10) == |
== Visual effect and wagon power (10) == |
||
+ | {{CB|features=trains, road vehicles, ships|purchase=no|result=selected effect|fail=default properties}} |
||
+ | |||
This callback is used to determine the visual effect to use for a vehicle and whether a train wagon is powered (adding power and weight to the train). |
This callback is used to determine the visual effect to use for a vehicle and whether a train wagon is powered (adding power and weight to the train). |
||
Line 5: | Line 7: | ||
The 'powered wagon'-flag only applies for train wagons that would by default be powered (i.e. property 1B is set). |
The 'powered wagon'-flag only applies for train wagons that would by default be powered (i.e. property 1B is set). |
||
− | The visual effect applies to all train vehicles ( |
+ | The visual effect applies to all train vehicles ({{ottd|1.1|r21238}} Since OpenTTD r21238 for road vehicles and ships as well). |
The callback is only called when loading a game, when the train reverses, or when rearranging the train in a depot. |
The callback is only called when loading a game, when the train reverses, or when rearranging the train in a depot. |
||
− | In OpenTTD the 'visual effect' is also updated when the vehicle enters track of a different railtype. The 'powered wagon'-flag may not change in that case. |
+ | {{ottd| }} In OpenTTD the 'visual effect' is also updated when the vehicle enters track of a different railtype. The 'powered wagon'-flag may not change in that case. |
If the callback fails for any reason (e.g. not defined, action 2 does not return callback result etc.), the value of the corresponding action 0 property ( [[Action0Trains#Visual effects and wagon power 22|train property 22]], [[Action0RoadVehicles#Visual effect 21|road vehicle property 21]], [[Action0Ships#Visual effect 1C|ship property 1C]] ) is used instead. For possible return values, refer to these properties as well. |
If the callback fails for any reason (e.g. not defined, action 2 does not return callback result etc.), the value of the corresponding action 0 property ( [[Action0Trains#Visual effects and wagon power 22|train property 22]], [[Action0RoadVehicles#Visual effect 21|road vehicle property 21]], [[Action0Ships#Visual effect 1C|ship property 1C]] ) is used instead. For possible return values, refer to these properties as well. |
Latest revision as of 23:16, 3 August 2011
Visual effect and wagon power (10)
Features: | trains, road vehicles, ships |
Purchase list | no |
Variable 10 | n/a |
Variable 18 | n/a |
Result | selected effect |
Fail result means | default properties |
Return registers | n/a |
This callback is used to determine the visual effect to use for a vehicle and whether a train wagon is powered (adding power and weight to the train).
The 'powered wagon'-flag only applies for train wagons that would by default be powered (i.e. property 1B is set).
The visual effect applies to all train vehicles (1.1 Since OpenTTD r21238 for road vehicles and ships as well).
The callback is only called when loading a game, when the train reverses, or when rearranging the train in a depot.
In OpenTTD the 'visual effect' is also updated when the vehicle enters track of a different railtype. The 'powered wagon'-flag may not change in that case.
If the callback fails for any reason (e.g. not defined, action 2 does not return callback result etc.), the value of the corresponding action 0 property ( train property 22, road vehicle property 21, ship property 1C ) is used instead. For possible return values, refer to these properties as well.