Okay, there are number of ways this could be improved, most especially the fact that there’s no need to break down the information you pass to the next passage into 3+ individual variables. A Story variable can contain an object or an array (as you do when setting $jobs
in the first place) so you can just pass the entire job choice.
I’m also going to assume you are offering the player a choice of 3 jobs, so you want the picked job to be in the same variable regardless of which one is picked.
Finally, you can use <<nobr>> ... <</nobr>>
to collapse whitespace across many lines, and save your self the use of dozens of \
<<nobr>>
<<set $jobs to [
["Verwaltungsfachangestellte(m/w/d)"," Mittlerer Dienst", "Verwaltung", 1400 ],
["Fachangestellte fĂĽr Medien- und Informationsdienste"," Mittlerer Dienst", "Kultur", 1400],
["Fremdsprachenkorrespondent/-in"," Mittlerer Dienst", "Kultur", 1450],
["Fachinformatiker (m/w/d)"," Mittlerer Dienst", "Technik", 1500],
["Rechtsanwaltsgehilfe (m/w/d)","Mittlerer Dienst", "Verwaltung", 1400],
["Vorzimmerdame"," Mittlerer Dienst", "Verwaltung", 1200],
["Sicherheitskraft (m/w/d)"," Einfacher Dienst", "Verwaltung", 1000],
["Techniker (m/w/d)"," Mittlerer Dienst", "Technik", 1620],
["Kurierfahrer (m/w/d)"," Einfacher Dienst", "Verwaltung", 1100],
["Sachbearbeiter (m/w/d)"," Gehobener Dienst", "Verwaltung", 2300],
["Programmierer (m/w/d)","Gehobener Dienst", "Technik", 2850],
["Techniker (m/w/d)"," Gehobener Dienst", "Technik", 2900],
["Ăśbersetzer/-in (m/w/d)"," Gehobener Dienst", "Kultur", 2500],
["Personalsachbearbeiter (m/w/d)"," Gehobener Dienst", "Verwaltung", 2400],
["Politikwissenschaftler/-in (m/w/d)"," Gehobener Dienst", "Kultur", 2500],
["Ăśbersetzer/-in (m/w/d)"," Gehobener Dienst", "Kultur", 2500],
["Bibliothekar/-in (m/w/d)"," Gehobener Dienst", "Kultur", 2500],
["Programmierer (m/w/d)","Höherer Dienst", "Technik", 4250],
["Referent/-in (m/w/d)","Höherer Dienst", "Verwaltung", 3250],
["Referent/-in (m/w/d)","Höherer Dienst", "Kultur", 3250],
["Dolmetscher/-in (m/w/d)","Höherer Dienst", "Kultur", 3450],
["Personalreferent/-in (m/w/d)","Höherer Dienst", "Verwaltung", 3250]
]>>
<<set _choices = $jobs.pluckMany(3)>>
<</nobr>>
<<for _choice range _choices>>
<<link [[_choice[0]]]>><<set $job = _choice>><</link>>
<<print _choice.join(', ')>>
<</for>>
Note that I’ve renamed the list of jobs to $jobs
so that the story variable $job
can be used to hold the job you pick.
I’ve also used the pluckMany()
method that SugarCube provides to do your random selection of 3 jobs.
One final note, you might find it easier if each job was an object rather than an array, so that you didn’t have to keep the positions of the information in mind to use them. i.e. most people find this easier to work with:
{ job: "Teacher", location: "School", field: "Public Service", salary: 3000 }
Than this:
["Teacher", "School", "Public Service", 3000]
Because it’s much easier to know what $job.salary
means than $job[3]