Query unit action - max charges flag wrong
Posted: Thu Oct 27, 2016 11:01 pm
It seems in the query unit action, the max charges parameter actually returns the max charges + 1. I'm trying to script it so that starting artifacts are maxed out on charges (the artifacts normally have a random range of charges). However, I keep ending up with having one more charge than the max. I added a debug flag to check what was going on and got:
@game_time 160 (0:05) ### MA [quni] chrg? trigger
@game_time 160 (0:05) ### MA [quni] chrg? succeeded
@game_time 160 (0:05) ### MA [quni] chrg? deactivated
@game_time 160 (0:05) ### MA [math] chrg math trigger
@game_time 160 (0:05) ### MA [math] chrg math 4.000000 - 2.000000 = 2.000000
@game_time 160 (0:05) ### MA [math] chrg math succeeded
@game_time 160 (0:05) ### MA [math] chrg math deactivated
@game_time 160 (0:05) ### MA [ctrl] add chrg trigger
@game_time 160 (0:05) ### MA [ctrl] add chrg succeeded
@game_time 160 (0:05) ### MA [ctrl] add chrg deactivated
Script is just a query unit with max charges and current charges, math action pulls those numbers and subtracts current from max, then feeds result to a ctrl to add that amount of charges. The above is from an artifact with a max of 3 charges (same result of max+1 for all the other artifacts).
I should be able to work around it with another math action, just wanted to point out the bug.
@game_time 160 (0:05) ### MA [quni] chrg? trigger
@game_time 160 (0:05) ### MA [quni] chrg? succeeded
@game_time 160 (0:05) ### MA [quni] chrg? deactivated
@game_time 160 (0:05) ### MA [math] chrg math trigger
@game_time 160 (0:05) ### MA [math] chrg math 4.000000 - 2.000000 = 2.000000
@game_time 160 (0:05) ### MA [math] chrg math succeeded
@game_time 160 (0:05) ### MA [math] chrg math deactivated
@game_time 160 (0:05) ### MA [ctrl] add chrg trigger
@game_time 160 (0:05) ### MA [ctrl] add chrg succeeded
@game_time 160 (0:05) ### MA [ctrl] add chrg deactivated
Script is just a query unit with max charges and current charges, math action pulls those numbers and subtracts current from max, then feeds result to a ctrl to add that amount of charges. The above is from an artifact with a max of 3 charges (same result of max+1 for all the other artifacts).
I should be able to work around it with another math action, just wanted to point out the bug.