Skip to content

Commit

Permalink
Restructure in convoy analyzer removed
Browse files Browse the repository at this point in the history
  • Loading branch information
simustyt committed Jun 2, 2024
1 parent 38c2308 commit 77e754d
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 69 deletions.
44 changes: 35 additions & 9 deletions pak128.prototype/scenario/tutorial/class/class_basic_chapter.nut
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,38 @@ class basic_chapter

function update_convoy_removed(convoy, pl)
{
cov_save[current_cov]=convoy
id_save[current_cov]=convoy.id
if(correct_cov){
gcov_nr++
persistent.gcov_nr = gcov_nr
//gui.add_message("update_convoy_removed: "+convoy + " Correct "+correct_cov)
if(cov_save.len() <= current_cov) {
cov_save.push(convoy)
if(correct_cov){
gcov_nr++
persistent.gcov_nr = gcov_nr
current_cov = gcov_nr
persistent.current_cov = gcov_nr
}
}
else{
cov_save[current_cov]=convoy
if(correct_cov){
gcov_nr++
persistent.gcov_nr = gcov_nr
current_cov = gcov_nr
persistent.current_cov = gcov_nr
}
}
}

function is_cov_valid(cnv){
local result = true
// cnv - convoy_x instance saved somewhat earlier
try {
cnv.get_pos() // will fail if cnv is no longer existent
// do your checks
}
catch(ev) {
result = false
}
return result
}

function cov_pax(c, wt, good){
Expand Down Expand Up @@ -943,8 +969,8 @@ class basic_chapter
if (cov_dep.x == c_dep.x && cov_dep.y == c_dep.y){
//gui.add_message("("+cov.is_in_depot()+" .. "+cov.id+") .. ??"+id_end+"")
if(!cov.is_in_depot()){
for (local j =id_start ;j<id_end;j++){
if(cov.id == id_save[j]){
for (local j =id_start ;j<cov_save.len();j++){
if(cov.id == cov_save[j].id){
cov_nr++
break
}
Expand All @@ -962,8 +988,8 @@ class basic_chapter
if (cov_dep.x == c_dep.x && cov_dep.y == c_dep.y){
//gui.add_message("("+cov.is_in_depot()+" .. "+cov.id+") .. ??"+id_end+"")
if(!cov.is_in_depot()){
for (local j =id_start ;j<id_end;j++){
if(cov.id == id_save[j]){
for (local j =id_start ;j<cov_save.len();j++){
if(cov.id == cov_save[j].id){
cov_nr++
break
}
Expand Down
21 changes: 15 additions & 6 deletions pak128.prototype/scenario/tutorial/class/class_basic_convoys.nut
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,27 @@ class basic_convoys
if (id>gcov_id)
gcov_id = id

if (!cov.is_in_depot() && !ignore_save[id])
if (!cov.is_in_depot() && convoy_ignore(ignore_save, id))
cov_nr++
}
return cov_nr
}

function convoy_ignore(list, id)
{
for(local j = 0; j<list.len(); j++) {
if(list[j].id == id)
return false
}
return true
}

function checks_convoy_removed(pl)
{
local j = 0
local sw = true
for(j;j<gcov_nr;j++){
for(j;j<cov_save.len();j++){
//gui.add_message("checks_convoy_removed --- j "+ j)
local result = true
// cnv - convoy_x instance saved somewhat earlier
try {
Expand All @@ -81,12 +91,11 @@ class basic_convoys
persistent.current_cov = j
}
sw = false
break
}
if (result){
//gui.add_message(""+convoy_x(id_save[j]).is_in_depot()+"")
if (convoy_x(id_save[j]).is_in_depot()){
cov_save[j] = null

if (cov_save[j].is_in_depot()){
cov_save[j] = null
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class tutorial.chapter_07 extends basic_chapter
return translate("The bus must be [Passengers].")
}
if (result == null){
ignore_save[convoy.id] = true //Ingnora el vehiculo
ignore_save.push({id = convoy.id, ig = true}) //Ingnora el vehiculo
return null
}
return result = translate("It is not allowed to start vehicles.")
Expand Down
30 changes: 15 additions & 15 deletions pak128.prototype/scenario/tutorial/en/chapter_01/goal_step_01.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,45 @@ In this first step we are going to explain some basic aspects of the <em>Tutoria
</p>
<p>
<h1>Warning Windows </h1>
These are used to give a warning to the player in case of doing something wrong, like using the wrong tool, the events on the stage that show pop-ups are:<br>
These are used to give a warning to the player in case of doing something wrong, like using the wrong tool. The events in the game that prompt pop-ups are:<br>
1-<em> Use of tools</em>, when the map is clicked with the wrong tool.<br>
2-<em> Schedule Vehicles</em>, when the schedule or line of the vehicle is incorrect.<br>
3-<em> Start Vehicles</em>, when the type of vehicle required is incorrect.
</p>
<p>
<h1>Marks and labels</h1>
A series of prompts are used in the field to help the player find/locate things. The three types of indications are:<br>
1- <em>Text labes</em>, these objects are used to display a guide text and to indicate with "X" the limits for the use of tools.<br>
2- <em>Marks on objects</em>, are used to give a 'Red' highlight to the objects that must be clicked.<br>
1- <em>Text labels</em>: these signpost objects are used to display guide texts and to indicate with "X" the limits for the use of tools.<br>
2- <em>Marks on objects</em> are used to give a 'Red' highlight to the objects that must be clicked.<br>
3- <em>Marks in the terrain</em>, used to highlight objects and the terrain, also plays a visual role when connecting roads.
</p>
<p>
<h1>Links</h1>
In this scenario you will very commonly see the links to object locations, clicking on one of them will automatically take you to the location they indicate, for example "{pos}", clicking will take you directly to the city <em>{town}</em>. They are mainly used to go to:
In this scenario you will very commonly see links to locations on the map. Clicking on one of them will automatically take you to the location they indicate. For example, clicking on "{pos}" will take you directly to the city <em>{town}</em>. They are mainly used to go to:
- Cities ({pos1}), Factories ({pos2}), Stations ({pos3}), etc.
</p>
<p>
<h1>Chapter/Step Regressions</h1>
This will only happen if you eliminate a vehicle in circulation, regardless of the chapter where you are, you will be sent back to correct the problem.
This will only happen if you eliminate a vehicle in circulation. Regardless of where in the chapter you are, you will be sent back to correct the problem.
</p>
<p>
<h1>Link to Skip Steps</h1>
It is a special type of link that allows you to execute codes in the Scenario with just one click, using this shortcut you can see how everything is built automatically, it can be used up to Chapter 5.
This is a special type of link that allows you to execute code in the Scenario with just one click. By using this shortcut, you can see how everything is built automatically. It can be used up to Chapter 5.
</p>
<p>
<h1>Scenario Messages</h1>
Scenario messages are disabled by default, you can enable as follows:<br>
- In the toolbar select the menu <em>Menssage Center</em>, in the press the button <em>[Options]</em><br>
- Below is a list of message types, each with 4 checkboxes.<br>
- <em>[Master Control]</em> this control completely enables/disables the selected message.<br>
- <em>[News bar]</em> this control enables/disables messages in the news bar.<br>
- <em>[Temporary Window]</em> this control enables/disables messages in a popup window that disappears in a few seconds.<br>
- <em>[Alert Window]</em> this control enables/disables messages in persistent popup <st>(not recommended)</st>.<br>
Scenario messages are disabled by default. To enable them:<br>
- In the toolbar select the <em>Messages</em> window, and press the <em>[Options]</em> button<br>
- This opens a list of message types, each with 4 checkboxes arranged in columns:<br>
- <em>[Master Control]</em>: this checkbox completely enables/disables the selected message.<br>
- <em>[News bar]</em> this checkbox enables/disables messages in the news bar.<br>
- <em>[Temporary Window]</em> this checkbox enables/disables messages in a popup window that disappears after a few seconds.<br>
- <em>[Alert Window]</em> this checkbox enables/disables messages that popup and remain visible <st>(not recommended)</st>.<br>
</p>
<em>Tip:</em> For Scenario messages it is recommended to activate only the <em> [Temporary Window] </em>.<br>
<p>
<st>Note:</st> The text in this window always takes a few seconds to update.
<st>Note:</st> The scenario instructions in this window always take a few seconds to update.
</p>
<p>
<st>To advance to the next step</st>, you must click on this link {link}.
</p>
</p>
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ In addition, it is highly recommended that Trees are set to transparent, either
You can <em>zoom</em> in and out using either the Mouse wheel, or by using the <em>"Page Up/Page Down Keys"</em>.
</p>
<p>
You can <em>move</em> about the map either by holding down the Right Mouse button and dragging, using the Arrow Keys or the number pad.</p>
You can <em>move</em> about the map either by holding down the Right Mouse button and dragging, by using the Arrow Keys or by using the number pad.</p>
<p>
You can <em>rotate</em> the map by pressing <em>"[Shift]+r" (Capital "R")</em> or in from toolbar select <em>Rotate Map</em> tool.
Try zooming in and out and moving about the map.
</p>
<p>
Try zooming in and out and moving about the map.
You can <em>rotate</em> the map by pressing <em>"[Shift]+r" (Capital "R")</em> or by selecting the <em>Rotate Map</em> tool in the Toolbar.
</p>
<p>
<st>To proceed to the next step</st>, rotate the map.
</p>
</p>
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<p>
Now that you know how to move around the map, the next step is to retrieve information about items on the map.
Now that you know how to move around the map, the next step is getting information about items on the map.
</p>
<p>
<h1>Inspection Tool</h1>
This is the main tool of the game, it is completely free for all players and allows to display the information window on any object on the map. It is also selected by default, if not it can be selected from the menu bar (the magnifying glass icon) or by pressing the <em>"A" key</em>.
This is the main tool of the game. You can use it any time and it does not cost in-game money. Once the tool has been selected, left-click on any object on the map to open its information window. It is selected by default; you can also change to it (from another tool) using the magnifying glass icon in the menu bar or by pressing the <em>"A" key</em>.
</p>
<p>
Another item to note is the world position listed at the bottom of the screen in (x,y,z) format. Warning: these coordinates depends on the current rotation of the map.
Another item to note is the world position listed at the bottom of the screen in (x,y,z) format. Warning: these coordinates depend on the current rotation of the map. So if you rotate the map, the co-ordinates of all objects on the map will change.
</p>
<p>
To proceed first click on the {pos} <em>(the statue of the legendary Isaac)</em> with the <em>'{tool1}'</em>. After clicking on the location, you may close the information window that displays by clicking the <em>"[X]"</em> in the top left corner, pressing <em>"[Escape]"</em> to close the top most window, or press <em>"[Backspace]"</em> to close all open windows.
To proceed, first click on <em>the statue of the legendary Isaac</em> at {pos} with the <em>'{tool1}'</em>. After clicking on the location, an information window opens. You may close it by clicking the <em>"[X]"</em> in the top left corner or pressing <em>"[Escape]"</em> to close the top most window. Alternatively, press <em>"[Backspace]"</em> to close all open windows.
</p>
<p>
Lastly use the <em>'{tool1}'</em> in the {buld_name} and close the info window.
Lastly, use the <em>'{tool1}'</em> in the {buld_name} and close the information window.
</p>
<p>
<em>Tip:</em> You can click on the preview of the object in the pop-up information windows, this will take you directly to its location on the map.
<em>Tip:</em> You can click on the preview of the object in the pop-up information window, which will take you directly to its location on the map.
</p>
<p>
<st>Note:</st> By pressing the <em>"[Backspace]"</em> key, all windows are closed, including the current scenario window.
</p>
<p>
<st>To proceed to the next step</st>, click on the {pos} and then on {buld_name} with the <em>'{tool1}'</em>.
</p>
<st>To proceed to the next step</st>, click on {pos} and then on {buld_name} with the <em>'{tool1}'</em>.
</p>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<p>
These windows help you to keep yourself updated about what is going on in the world.
The game contains several windows to help you to keep yourself updated about what is going on in the world.
</p>
<p>
The <em>'mini-map'</em> can be displayed by pressing the "m" key.<br/>
The <em>'finances'</em> window can be displayed by pressing the "f" key.<br/>
The <em>'message center'</em> can be displayed by pressing "[Shift]+b".<br/>
Detailed information about cities can also be viewed by clicking on the <em>Town hall</em> with the <em>'{tool1}'</em>.
You might also want to get detailed information about a city. This can be viewed by clicking on the city's <em>Town hall</em> with the <em>'{tool1}'</em>.
</p>
<p>
<st>To continue to the next chapter</st> click on the {pos2} of {town} using the <em>'{tool1}'</em>.
</p>
</p>
5 changes: 3 additions & 2 deletions pak128.prototype/scenario/tutorial/en/chapter_02/06_1-2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Lines can be managed from the <em>Line Management</em> window and can be accesse
<em>[2]</em> Select the stop {st2} and <st>leave everything as this</st>.<br/>
<em>[3]</em> Select the stop {st3} and <st>leave everything as this</st>.<br/>
<em>[4]</em> Select the stop {st4} and <st>leave everything as this</st>.<br/>
<em>[5]</em> Select the stop {st5} and <st>leave everything as this</st>.
<em>[5]</em> Select the stop {st5} and <st>leave everything as this</st>.<br/>
<em>[6]</em> Select the stop {st6} and <st>leave everything as this</st>.
</p>
<p>
<h1>Final steps:</h1>
Expand All @@ -35,4 +36,4 @@ Lines can be managed from the <em>Line Management</em> window and can be accesse
</p>
<p>
<st>Advances to the next step</st> when all vehicles are in circulation.
</p>
</p>
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@ Now you need to purchase a <em>{bus1}</em> Bus to run the service.
<em>Tip:</em> Press the <em>[Ctrl]+["]</em> keys to hide the urban buildings.
</p>
<p>
<st>It takes to the next step</st> when the bus arrives at the first stop on the list.
</p>
<h1>Following Convoys</h1>
This option allows you to follow vehicles as they travel their route, so that they remain in view no matter where they go, even if they go underground. It is activated from the Convoy Window and is the fourth icon in that Window's title bar (an eye).
</p>
<p>
Click on the vehicle already in circulation so that the Convoy Window is displayed. Look for the fourth icon in the title bar of the Convoy Window (eye icon) and press it to follow the convoy.
</p>
<p>
<st>The tutorial will move to the next step</st> when you are following the convoy.
</p>
Loading

0 comments on commit 77e754d

Please sign in to comment.