Hi, I work on a unit editor, and i have a very strange error then i change "unit.script". This code work fine : Code: var bCheckBuilding : Boolean; if (objprop.sid='pikeman') then begin objbase.maxhp := 90; SetObjBaseWeapon(objprop, objbase, 0, 8, 0, 35, 100, 0, 100000, gc_obj_weapon_kind_pike, True); SetObjBasePrice(objbase, 25, 0, 0, 3, 20, 0); SetObjBaseProtection(objbase, 3, 2, 4, 210, {7}6, 40); SetObjBaseMaterialCanKill(objprop, gc_obj_material_body, gc_obj_material_body, gc_obj_material_woodwall, 0, 0, 0); SetObjBaseSearchBuildVisionScore(objprop, objbase, 700, 144, 1, 10); objprop.bstandground := True; objprop.usage := gc_obj_usage_lightinfantry; objprop.aiforce := 10; objprop.walkintervalfactor := cWalkIntervalInf; end; if (not bCheckBuilding) then //unit found begin objprop.bprotector := not objprop.bcapture; objprop.bcancapture := (not objprop.bcapture) and (objprop.usage<>gc_obj_usage_peasant); end; but this code (difference in bold) Code: var bCheckBuilding : Boolean; if (objprop.sid='pikeman') then begin objbase.maxhp := 90; SetObjBaseWeapon(objprop, objbase, 0, 8, 0, 35, 100, 0, 100000, gc_obj_weapon_kind_pike, True); SetObjBasePrice(objbase, 25, 0, 0, 3, 20, 0); SetObjBaseProtection(objbase, 3, 2, 4, 210, {7}6, 40); SetObjBaseMaterialCanKill(objprop, gc_obj_material_body, gc_obj_material_body, gc_obj_material_woodwall, 0, 0, 0); SetObjBaseSearchBuildVisionScore(objprop, objbase, 700, 144, 1, 10); objprop.bstandground := True; objprop.usage := gc_obj_usage_lightinfantry; objprop.aiforce := 10; objprop.walkintervalfactor := cWalkIntervalInf; end else bCheckBuilding := True; end; if (not bCheckBuilding) then //unit found begin objprop.bprotector := not objprop.bcapture; objprop.bcancapture := (not objprop.bcapture) and (objprop.usage<>gc_obj_usage_peasant); end; Raise an "unknow name" at line "if (not bCheckBuilding) then". Anobody can explain me the reasons of this error?
Code: var bCheckBuilding : Boolean; if (objprop.sid='pikeman') then begin objbase.maxhp := 90; SetObjBaseWeapon(objprop, objbase, 0, 8, 0, 35, 100, 0, 100000, gc_obj_weapon_kind_pike, True); SetObjBasePrice(objbase, 25, 0, 0, 3, 20, 0); SetObjBaseProtection(objbase, 3, 2, 4, 210, {7}6, 40); SetObjBaseMaterialCanKill(objprop, gc_obj_material_body, gc_obj_material_body, gc_obj_material_woodwall, 0, 0, 0); SetObjBaseSearchBuildVisionScore(objprop, objbase, 700, 144, 1, 10); objprop.bstandground := True; objprop.usage := gc_obj_usage_lightinfantry; objprop.aiforce := 10; objprop.walkintervalfactor := cWalkIntervalInf; end else begin bCheckBuilding := True; end; if (not bCheckBuilding) then //unit found begin objprop.bprotector := not objprop.bcapture; objprop.bcancapture := (not objprop.bcapture) and (objprop.usage<>gc_obj_usage_peasant); end; end requires begin - either you remove end or add begin