Closed armoha closed 9 months ago
var a = (A == B) && (C == D) && (E == F); // OK
var b = (A == B); // orphan condition error
We won't fix second case to work, so IMO both syntaxes should be disallowed as well for consistency. (This would break some EUD Editor codes btw...)
Ofc we don't have bool type yet.
Summary of
unusualCondition usages:const s = StringBuffer(); const cache1 = Accumulate(CurrentPlayer, Exactly, ~0, Ore); const cache2 = Bring(CurrentPlayer, Exactly, ~0, "Artanis", "loc"); const cache3 = MemoryEPD(EPD(array) + cp, Exactly, ~0); if (cache1 && cache2 && cache3) {} else { const my_mineral = dwread_epd(EPD(0x57F0F0) + cp); const arta_count = EUDBinaryMax(function(x) { return l2v(Bring(CurrentPlayer, Exactly, x, "Artanis", "loc")); }, maxv=1700); const array_cp = array[cp]; SetMemory(cache1 + 8, SetTo, my_mineral); SetMemory(cache2 + 8, SetTo, arta_count); SetMemory(cache3 + 8, SetTo, array_cp); s.insert(0); s.append("This text only updates when any of these changes; ore ({}), Artanis count ({}), array member ({})", my_mineral, arta_count, array_cp); } s.Display();
Failed usages:
Condition arithmetics
Return condition
Orphan condition error due to eudplib's low-level-ness
(WIP) For users, orphan condition error is hard to fix; error raises in late phase, and error message does not tell where the errorneous code is.
Potential ambiguity if we allow condition arithmetics