Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow var 61 in CB 10 (Visual effect) #6137

Closed
DorpsGek opened this issue Oct 10, 2014 · 2 comments
Closed

Allow var 61 in CB 10 (Visual effect) #6137

DorpsGek opened this issue Oct 10, 2014 · 2 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

George opened the ticket and wrote:

R26976

Var 61 Query variable of n-th vehicle in chain has a limitation. It is not supported during a callback that is used to modify vehicle properties to avoid circular dependencies, which currently limits this variable to callbacks 1D, 2D, 31 and 32 plus outside callback scope.
Unfortunately, in xUSSR set most Electric engines/EMUs have different orientation (backward, forward) of graphics depending on vehicles nearby. With var 61 it is easily checked. But visual effects (spark) should be located according to graphics (front|rear part). But the same code with var 61 does not work in this case.
It is required to allow var 61 inside visual effect callback.

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/6137
@DorpsGek
Copy link
Member Author

frosch wrote:

Callback 10 modifies properties. As such it may not use variable 61.

However, I think you can achieve your goal by positioning the sprites using 160, which does not modify properties and thus can access variable 61 (since r26988).

The NML docs are not quite up to date, but there is an example in FISH:
Search for "create_effect" and "effect_spawning_model" in http://bundles.openttdcoop.org/fish/push/v5395-339/fish.nml

Extract:
switch (FEAT_SHIPS, SELF, provence_edibles_tanker_create_visual_effect, [STORE_TEMP(create_effect(EFFECT_SPRITE_DIESEL, 8, 0, 18), 0x100)]) {
return 1;
}

item(FEAT_SHIPS, provence_edibles_tanker, 1280) {
property {
effect_spawn_model: EFFECT_SPAWN_MODEL_STEAM;
}
graphics {
create_effect: provence_edibles_tanker_create_visual_effect;
}
}

Short summary:
http://old-paste.openttdcoop.org/show/3639/


This comment was imported from FlySpray: https://bugs.openttd.org/task/6137#comment13555

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Implemented

differently


This comment was imported from FlySpray: https://bugs.openttd.org/task/6137

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Vehicles labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant