The following script fails to compile with the error: "Initialize is not a function or does not exist"
Spoiler
Function Initialize(Int pColNum) Cells = new ObjectReference[8] ColNum = pColNum Int Counter = 0 While (Counter < 8) If((pColNum % 2) == 0) If((Counter %2) == 0) Cells[Counter] = Self.PlaceAtMe(CTG_ChessBoardBlackCell) Cells[Counter].MoveTo(Self,0,Counter * 50,10) Cells[Counter].Initialize(False) Else Cells[Counter] = Self.PlaceAtMe(CTG_ChessBoardWhiteCell) Cells[Counter].MoveTo(Self,0,Counter * 50,10) Cells[Counter].Initialize(True) EndIf Else If((Counter %2) == 0) Cells[Counter] = Self.PlaceAtMe(CTG_ChessBoardWhiteCell) Cells[Counter].MoveTo(Self,0,Counter * 50,10) Cells[Counter].Initialize(True) Else Cells[Counter] = Self.PlaceAtMe(CTG_ChessBoardBlackCell) Cells[Counter].MoveTo(Self,0,Counter * 50,10) Cells[Counter].Initialize(False) EndIf EndIf EndWhileEndFunction
The following script, attached to both "CTG_ChessBoardBlackCell" and "CTG_ChessBoardWhiteCell", defines the function "Initialize".
Spoiler
Scriptname CTG_ChessBoardCellScript extends ObjectReference Int FigureBool WhiteFunction Initialize(Bool pWhite) White = pWhite Figure = 0EndFunctionBool Function IsWhite() Return WhiteEndFunctionFunction SetFigure(Int pFigure) Figure = pFigureEndFunctionInt Function GetFigure() Return FigureEndFunction
Any Idea why this is not working?
