I think there's a much easier way to do this. The VBScript functions "Eval" and "Execute".
Since VBScript is an interpreted language, rather than compiled, you can write code as a string and simply call Eval or Execute on it to have it run. For example:
dim a, b, c
b = 15
c = 10
a = "b > c AND c = 10"
msgbox Eval(a)
Will throw up a messagebox saying "True", since b is greater than c and c is equal to 10.
The upshot of this is that you can use this to write your conditions in the textbox. For example, instead of:
#COND 1=0
Oh woe is me, I have lost my wedding ring! Who are you? %PLAYER%? Can you help me find my ring, %PLAYER%?
#COND 1=1
You found it! Thank you so much.
#COND 1=2
Thanks again for finding my ring, %PLAYER%!
you could write:
#COND
dim PROGRESS
PROGRESS = ProjectObj.GamePlayer.InvQuantityOwned(1)
select case PROGRESS
case 0
msg = "Oh woe is me, I have lost my wedding ring! Who are you? %PLAYER%? Can you help me find my ring, %PLAYER%?"
case 1
msg = "You found it! Thank you so much."
case else
msg = "Thanks again for finding my ring, %PLAYER%!"
end select
And the code would be quite simple, something along the lines of:
Sub Player_OnSpecialFunction(SpecialObj)
If SpecialObj.FuncType = 1 AND left(SpecialObj.Value,7) = "#COND" + vbcrlf
dim tmp, msg
tmp = mid (SpecialObj.Value,8)
Execute(tmp)
ShowMessage(msg)
End if
End Sub
Sub ShowMessage(msg)
msg = Replace(msg,"%PLAYER%",PlayerName) 'Insert Players name where appropriate
msg = Replace(msg,"%GOLD%",ProjectObj.GamePlayer.InvQuantityOwned(2)) 'Insert current amount of gold where appropriate
'etc....
dim msgSpecial
Set msgSpecial = NewSpecialFunction
msgSpecial.funcType = 1
msgSpecial.Value = msg
ProjectObj.GamePlayer.ActivateFunction(msgSpecial)
End Sub
Something like that anyway. It may look confusing, but most of the code is just copy and paste. All you would need to change is the case numbers and the messages. Also, in VBScript, you can check for multiple values or ranges using case statements. For example:
select case PROGRESS
case 1, 7
msg = "Message for when PROGRESS = 1 or 7"
case 2 to 6
msg = "Message for when PROGRESS is either 2, 3, 4, 5, or 6"
case else
msg = "Message for when PROGRESS is greater than 7"
end select
You can also check for multiple variables, like you asked. However, you would need to use if statements in that case, instead of case statements. Or, if you want, you could use both:
#COND
dim PROGRESS, RING
PROGRESS = HostObj.GamePlayer.InvQuantityOwned(1)
RING = HostObj.GamePlayer.InvQuantityOwned(6)
select case PROGRESS
case 0
msg = "Message 1"
case 1
msg = "Message 2"
case 2
if (RING = 0) then
msg = "Message 3a (No Ring)"
else
msg = "Message 3b (Ring)"
case else
msg = "Message for all other occasions"
end select