Hello I'm very new to making maps and I don't really want to learn I just want to fix one map that I really love. So basicly problem is workers can bug themselves in some location they're not supposed to go and I don't know how to stop it.
Here is video of bug:
Now it should be like this:
Now I know there is a fix for this and I think that I found it in code when I unprotected old FVH map:
I tried adding new trigger to my map and convert it to custom script and it just yells 191 compile errors sooo yeah, that won't work.
in attachments is a .rar with 2 maps
one is fix by me
and other one is original OLD map (version 3.2)
Please help thank you
Here is video of bug:
Now I know there is a fix for this and I think that I found it in code when I unprotected old FVH map:
Code:
//===========================================================================
//===========================================================================
//Trigger:CheckConstructAbility
//===========================================================================
function Trig_CheckConstructAbility_Func003Func013C takes nothing returns boolean
if(not(udg_booleans02[1]==false))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func018C takes nothing returns boolean
if(not(udg_booleans02[2]==false))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func023C takes nothing returns boolean
if(not(udg_booleans02[3]==false))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func028C takes nothing returns boolean
if(not(udg_booleans02[4]==false))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func034Func001C takes nothing returns boolean
if(not(udg_booleans02[GetForLoopIndexA()]==false))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func037Func001C takes nothing returns boolean
if(not(udg_reals01[GetForLoopIndexA()]<udg_real01))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func039Func001Func001Func001Func001C takes nothing returns boolean
if(not(udg_integer01==0))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func039Func001Func001Func001C takes nothing returns boolean
if(not(udg_integer01==4))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func039Func001Func001C takes nothing returns boolean
if(not(udg_integer01==3))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func039Func001C takes nothing returns boolean
if(not(udg_integer01==2))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func039C takes nothing returns boolean
if(not(udg_integer01==1))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003Func040Func001002003 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_UNDEAD)==true)
endfunction
function Trig_CheckConstructAbility_Func003Func040Func002A takes nothing returns nothing
call SetUnitPathing(GetEnumUnit(),false)
set udg_location04=GetUnitLoc(GetEnumUnit())
set udg_location05=PolarProjectionBJ(udg_location04,40.00,AngleBetweenPoints(udg_location01,udg_location04))
call SetUnitX(GetEnumUnit(),GetLocationX(udg_location05))
call SetUnitY(GetEnumUnit(),GetLocationY(udg_location05))
call SetUnitPositionLoc(GetEnumUnit(),udg_location05)
call ShowUnitHide(GetEnumUnit())
call RemoveLocation(udg_location04)
call RemoveLocation(udg_location05)
endfunction
function Trig_CheckConstructAbility_Func003Func040Func005A takes nothing returns nothing
call ShowUnitShow(GetEnumUnit())
call SetUnitPathing(GetEnumUnit(),true)
endfunction
function Trig_CheckConstructAbility_Func003Func040C takes nothing returns boolean
if(not(udg_boolean02==false))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Func003C takes nothing returns boolean
if(not(RectContainsUnit(udg_rect01,udg_units01[udg_integer07])==true))then
return false
endif
return true
endfunction
function Trig_CheckConstructAbility_Actions takes nothing returns nothing
call MoveRectToLoc(udg_rects02[udg_integer07],udg_location02)
call MoveRectToLoc(udg_rect01,udg_location02)
if(Trig_CheckConstructAbility_Func003C())then
set udg_booleans02[1]=true
set udg_booleans02[2]=true
set udg_booleans02[3]=true
set udg_booleans02[4]=true
set udg_boolean02=true
//---------
//right
//treba tam dat este podmienky,lebo mozes tam mat false kere sa potom setne na true
set udg_location01=Location((GetLocationX(udg_location02)+90.00),(GetLocationY(udg_location02)+32.00))
set udg_booleans02[1]=CheckPathability(GetLocationX(udg_location01),GetLocationY(udg_location01))
call RemoveLocation(udg_location01)
if(Trig_CheckConstructAbility_Func003Func013C())then
set udg_location01=Location((GetLocationX(udg_location02)+90.00),(GetLocationY(udg_location02)-32.00))
set udg_booleans02[1]=CheckPathability(GetLocationX(udg_location01),GetLocationY(udg_location01))
call RemoveLocation(udg_location01)
else
endif
//left
set udg_location01=Location((GetLocationX(udg_location02)-90.00),(GetLocationY(udg_location02)+32.00))
set udg_booleans02[2]=CheckPathability(GetLocationX(udg_location01),GetLocationY(udg_location01))
call RemoveLocation(udg_location01)
if(Trig_CheckConstructAbility_Func003Func018C())then
set udg_location01=Location((GetLocationX(udg_location02)-90.00),(GetLocationY(udg_location02)-32.00))
set udg_booleans02[2]=CheckPathability(GetLocationX(udg_location01),GetLocationY(udg_location01))
call RemoveLocation(udg_location01)
else
endif
//top
set udg_location01=Location((GetLocationX(udg_location02)+32.00),(GetLocationY(udg_location02)+90.00))
set udg_booleans02[3]=CheckPathability(GetLocationX(udg_location01),GetLocationY(udg_location01))
call RemoveLocation(udg_location01)
if(Trig_CheckConstructAbility_Func003Func023C())then
set udg_location01=Location((GetLocationX(udg_location02)-32.00),(GetLocationY(udg_location02)+90.00))
set udg_booleans02[3]=CheckPathability(GetLocationX(udg_location01),GetLocationY(udg_location01))
call RemoveLocation(udg_location01)
else
endif
//bot
set udg_location01=Location((GetLocationX(udg_location02)+32.00),(GetLocationY(udg_location02)-90.00))
set udg_booleans02[4]=CheckPathability(GetLocationX(udg_location01),GetLocationY(udg_location01))
call RemoveLocation(udg_location01)
if(Trig_CheckConstructAbility_Func003Func028C())then
set udg_location01=Location((GetLocationX(udg_location02)-32.00),(GetLocationY(udg_location02)-90.00))
set udg_booleans02[4]=CheckPathability(GetLocationX(udg_location01),GetLocationY(udg_location01))
call RemoveLocation(udg_location01)
else
endif
//---------
set udg_reals01[1]=DistanceBetweenPoints(udg_location03,Location((GetLocationX(udg_location02)+64.00),GetLocationY(udg_location03)))
set udg_reals01[2]=DistanceBetweenPoints(udg_location03,Location((GetLocationX(udg_location02)-64.00),GetLocationY(udg_location03)))
set udg_reals01[3]=DistanceBetweenPoints(udg_location03,Location(GetLocationX(udg_location03),(GetLocationY(udg_location02)+64.00)))
set udg_reals01[4]=DistanceBetweenPoints(udg_location03,Location(GetLocationX(udg_location03),(GetLocationY(udg_location02)-64.00)))
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=4
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(Trig_CheckConstructAbility_Func003Func034Func001C())then
set udg_reals01[GetForLoopIndexA()]=9999.00
else
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set udg_integer01=0
set udg_real01=9998.00
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=4
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(Trig_CheckConstructAbility_Func003Func037Func001C())then
set udg_integer01=GetForLoopIndexA()
set udg_real01=udg_reals01[GetForLoopIndexA()]
else
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
//---------
if(Trig_CheckConstructAbility_Func003Func039C())then
set udg_location01=Location((GetLocationX(udg_location02)+96.00),GetLocationY(udg_location03))
else
if(Trig_CheckConstructAbility_Func003Func039Func001C())then
set udg_location01=Location((GetLocationX(udg_location02)-96.00),GetLocationY(udg_location03))
else
if(Trig_CheckConstructAbility_Func003Func039Func001Func001C())then
set udg_location01=Location(GetLocationX(udg_location03),(GetLocationY(udg_location02)+96.00))
else
if(Trig_CheckConstructAbility_Func003Func039Func001Func001Func001C())then
set udg_location01=Location(GetLocationX(udg_location03),(GetLocationY(udg_location02)-96.00))
else
if(Trig_CheckConstructAbility_Func003Func039Func001Func001Func001Func001C())then
call QuestMessageBJ(GetForceOfPlayer(GetOwningPlayer(udg_units01[udg_integer07])),bj_QUESTMESSAGE_UNITACQUIRED,"TRIGSTR_118")
set udg_location01=udg_location03
set udg_boolean02=false
else
endif
endif
endif
endif
endif
if(Trig_CheckConstructAbility_Func003Func040C())then
call IssuePointOrderLocBJ(udg_unit01,"move",udg_location01)
else
set udg_group03=GetUnitsInRangeOfLocMatching(100.00,udg_location01,Condition(function Trig_CheckConstructAbility_Func003Func040Func001002003))
call ForGroupBJ(udg_group03,function Trig_CheckConstructAbility_Func003Func040Func002A)
call SetUnitX(udg_unit01,GetLocationX(udg_location01))
call SetUnitY(udg_unit01,GetLocationY(udg_location01))
call ForGroupBJ(udg_group03,function Trig_CheckConstructAbility_Func003Func040Func005A)
call DestroyGroup(udg_group03)
endif
call RemoveLocation(udg_location02)
call RemoveLocation(udg_location01)
call RemoveLocation(udg_location03)
else
endif
endfunction
I tried adding new trigger to my map and convert it to custom script and it just yells 191 compile errors sooo yeah, that won't work.
in attachments is a .rar with 2 maps
one is fix by me
and other one is original OLD map (version 3.2)
Please help thank you