I have an IF statement within an action definition that errors when the script tries to compile (when I try to save).
The error is "Expected a Boolean expression".
The weird part is that the line it is referring to is a condition that adds two integers to see if when added they are greater then a constant integer.
Why would a condition without a Boolean expect a Boolean expression?
Full trigger: Keep in mind the trigger is still a work in progress.
Loot-GenerateOptions:ActionReturnType:(None)ParametersGrammarText:Loot-Generate()HintText:(None)CustomScriptCodeLocalVariablesnItems=0<Integer>PreviousItem=0<Integer[3]>i=1<Integer>ActionsGeneral-Pickeachintegerfrom1toLoot-nRegions,anddo(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfAndConditions((Triggeringunit)isinLoot-Region[(Pickedinteger)])==TrueRegion-Difficulty[(Pickedinteger)]==1ThenGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Inventory-TotalItems+nItems)>Inventory-cMaxSlotsThenVariable-SetnItems=((Inventory-TotalItems+nItems)-Inventory-cMaxSlots)General-Repeat(Actions)nItemstimesActionsVariable-SetLoot-Item=(Randomintegerbetween0and3)Variable-SetLoot-Quantity=(Randomintegerbetween1andLoot-MaxQuantity)General-If(Conditions)thendo(Actions)elsedo(Actions)IfAndConditionsLoot-Item!=PreviousItem[1]Loot-Item!=PreviousItem[2]Then------- Displays the quantity and name of the item found.UI-Display(Combine((Text(Loot-Quantity))," ",Items-Items[Loot-Item].Name))for(Playergroup((Triggeringplayer)))toSubtitleareaVariable-SetPreviousItem[i]=Loot-ItemVariable-Modifyi:+1Trigger-RunLoot-AddtoInventory(CheckConditions,Don't Wait until it finishes)ElseElseVariable-SetnItems=(Randomintegerbetween1and3)General-Repeat(Actions)nItemstimesActionsVariable-SetLoot-Item=(Randomintegerbetween0and3)Variable-SetLoot-Quantity=(Randomintegerbetween1andLoot-MaxQuantity)General-If(Conditions)thendo(Actions)elsedo(Actions)IfAndConditionsLoot-Item!=PreviousItem[1]Loot-Item!=PreviousItem[2]ThenUI-Display(Combine((Text(Loot-Quantity))," ",Items-Items[Loot-Item].Name))for(Playergroup((Triggeringplayer)))toSubtitleareaUnit-Removeinventoryitem(Triggeringinventoryitem)Variable-SetPreviousItem[i]=Loot-ItemVariable-Modifyi:+1Trigger-RunLoot-AddtoInventory(CheckConditions,Don't Wait until it finishes)ElseElseUI-Display"Not in Region"for(Allplayers)toErrorarea
I have an IF statement within an action definition that errors when the script tries to compile (when I try to save).
The error is "Expected a Boolean expression".
The weird part is that the line it is referring to is a condition that adds two integers to see if when added they are greater then a constant integer.
"(Inventory - Total Items + nItems) > Inventory - cMax Slots"
Why would a condition without a Boolean expect a Boolean expression?
Full trigger: Keep in mind the trigger is still a work in progress.