I would like to change the score points given to players depending on the weapon they have when they win. (with conditional_button_device(GetItemCount))
However, I cannot use if to compare the conditional_button_device extracted from tag and the corresponding conditional_button_device. (It will be a red wavy line.)
Isn’t it possible to use “if” to determine if creative_device is what it is?
condition_tag := class(tag){}
---
---
@editable
conditional_10_1 : conditional_button_device = conditional_button_device{}
#There are many others...
---
---
WinnerJudge(Agent:agent):void=
Print("I am Winner")
Conditons := GetCreativeObjectsWithTag(condition_tag{})
for (Obj : Conditons):
if (Condition_Button := conditional_button_device[Obj]):
Counts_ := Condition_Button.GetItemCount(Agent, 0)
if (Condition_Button:conditional_button_device = conditional_10_1:conditional_button_device): # <----# Red wavy line...
Points : int = 10
ScoreAward(Agent, Points)
This line already checks if the Obj is a conditional button. Because you are casting that obj into a conditional button, the if statement will only complete if that obj is a conditional button.
if (Condition_Button := conditional_button_device[Obj]):
So there is no need to do this
if (Condition_Button:conditional_button_deviceconditional_10_1:conditional_button_device):