No, as you've no doubt noticed there's plenty of obsolete code examples on the wiki, because we've changed how things are done, how modules are imported, etc.
However, the code that pioneer runs on is always valid (ehum, except when there's bugs in them). Either way, it's good to point a reader to modules that are a good place to start reading code, that are simple.
Updating the wiki mission scripting tutorial
-
- Posts: 40
- Joined: Mon Sep 20, 2021 3:18 pm
Re: Updating the wiki mission scripting tutorial
Yes, well, I'm updating it now. This time it became obsolete a bit faster because I erroneously relied on onShipDocked to work in a certain way.
Sure, I can do more of that.
Re: Updating the wiki mission scripting tutorial
The modder/developer-facing side of the wiki is *also* planned to be obsoleted / removed entirely and migrated to Markdown, but it's been a matter of "not enough hours in the day" so far on that front. We have one major "quadrant" of the wiki migrated at this point, and are slowly building out the "workflow" section (perhaps we should rename it to Content Creation?). Feel free to look at pioneer-developer-docs if you're interested in helping to migrate content.
-
- Posts: 40
- Joined: Mon Sep 20, 2021 3:18 pm
Re: Updating the wiki mission scripting tutorial
2025
Scripting tutorial have been updated.
* Missions and the mission list have been updated and given it's own page: https://wiki.pioneerspacesim.net/wiki/M ... ssion_list
* Links have been updated.
* Code have been updated to be up to date with the next release.
* General fixes - Grammar, spelling and layout.
The only real question mark is the first half of the Surviving a reload page. The two complete modules on the end miraculously work. However, it's not at all obvious with the shorter examples in the beginning and apart from the first hello-world example they don't really work out of the box.
Scripting tutorial have been updated.
* Missions and the mission list have been updated and given it's own page: https://wiki.pioneerspacesim.net/wiki/M ... ssion_list
* Links have been updated.
* Code have been updated to be up to date with the next release.
* General fixes - Grammar, spelling and layout.
The only real question mark is the first half of the Surviving a reload page. The two complete modules on the end miraculously work. However, it's not at all obvious with the shorter examples in the beginning and apart from the first hello-world example they don't really work out of the box.
Re: Updating the wiki mission scripting tutorial
A few corrections / informational notices:
- On the main Introduction page: assignments to global variables without explicitly accessing _G are not visible to other scripts. Pioneer gives each Lua file a separate "environment" (the Lua _ENV variable) which "shadows" the actual global table. If you want to export something to other scripts, you have to assign it as _G.SomeExport = MyValue. This is done so that inadvertent omissions of the "local" keyword don't break the execution environment of other scripts.
- Also on that same page, we no longer have Lua-based model file definitions and are deprecating Lua-based custom systems, so there are only two distinct Lua interpreters now - one for faction definitions and one for the main game.
- The link to the CodeDoc on the Event page should probably directly link to the codedoc page for data/libs/Event.lua as it contains a list of available events...
I like the mission list page, good work! It neatly captures what has to be done to interact with the mission API and is very easy to understand.
The Surviving a Reload page would definitely need some work. It's not written as a step-by-step tutorial for new programmers, only shows the "skeleton" of a mission module, and assumes familiarity with the existing mission structure. Ideally a new version should be written which builds off of the code shown in the BBS Forms and Mission List articles and combines it together into a finished module.
I unfortunately do not have nearly enough time at current to rewrite the article, but the underlying concepts are fairly simple to interact with - you're entirely welcome to write a new version!
- On the main Introduction page: assignments to global variables without explicitly accessing _G are not visible to other scripts. Pioneer gives each Lua file a separate "environment" (the Lua _ENV variable) which "shadows" the actual global table. If you want to export something to other scripts, you have to assign it as _G.SomeExport = MyValue. This is done so that inadvertent omissions of the "local" keyword don't break the execution environment of other scripts.
- Also on that same page, we no longer have Lua-based model file definitions and are deprecating Lua-based custom systems, so there are only two distinct Lua interpreters now - one for faction definitions and one for the main game.
- The link to the CodeDoc on the Event page should probably directly link to the codedoc page for data/libs/Event.lua as it contains a list of available events...
I like the mission list page, good work! It neatly captures what has to be done to interact with the mission API and is very easy to understand.
The Surviving a Reload page would definitely need some work. It's not written as a step-by-step tutorial for new programmers, only shows the "skeleton" of a mission module, and assumes familiarity with the existing mission structure. Ideally a new version should be written which builds off of the code shown in the BBS Forms and Mission List articles and combines it together into a finished module.
I unfortunately do not have nearly enough time at current to rewrite the article, but the underlying concepts are fairly simple to interact with - you're entirely welcome to write a new version!
-
- Posts: 40
- Joined: Mon Sep 20, 2021 3:18 pm
Re: Updating the wiki mission scripting tutorial
Thank you for the feedback!
OK. Can you edit the wiki? I wouldn't know how to word this.sturnclaw wrote: ↑Thu Jan 16, 2025 10:24 pm - On the main Introduction page: assignments to global variables without explicitly accessing _G are not visible to other scripts. Pioneer gives each Lua file a separate "environment" (the Lua _ENV variable) which "shadows" the actual global table. If you want to export something to other scripts, you have to assign it as _G.SomeExport = MyValue. This is done so that inadvertent omissions of the "local" keyword don't break the execution environment of other scripts.
- Also on that same page, we no longer have Lua-based model file definitions and are deprecating Lua-based custom systems, so there are only two distinct Lua interpreters now - one for faction definitions and one for the main game.
- The link to the CodeDoc on the Event page should probably directly link to the codedoc page for data/libs/Event.lua as it contains a list of available events...
OK. I'll try and see if I can come up with something better.sturnclaw wrote: ↑Thu Jan 16, 2025 10:24 pm The Surviving a Reload page would definitely need some work. It's not written as a step-by-step tutorial for new programmers, only shows the "skeleton" of a mission module, and assumes familiarity with the existing mission structure. Ideally a new version should be written which builds off of the code shown in the BBS Forms and Mission List articles and combines it together into a finished module.
I unfortunately do not have nearly enough time at current to rewrite the article, but the underlying concepts are fairly simple to interact with - you're entirely welcome to write a new version!