View Full Version : Comparing two keyvalues

30-11-2010, 03:05 AM
Trigger_conditional can only compare a keyvalue to a constant number, and not another keyvalue. Trying to change trigger_condition's special keyvalues in game will just give you an error in the console. Also, trigger_copyvalue cannot use its modifiers (addition, subtraction etc.) so it's not that easy to compare two keyvalues with only a few entities.

Below is a test map with an entity system that can compare two keyvalues and trigger different objects depending on the result (value1 < value2, value1 > value2, value1 = value2). Since it uses game_counters to actually count up to the values, it takes a while to complete the test (about two seconds for a value of 100). The two trigger_copyvalue entities are what set the keyvalues to test and the name of multimanager closest to the button initiates the comparison.

The basic idea is that if you want to compare keyvalues, you'll have to use a system like this since trigger_conditional cannot do this, currently.

30-11-2010, 08:22 AM
i think this already was addressed in the beta forums and will be fixed in the next version.

30-11-2010, 11:52 AM
Yeah we realized that all of it could be much more useful and started optimizing it.
Copyvalue, changevalue and condition will be more useful, less buggy and not leak memory anymore.