The International Simutrans Forum

 

Author Topic: Pak128 Scenario Tutorial  (Read 27206 times)

0 Members and 1 Guest are viewing this topic.

Offline Andarix

  • *
  • Posts: 39
Re: Pak128 Scenario Tutorial
« Reply #140 on: September 27, 2019, 06:58:23 AM »
chapter 6

Building 4 transformers but only connecting 2 is confusing.


Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1232
    • Simutrans-BLOG
  • Languages: ES
Re: Pak128 Scenario Tutorial
« Reply #141 on: September 27, 2019, 02:28:52 PM »
Quote
But that was not changed in the mission text. There is a display of 431/90 transported passengers.

This number of buses is unsuitable as a condition. You speak of network. A network consists of several lines. But they only count the buses of a line.
Do you mean that it is better not to limit the number of vehicles? , although automating that is going to take time since I have to do a lot of tests.


Quote
That's wrong. There is no 2nd bus to start.

It's my mistake, there are actually 2 vehicles for step 2.


Quote
chapter 6

Building 4 transformers but only connecting 2 is confusing.
This part is still in development, I cannot solve this since there is no function that allows me to know if a transformer is electrified.

Another problem is that the "get_power ()" energy values do not accumulate correctly, I mean they return to zero "0" before the month ends.

You can see the discussion here: https://forum.simutrans.com/index.php/topic,19254.0.html

Offline Andarix

  • *
  • Posts: 39
Re: Pak128 Scenario Tutorial
« Reply #142 on: September 27, 2019, 11:26:10 PM »
I have slightly revised chapter_03.nut.

unused text files removed


Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1232
    • Simutrans-BLOG
  • Languages: ES
Re: Pak128 Scenario Tutorial
« Reply #143 on: September 28, 2019, 10:29:51 AM »
I have slightly revised chapter_03.nut. unused text files removed
Wow I'm surprised, thank you very much for your help friend.  ;D

Offline Andarix

  • *
  • Posts: 39
Re: Pak128 Scenario Tutorial
« Reply #144 on: September 28, 2019, 12:21:15 PM »
chapter 05 step 1



EDIT

chapter 5 step 2

can not public the stop

reload then works

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1232
    • Simutrans-BLOG
  • Languages: ES
Re: Pak128 Scenario Tutorial
« Reply #145 on: September 28, 2019, 06:11:12 PM »
this should solve the problem.
Code: [Select]
function cov_pax(c, wt, good){
        local halt = tile_x(c.x, c.y, c.z).get_halt()
        local cov_nr = 0
        if(halt) {
            local cov_list = halt.get_convoy_list()
            foreach(cov in cov_list) {
                if (cov.get_waytype()!=wt)
                    continue
                local cov_good = cov.get_goods_catg_index()
                for(local j=0;j<cov_good.len();j++){
                    if(cov_good[j]==good)
                        cov_nr += cov.get_transported_goods()[0]
                }
            }
            local lin_list = halt.get_line_list()
            foreach(line in lin_list) {
                local cov_lin = line.get_convoy_list()
                foreach(cov in cov_lin) {
                    if (cov.get_waytype()!=wt)
                        continue

                    local cov_good = cov.get_goods_catg_index()       
                    for(local j=0;j<cov_good.len();j++){
                        if(cov_good[j]==good){
                            cov_nr += cov.get_transported_goods()[0]                   
                        }
                    }
                }
            }
        }
        return cov_nr
    }


Offline Andarix

  • *
  • Posts: 39
Re: Pak128 Scenario Tutorial
« Reply #146 on: September 30, 2019, 02:16:07 PM »
class_basic_chapter.nut

The following change should be made in the function get_goal_text (pl, path).

Code: [Select]
@@ -489,10 +491,12 @@ class basic_chapter
  for (local i = 1; i <= 15; i++){
  text[this.my_step(i)] = ""
  text[this.ttxst(i)] = "<em>"
+ text[this.ttxst(i)+"e"] = "</em>"
  }
  text_step = this.set_goal_text(text_step)
  text[my_step(this.step)] = text_step.tostring()
- text[ttxst(this.step)] = "<a><st>"
+ text[ttxst(this.step)] = "<st>"
+ text[ttxst(this.step)+"e"] = "</st>"
  if (correct_cov)
  text["scr"] = "<em>--></em> <a href='script:script_text()'>"+ translate("Go to next step")+"</a> <em>>>></em>"
  else

Accordingly, then the step marks must be changed in the files goal.txt.

old
Code: [Select]
{txtst_01}Step A</em> - A Look at the Factories</a><br>
{step_01}

new - remove /a end of line
Code: [Select]
{txtst_01}Step A{txtst_01e} - A Look at the Factories<br/>
{step_01}

This ensures clean tags.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1232
    • Simutrans-BLOG
  • Languages: ES
Re: Pak128 Scenario Tutorial
« Reply #147 on: October 03, 2019, 04:40:33 PM »
class_basic_chapter.nut

The following change should be made in the function get_goal_text (pl, path).

Code: [Select]
@@ -489,10 +491,12 @@ class basic_chapter
  for (local i = 1; i <= 15; i++){
  text[this.my_step(i)] = ""
  text[this.ttxst(i)] = "<em>"
+ text[this.ttxst(i)+"e"] = "</em>"
  }
  text_step = this.set_goal_text(text_step)
  text[my_step(this.step)] = text_step.tostring()
- text[ttxst(this.step)] = "<a><st>"
+ text[ttxst(this.step)] = "<st>"
+ text[ttxst(this.step)+"e"] = "</st>"
  if (correct_cov)
  text["scr"] = "<em>--></em> <a href='script:script_text()'>"+ translate("Go to next step")+"</a> <em>>>></em>"
  else

Accordingly, then the step marks must be changed in the files goal.txt.

old
Code: [Select]
{txtst_01}Step A</em> - A Look at the Factories</a><br>
{step_01}

new - remove /a end of line
Code: [Select]
{txtst_01}Step A{txtst_01e} - A Look at the Factories<br/>
{step_01}

This ensures clean tags.

Place the underline intentionally, it is more attractive to the eye do not you think? .

Offline Andarix

  • *
  • Posts: 39
Re: Pak128 Scenario Tutorial
« Reply #148 on: October 03, 2019, 06:26:14 PM »
Place the underline intentionally, it is more attractive to the eye do not you think? .

a use only because of the underline is misleading. Two-color underlining does not look very nice to me.

Furthermore, it is questionable to have tags in the formatting that have no start tag.

For better readability, format with p instead of just br.

If underlining is considered necessary, it is better to add a u-tag in the code.


Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1232
    • Simutrans-BLOG
  • Languages: ES
Re: Pak128 Scenario Tutorial
« Reply #149 on: October 05, 2019, 08:37:14 PM »

a use only because of the underline is misleading. Two-color underlining does not look very nice to me. Furthermore, it is questionable to have tags in the formatting that have no start tag. For better readability, format with p instead of just br. If underlining is considered necessary, it is better to add a u-tag in the code.
Maybe it would be a good idea to make a small vote?



I have moved chapter 5 to 6 and vice versa, because the old chapter 5 is a kind of challenge, maybe add more in the future, just wait for more ideas .  8)