Hi all,
Sorry for the block of code, I had to combine a bunch of commands just to test. I've got a string that defines which commands should be executed (Incoming_Fire). So in this case I would like to run the commands Abil0, Abil1 and Abil2.
The write commands after the for loop starts verifies that the values in the string (0 1 2) and the Loop counter values do show the same value when executing, but the Text Compare of Incoming_Fire containing Loop_Counter Begin Text Compare : [{TXT:Incoming_Fire}] Contains [{TXT:{INT:Loop_Counter}}]
doesn't give me the true result I'm expecting for Loop_Counter =0, Loop_Counter =1, and Loop_Counter =2. I'm assuming it is a type mismatch of some kind, but I can't seem to figure out how to fix this.
Thanks in advance for the advice.
Kind regards,
Markus
Begin Boolean Compare : [Is_in_Space] Equals True
Set Boolean [Red_Alert_State] to True
Set Text [Incoming_Fire] to '0 1 2'
Set Boolean [Incoming_Fire_State] to True
Start Loop While : [Red_Alert_State] Equals True
Play sound, '{VA_SOUNDS}\Star Trek sound\alert24.mp3' (and wait until it completes)
Begin Boolean Compare : [Incoming_Fire_State] Equals True
Start Loop : Repeat From 0 to 22
Write '[Red] {TXT:Incoming_Fire}' to log
Write '[Blue] {INT:Loop_Counter}' to log
Begin Text Compare : [{TXT:Incoming_Fire}] Contains [{TXT:{INT:Loop_Counter}}]
Execute command, '{Abil{INT:Loop_Counter}}' (by name) (and wait until it completes)
Write '[Green] Abil {INT:Loop_Counter}' to log
End Condition
End Loop
End Condition
Set Boolean [Incoming_Fire_State] to False
End Loop
End Condition