Contextual Alternates between 3 characters

I’m trying to create contextual alternates between the characters OVE.
I already managed to do the OV and the VE worked separately but with the 3 characters OVE I can’t seem to make it work.
I need the “v” between “o” and “e.alt02” to be “v.alt03”

This is what I have:

sub @o v' by v.alt01;
sub v' e by v.alt02;
sub @o v.alt01 @e' by e.alt02; (this works)
sub @o v.alt01' e.alt02 by v.alt03; (this is not working )

Can someone help me?

I think you’ll need the sub lines in separate lookups. Your code assumes that the changes in the first lines will be taken into account in the last line, but opentype works on all the lines in parallel if they are in the same lookup.

I’m not sure I understand what you mean.
Can you give me an example on how I should write the subs?
Thank you

lookup one{
sub @o v' by v.alt01;
} one;
lookup two{
sub v' e by v.alt02;
} two;


I tried your solution but I can’t make the v.alt03 works. Here’s an image on what I’m trying to achieve:

The ‘ov’ works and and the ‘ve’ also works but the combination of ‘ove’ I can’t make it work. I need it to be ‘o + v.alt03 + v.alt02’

In the first lookup, v is replaced by v.alt01, so the second lookup needs to replace v.alt01 (not v) by v.alt03.

Thank you!
I managed to get what I want with this combinations:

lookup one {
sub @o v' by v.alt01;} one;
lookup two {
sub  v' @e by v.alt02;} two;
lookup three {
sub v.alt02 @e' by e.alt02;} three;
lookup four {
sub v.alt01' @e by v.alt03;} four;
lookup five {
sub v.alt03 @e' by e.alt02;} five;

Is is ok? seems too much combinations but it works!

I think you can make it work with just two lookups.

In the first one, replace the second letter of all two-letter combinations:

lookup RIGHT {
	sub @o v' by v.alt01;
	sub @v e' by e.alt02;

In the second lookup, replace the left letter (which is the result of the first lookup) of all two-letter combinations:

lookup LEFT {
	sub v' @e by v.alt02;
	sub v.alt01' @e by v.alt03;

The class @e contains all variants of e, etc.

My quick recreation: :wink:

Bildschirmfoto 2024-03-28 um 11.10.26

thank you!
Your code didn’t quite worked the way I wanted but I managed to modify like this:

lookup one {
	sub v' e by v.alt02;
	sub v.alt02 e' by e.alt02;
} one;
lookup two {
	sub @o v' by v.alt01;
	sub @o v.alt02' by v.alt03;
} two;