WeiDUorg / weidu

WeiDU is a program used to develop, distribute and install modifications for games based on the Infinity Engine.
http://www.weidu.org
GNU General Public License v2.0
90 stars 20 forks source link

Allow use of variables in FLAGS parameter for dialog transitions #125

Closed Argent77 closed 5 years ago

Argent77 commented 6 years ago

EE games provide additional flags that can be used in dialog transitions. WeiDU allows you to set these flags by the FLAGS feature. But currently it is only possible to specify a single literal number as argument.

Since these flags correspond to individual bits, it would be helpful to use one or more of the predefined BITx constants (or maybe a mix of numbers and variables), as outlined in the example below.

Example:

IF ~~ Test
  SAY ~Statement...~
  ++ ~Reply 1~ DO ~SetGlobal("x","GLOBAL",1)~ FLAGS 512 + Test1           // Allowed
  ++ ~Reply 2~ DO ~SetGlobal("x","GLOBAL",1)~ FLAGS BIT9 + Test2          // NOT allowed
  ++ ~Reply 3~ DO ~SetGlobal("x","GLOBAL",1)~ FLAGS (BIT9+BIT10) + Test3  // Also NOT allowed
END

Alternatively, adding new keywords for the flags "Execute immediate" (bit9) and "Clear actions" (bit 10) might be a solution.

FredrikLindgren commented 6 years ago

I'm going to have to refer you to using TP2 variables in the D and compiling with EVAL. D has no concept of variables, to say nothing of arithmetic.