Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/simutrans/pak128
Browse files Browse the repository at this point in the history
  • Loading branch information
prissi committed Jun 2, 2024
2 parents 6d1b305 + baa93bc commit 38c2308
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
20 changes: 14 additions & 6 deletions pak128.prototype/scenario/tutorial/class/class_basic_chapter.nut
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,8 @@ class basic_chapter
}

function all_control(result, wt, way, ribi, tool_id, pos, coor, plus = 0){
local t = tile_x(coor.x, coor.y, coor.z)
local brig = t.find_object(mo_bridge)
if ((tool_id==tool_remove_way)||(tool_id==tool_remover)){
if (way && way.get_waytype() != wt)
return result
Expand All @@ -1742,14 +1744,14 @@ class basic_chapter
}
}
else if (r_way.l)
return translate("The track is stuck, use the [Remove] tool here!")+" ("+coor.tostring()+")."
return translate("The track is stuck, use the [Remove] tool here!")+" ("+coord3d_to_string(t)+")."

//Control para que los puentes funcionen bien
bridge_control(way, tool_id)
if (bridge_sw){
return null
}
else if ((pos.x == coor.x && pos.y == coor.y && pos.z == coor.z)||(cursor_sw)){
else if ((pos.x == t.x && pos.y == t.y && pos.z == t.z)||(cursor_sw)){
if (tool_id==tool_build_way || tool_id==tool_build_tunnel){
if ((ribi==0) || (ribi==1) || (ribi==2) || (ribi==4) || (ribi==8)){
return null
Expand All @@ -1760,20 +1762,26 @@ class basic_chapter
if (under_lv != norm_view){
local sq = square_x(pos.x,pos.y)
local sq_z = sq.get_ground_tile().z
local c_test = sq.get_tile_at_height(coor.z+plus)
if((!c_test || !way) && under_lv <= coor.z && pos.z < sq_z){
local c_test = sq.get_tile_at_height(t.z+plus)
if((!c_test || !way) && under_lv <= t.z && pos.z < sq_z){
return null
}
}

return translate("No intersections allowed")+" ("+pos.tostring()+")."
}
}
else
return translate("Action not allowed")+" ("+pos.tostring()+")."
}
else if(brig) {
if (tool_id==tool_build_way) {
if ((ribi==0) || (ribi==1) || (ribi==2) || (ribi==4) || (ribi==8)){
return null
}
}
}
else{
return translate("Connect the Track here")+" ("+coord3d(coor.x, coor.y, coor.z).tostring()+")."
return translate("Connect the Track here")+" ("+coord3d(t.x, t.y, t.z).tostring()+")."
}

return ""
Expand Down
17 changes: 10 additions & 7 deletions pak128.prototype/scenario/tutorial/class/class_chapter_03.nut
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class tutorial.chapter_03 extends basic_chapter
//Para el puente
//------------------------------------------------------------------------------------------
c_bway_lim2 = {a = coord(68,18), b = coord(68,23)}
c_brge2 = {a = coord(68,19), b = coord(68,22)}
c_brge2 = {a = coord3d(68,19,2), b = coord3d(68,22,2)}
brge2_z = 0
//-------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -1535,7 +1535,7 @@ class tutorial.chapter_03 extends basic_chapter
else if(tool_id==tool_build_way)
return translate("Connect the Track here")+" ("+r_way.c.tostring()+")."
}
//Construye Pediente recta
//Construye Pendiente recta
if (pot0==1 && pot1==0){
if ((pos.x==slope1.c.x)&&(pos.y==slope1.c.y)){
if (tool_id==4100){
Expand Down Expand Up @@ -1575,6 +1575,8 @@ class tutorial.chapter_03 extends basic_chapter
//Segundo tramo de rieles
if (pot3==1&&pot4==0){
if (pos.x>=st2_way_lim.a.x && pos.y>=st2_way_lim.a.y && pos.x<=st2_way_lim.b.x && pos.y<=st2_way_lim.b.y){
if(tool_id==tool_build_bridge)
return result
return all_control(result, gl_wt, way, ribi, tool_id, pos, r_way.c)
}
if (pos.x>=bord2_lim.a.x && pos.y>=bord2_lim.a.y && pos.x<=bord2_lim.b.x && pos.y<=bord2_lim.b.y){
Expand Down Expand Up @@ -1697,8 +1699,10 @@ class tutorial.chapter_03 extends basic_chapter
//Construye un puente
else if (pot0==1 && pot1==0){
if (pos.x>=c_bway_lim2.a.x && pos.y>=c_bway_lim2.a.y && pos.x<=c_bway_lim2.b.x && pos.y<=c_bway_lim2.b.y){
if(tool_id==tool_build_way)
if(tool_id==tool_build_way){
if(pos.z < c_brge2.a.z && slope ==0) return all_control(result, gl_wt, way, ribi, tool_id, pos, r_way.c)
return null
}
if(tool_id==tool_build_bridge){
if(pos.z==brge2_z)
return null
Expand All @@ -1711,17 +1715,16 @@ class tutorial.chapter_03 extends basic_chapter
//Segundo tramo de rieles
if (pot1==1&&pot2==0){
if (pos.x>=st4_way_lim.a.x && pos.y>=st4_way_lim.a.y && pos.x<=st4_way_lim.b.x && pos.y<=st4_way_lim.b.y){

return all_control(result, gl_wt, way, ribi, tool_id, pos, r_way.c)

if(tool_id==tool_build_bridge)
return result
return all_control(result, gl_wt, way, ribi, tool_id, pos, r_way.c)
}
if (pos.x>=bord4_lim.a.x && pos.y>=bord4_lim.a.y && pos.x<=bord4_lim.b.x && pos.y<=bord4_lim.b.y){
if (!way && label && label.get_text()=="X"){
return translate("Indicates the limits for using construction tools")+" ("+pos.tostring()+")."
}
return all_control(result, gl_wt, way, ribi, tool_id, pos, r_way.c)
}

else if(tool_id==tool_build_way)
return translate("Connect the Track here")+" ("+r_way.c.tostring()+")."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,14 @@ Ahora que las paradas est
</p>
<p>
<st>Se avanza al siguiente paso</st> cuando el autob�s llegue a la primera parada de la lista.
</p>
</p>
<p>
<h1>Siguiendo convoyes</h1>
Esta opci�sn le permite seguir los veh�cculos mientras recorren su ruta, para que permanezcan a la vista sin importar a d�snde vayan, incluso si van bajo tierra. Se activa desde la ventana Convoy y es el cuarto icono en la barra de t�ctulo de esa ventana (el ojo).
</p>
<p>
Haga clic en el veh�cculo que ya est�� en circulaci�sn para que se muestre la ventana Convoy. Busque el cuarto �ccono en la barra de t�ctulo de la ventana del convoy (�ccono de ojo) y presi�snelo para seguir al convoy.
</p>
<p>
<st>El tutorial pasar�� al siguiente paso</st> cuando est��s siguiendo el convoy.
</p>

0 comments on commit 38c2308

Please sign in to comment.