line_class := class<concrete>:
@editable
Title : string = "Title"
@editable
Description : string = "Message"
@editable
Decisions : []decision_class = array{}
@editable
Camera : gameplay_camera_fixed_point_device = gameplay_camera_fixed_point_device{}
@editable
Trigger : trigger_device = trigger_device{}
@editable
PopUpDialog : popup_dialog_device = popup_dialog_device{}
# A Verse-authored creative device that can be placed in a level
hello_world_device := class(creative_device):
var Players : [] player = array {}
@editable
Button : button_device = button_device{}
@editable
MyLines:[]line_class = array{}
var CurrentLine : int = 0
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
Button.InteractedWithEvent.Subscribe(StartDialogue)
StrToMsg<localizes>(S : string) : message = "{S}"
StartDialogue(Agent : agent) : void =
set CurrentLine = 0
Initialization(CurrentLine, Agent)
Initialization(LineNumber : int, Agent : agent) : void =
LineNow : line_class = MyLines[LineNumber]
Title : message = StrToMsg(LineNow.Title)
Description : message = StrToMsg(LineNow.Description)
PopUp : popup_dialog_device = LineNow.PopUpDialog
Decisions : []decision_class = LineNow.Decisions
PopUp.SetTitleText(Title)
PopUp.SetDescriptionText(Description)
for (Index := 0..Decisions.Length-1):
DecisionNow : decision_class = Decisions[Index]
PopUp.SetButtonText(StrToMsg(DecisionNow.Text), Index)
PopUp.Show(Agent)
PopUp.RespondingButtonEvent.Subscribe(DecisionMade)
In this code I have array “MyLines” of line_class
When I’m trying to refernce one of the elements in “Initialization” function using MyLine[LineNumber] compiler says that I’m trying to call a function with “decides” effect. How to fix it?