Skip to content

Reversing a consist, with animated functions using carIndex produces unexpected resuts #1225

@leezer3

Description

@leezer3

Description

Create a train with multiple cars and an exterior animated object using any function which takes a carIndex, e.g.

accelerationMotor[0] != 0

Use this train, either in a TFO with the reversed property set, a reversed route, or with the initial reversed consist set.

Despite the fact that the train is now reversed, (CarIndex0 is now CarIndexN) the function actually refers to the original car index.

This one may be a little tricky to actually fix.
I think the 'fix' has to be applied in the function script, but it'd be a massive switch case to deal with this.

Still thinking; we might be able to 'move' the Index functions to a high numbering state in https://github.com/leezer3/OpenBVE/blob/master/source/OpenBveApi/FunctionScripts/Instructions.cs so that we can do a simple greater than on the operators, but I don't especially like that....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions