anchor.diff:  
   var
     fScripting: TKMScripting;
  +
  +
  +const VALID_GLOBAL_VAR_TYPES: set of TPSBaseType = [
  +  btU8, btS32, btSingle,
  +  btStaticArray, btArray,
  +  btRecord];
   
   
   implementation
  
positive.code:       btS32: LoadStream.Read(tbts32(Src^)); //Integer
        btSingle: LoadStream.Read(tbtsingle(Src^));
        btStaticArray:begin
                        LoadStream.Read(ArrayCount);
                        Assert(ArrayCount = TPSTypeRec_StaticArray(aType).Size, 'Script array element count mismatches saved count');
                        for I:=0 to ArrayCount-1 do
                        begin
                          Offset := TPSTypeRec_Array(aType).ArrayType.RealSize * I;
                          LoadVar(Pointer(IPointer(Src) + Offset), TPSTypeRec_Array(aType).ArrayType);
                        end;
                      end;
        btArray:      begin
                        LoadStream.Read(ArrayCount);
                        PSDynArraySetLength(Pointer(Src^), aType, ArrayCount);
                        for I:=0 to ArrayCount-1 do
                        begin
                          Offset := TPSTypeRec_Array(aType).ArrayType.RealSize * I;
                          LoadVar(Pointer(IPointer(Src^) + Offset), TPSTypeRec_Array(aType).ArrayType);
                        end;
                      end;
        //Already checked and reported as an error in LinkRuntime, no need to crash it here
        //else Assert(False);
      end;
  
negative.code:     I: Integer;
      Offset: Cardinal;
    begin
      //Check against our set of allowed types
      if not (aType.BaseType in VALID_GLOBAL_VAR_TYPES) then
      begin
        Result := 'Unsupported global variable type ' + IntToStr(aType.BaseType) + ': ' + aType.ExportName + '|';
        Exit;
      end;
      //Check elements of arrays/records are valid too
      case aType.BaseType of
        btArray,
        btStaticArray: Result := ValidateVarType(TPSTypeRec_Array(aType).ArrayType);
        btRecord: begin
                    Result := '';
                    for I:=0 to TPSTypeRec_Record(aType).FieldTypes.Count-1 do
                    begin
                      Result := Result + ValidateVarType(TPSTypeRec_Record(aType).FieldTypes[I]);
                    end;
                  end;
      end;
    end;
  
  