Skip to content

Commit

Permalink
New mod
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Feb 15, 2021
0 parents commit 34b308d
Show file tree
Hide file tree
Showing 35 changed files with 3,016 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ckan linguist-language=JSON linguist-detectable=true
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Bug
about: For typical problems and glitches
assignees: HebaruSan
---

## Background

PlanningNode version:


KSP version:


Operating system:


Planet packs installed:


Save file:
<!-- Create a ZIP, then click "attach files" in the bottom of the editing box -->


## Problem
19 changes: 19 additions & 0 deletions .github/workflows/AVC-VersionFileValidator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Validate AVC .version files
on:
push:
pull_request:
types:
- reopened
- synchronize
- reopened

jobs:
validate_version_files:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Validate files
uses: DasSkelett/AVC-VersionFileValidator@master
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build release
on:
release:
types:
- created

jobs:
Release:
runs-on: ubuntu-latest
container:
image: mono:latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Decrypt/unpack dependencies and build
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-2
AWS_DEFAULT_REGION: us-east-2

run: |
apt-get update
apt-get install -y jq gpg awscli make
KSP_VERSION=$(jq -rM '"\(.KSP_VERSION_MIN.MAJOR).\(.KSP_VERSION_MIN.MINOR)"' GameData/PlanningNode/PlanningNode.version)
aws s3 cp s3://hebarusan/KSP_Data-${KSP_VERSION}.tar.gz.gpg - | gpg --batch --no-tty --yes --passphrase ${{ secrets.GPG_KEY }} -d | tar xzf - -C Source
make
- name: Upload to GitHub
uses: actions/upload-release-asset@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./PlanningNode.zip
asset_name: PlanningNode.zip
asset_content_type: application/zip
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Source/KSP_Data
obj/
*.dll
*.xml
*.zip
*.gpg
Binary file added GameData/PlanningNode/Icons/PlanningNode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
674 changes: 674 additions & 0 deletions GameData/PlanningNode/LICENSE

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions GameData/PlanningNode/Localization/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Translating to your language

![Languages supported by KSP 1.3: English, Spanish, Chinese, Russian, Japanese](https://i.imgur.com/DbCCJWK.png)

The 1.3 release of KSP introduces localization, which allows in-game text to be translated to other languages. This allows more people to enjoy the game in their preferred language and enlarges the community. However, it does not happen automatically for mods; by default, a mod will appear in English regardless of the language of the base game. In order to have both the base game and mods available in the same non-English languages, some additional work must be done by the modder.

Unfortunately, I only speak English, and I maintain this mod for free. This means I cannot create my own translations, and I cannot pay a professional translation service to produce high quality translations. The best I can do on my own is to use Google Translate, which is of dubious value for the terse, idiomatic strings needed in a KSP mod's UI. Instead, I must rely on the expertise of you, the multilingual KSP mod user, to tell me what good translations look like for your language. If you would like to help in this effort, please keep reading to learn how the mod's language files are structured and how to submit translations for use by others.

Note: Even though you will appear to be editing the project's files, don't worry about making mistakes. Github will keep your changes separate from the main files until I have verified that they are OK to use. It is even possible for me to ask questions or request changes before your work is committed to the main files.

## Creating or editing a translation

It is recommended to make your changes on your own computer at first so you can test them before uploading, especially if you are creating a new translation from scratch.

1. Install the [current release](https://github.com/HebaruSan/PlanningNode/releases/latest) if you have not already
2. Open your `Kerbal Space Program/GameData/PlanningNode/Localization` folder on your local disk
3. Look for a file called *lang*.cfg, where *lang* is KSP's name for your locale; as of KSP 1.3, this includes:
- en-us (English)
- es-es (Spanish)
- ja (Japanese)
- ru (Russian)
- zh-cn (Chinese)

The remaining steps are different depending on whether the file already exists:

### If the file exists

Follow these steps to make improvements to an existing translation:

4. Edit the file for your language in your favorite text editor
5. Make the changes you wish to see in-game (see the [File format section](#file-format) below for details)
6. Save your changes
7. Remember to [test your changes](#testing)!

### If the file does not exist

Follow these steps to start your own translation from scratch:

4. Make a copy of `en-us.cfg` in the `lang` folder
5. Rename the file according to the list of languages above
6. Edit the file for your language in your favorite text editor
7. Change the third line from `en-us` to the string for your language
8. Translate each string from English to your language (see the [File format section](#file-format) below for details)
9. Save your changes
10. Remember to [test your changes](#testing)!

### File format

The middle part of the `cfg` file contains the strings to translate. The format is `name = translation`, where the name is a special string defined by the mod. For example:

PlanningNode_mainTitle = Planning Node

Do **not** change the part to the left of the equals sign ("=")! These names must be the same in every language file.

The part to the right of the equals sign is the string to be used in-game. Most of the text will be shown as-is, but it can contain a few special strings as shown in the [Lingoona grammar module demo](http://lingoona.com/cgi-bin/grammar#l=en&oh=1):

| String | Purpose |
| --- | --- |
| `\n` | Line break; try to preserve these based on the original strings to make sure the strings will fit |
| `<<1>>` | The first substitutable token in the string, will be replaced by a number, name of a planet, etc., depending on the string |
| `<<2>>` | Second token, and so on |
| `<<A:1>>` | The first token, but substituted with a proper article |

### Testing

It's important to make sure that your changes work correctly. If you use Steam:

1. [Select the language to use in Steam](https://www.youtube.com/watch?v=iBwYCvQxfeI)
2. Wait for the language pack download to complete
3. Run KSP
4. Use Planning Node and make sure your changes appear as you intended

If you do not use Steam, I don't know the steps to choose a language. Contact SQUAD if you can't figure it out.

## Contributing your translation for others to use

After you have prepared a `cfg` file for your language and confirmed that it works as you intend, if you are willing to contribute it for redistribution under the GLPv3 license, follow these steps to upload it for inclusion in the main mod distribution:

1. Log in to [Github](https://github.com); you may need to register an account if you do not already have one
2. Navigate to the [Localization folder](https://github.com/HebaruSan/PlanningNode/tree/master/GameData/PlanningNode/Localization)
3. Look for the file you edited

The remaining steps are different depending on whether the file already exists:

### If the file exists

4. Click the file's name to view it
5. Click the [pencil icon](https://help.github.com/assets/images/help/repository/edit-file-edit-button.png) to edit
6. Replace the text with the pasted contents of the file you edited locally
7. **Important**: At the bottom of the page, under Propose file change, type an English description of the changes you have made and the reason you think they should be made. This will help me to confirm that your changes are appropriate. Remember, I do not speak the language in the `cfg` file, so I need you to tell me why your way is better!
6. Click `Propose file change` at the bottom when done

### If the file does not exist

4. Click [Create new file](https://help.github.com/assets/images/help/repository/create_new_file.png) to create it
5. Enter the correct file name in the box at the top
6. Paste the contents of the file you edited locally into the big box in the middle
8. Click `Propose new file` at the bottom when done

### Review

Once you finish your changes, Github will send me a notification that a pull request has been submitted. I will take a look at it within a day or two and attempt to verify that the changes make sense by:

- Confirming that the file name and the third line of the file match one of the supported locale names
- Viewing each changed string in-game
- Checking Google Translate
- Asking individual human experts
- Requesting help on the KSP forum

If I have any questions about specific changes you've made, I will add them to the pull request, which should trigger a notification to you. Please try to respond to these in as timely a manner as you can manage. Your pull request may be closed without merging if you do not reply for a long time.

Once all the questions and comments are resolved to my satisfaction, your changes will be merged into the main files and included in the next release. I will also add your Github name to the Acknowledgements section of the README file.
47 changes: 47 additions & 0 deletions GameData/PlanningNode/Localization/en-us.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Localization
{
en-us
{
PlanningNode_mainTitle = Planning Node
PlanningNode_mainTooltip = Plan maneuver nodes from your parent body
PlanningNode_viewOnlyTooltip = Switch to a vessel to create planning nodes

PlanningNode_editorTitle = Planning Node v<<1>>.<<2>>.<<3>>

PlanningNode_defaultNodeName = New planning node

PlanningNode_markerCaption = <b><<1>></b>\nExcess V: <<2>>m/s\nT - <<3>>

PlanningNode_negativeLength = (<<1>>)
PlanningNode_yearsLength = <<1>>y <<2>>d <<3>>h <<4>>m <<5>>s
PlanningNode_daysLength = <<1>>d <<2>>h <<3>>m <<4>>s
PlanningNode_hoursLength = <<1>>h <<2>>m <<3>>s
PlanningNode_minutesLength = <<1>>m <<2>>s
PlanningNode_secondsLength = <<1>>s

PlanningNode_DeleteButtonCaption = Delete
PlanningNode_DeleteButtonTooltip = Delete this planning node
PlanningNode_CloseButtonCaption = Close
PlanningNode_CloseButtonTooltip = Done editing planning nodes
PlanningNode_NewButtonCaption = New
PlanningNode_NewButtonTooltip = Create a new planning node
PlanningNode_NameLabelCaption = Name:
PlanningNode_PrevNodeCaption = <
PlanningNode_PrevNodeTooltip = Edit the previous planning node
PlanningNode_PrevNodeViewOnlyTooltip = View the previous planning node
PlanningNode_NextNodeCaption = >
PlanningNode_NextNodeTooltip = Edit the next planning node
PlanningNode_NextNodeViewOnlyTooltip = View the next planning node
PlanningNode_BodyLabelCaption = Body:
PlanningNode_PrevBodyCaption = <
PlanningNode_PrevBodyTooltip = Switch to the previous celestial body
PlanningNode_NextBodyCaption = >
PlanningNode_NextBodyTooltip = Switch to the next celestial body
PlanningNode_ShowForAllCheckboxCaption = Show for all vessels
PlanningNode_ShowForAllCheckboxTooltip = If checked, display this node for all vessels, otherwise only for the current vessel

PlanningNode_loadingTip1 = Rejecting your reality and substituting my own...
PlanningNode_loadingTip2 = Striking that, reversing it...
PlanningNode_loadingTip3 = Beautifying thing to joy-forever level...
}
}
14 changes: 14 additions & 0 deletions GameData/PlanningNode/PlanningNode-Changelog.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
KERBALCHANGELOG
{
modName = PlanningNode
author = HebaruSan
license = GPL-3.0
website = github.com/HebaruSan/PlanningNode
showChangelog = True
VERSION
{
version = 0.1.0
versionName = Ruthless Revision by Nature or Fate
versionKSP = 1.11
}
}
16 changes: 16 additions & 0 deletions GameData/PlanningNode/PlanningNode.ckan
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"spec_version": 1,
"identifier": "PlanningNode",
"name": "Planning Node",
"abstract": "Plan maneuver nodes from your parent body",
"description": "Discoverable learn-by-doing method for finding transfers",
"$vref": "#/ckan/ksp-avc",
"license": "GPL-3.0",
"suggests": [
{ "name": "KerbalChangelog" },
{ "name": "LoadingTipsPlus" },
{ "name": "PreciseNode" },
{ "name": "PreciseManeuver" },
{ "name": "ManeuverNodeEvolved" }
]
}
7 changes: 7 additions & 0 deletions GameData/PlanningNode/PlanningNode.ltp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
LOADINGTOOLTIPSPLUS
{
Overwrite = false
ToolTip = PlanningNode_loadingTip1
ToolTip2 = PlanningNode_loadingTip2
ToolTip3 = PlanningNode_loadingTip3
}
23 changes: 23 additions & 0 deletions GameData/PlanningNode/PlanningNode.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"NAME": "Planning Node",
"URL": "https://raw.githubusercontent.com/HebaruSan/PlanningNode/master/GameData/PlanningNode/PlanningNode.version",
"DOWNLOAD": "https://github.com/HebaruSan/PlanningNode/releases/download/v0.1.0/PlanningNode.zip",
"GITHUB": {
"USERNAME": "HebaruSan",
"REPOSITORY": "PlanningNode",
"ALLOW_PRE_RELEASE": false
},
"VERSION": {
"MAJOR": 0,
"MINOR": 1,
"PATCH": 0
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
"MINOR": 11
},
"KSP_VERSION_MAX": {
"MAJOR": 1,
"MINOR": 11
}
}
71 changes: 71 additions & 0 deletions GameData/PlanningNode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Planning Node

This download contains a mod for Kerbal Space Program. Its goal is to create a stock-alike method for planning interplanetary transfers that preserves the flexibility and "learn by doing" approach of stock maneuver nodes.

See the [README in the repo] for references and additional acknowledgements.

See the [README in the Localization folder] for instructions for adding or improving translations for languages other than English.

[README in the repo]: https://github.com/HebaruSan/PlanningNode/blob/master/README.md

[README in the Localization folder]: Localization/README.md

## Installation

Unzip the PlanningNode folder into your GameData folder. The structure should look like this:

Kerbal Space Program
+-- GameData
+-- PlanningNode
+-- Icons
+-- Localization
+-- Plugins

## Usage

Planning nodes can be edited in the map view and viewed in the tracking station.

1. Launch or switch to a vessel.
2. Open the map view.
3. Set your target body so you will be able to see the close approach markers.
4. Click the Planning Node icon in the toolbar (![icon](Icons/PlanningNode.png)). A planning node will be created and opened for editing, and the view will zoom to display it.
![created]
5. Use the node editing tools to set up the transfer you wish to perform (drag the node, add prograde/normal/radial components, etc.). You can also choose a name for this transfer and determine whether it should be shown for all vessels or just the current vessel in the editing window next to the toolbar button.
![transfer]
![renamed]
6. Click the close button in the Planning Node window or click the toolbar button again. The view will zoom back to your craft, and a three-ring marker will appear showing the time and excess V needed to execute your transfer. You might have to pan around to find it if it isn't immediately in front of the camera. (Note that the excess V is **not** your burn delta V, but rather how much faster than escape velocity you need to go.)
![marker]
7. Create a stock maneuver node and increase its delta V until you are escaping the current sphere of influence; the planning node's timing and excess V displays will switch from absolute values to the difference between them and your current escape.
8. It's usually easiest to match the excess V first, so do that. This step is somewhat forgiving; you can often get within a few dozen m/s and call it good enough.
9. Adjust the time and normal/antinormal handles till your point of escape lines up with the planning node's bulls-eye marker. This tends to be a bit forgiving as well, so don't worry about hitting the exact center. Excitedly use the phrase "five by five" in a sentence.
10. Right click the node and use the forward/back orbit buttons to match up the times; if you are too early, the planning node will the time difference in the usual format, and if you are too late, the time difference will appear in parentheses. This is the most forgiving step because transfer windows are generally weeks long. Note that the stock controls can require **many** clicks here, so you may want to install a maneuver editing mod (not included).
![escape]
11. Zoom out to solar orbit to see how close you are to your plan. You may already have an encounter!

[created]: https://raw.githubusercontent.com/HebaruSan/PlanningNode/master/screenshots/created.png
[transfer]: https://raw.githubusercontent.com/HebaruSan/PlanningNode/master/screenshots/transfer.png
[renamed]: https://raw.githubusercontent.com/HebaruSan/PlanningNode/master/screenshots/renamed.png
[marker]: https://raw.githubusercontent.com/HebaruSan/PlanningNode/master/screenshots/marker.png
[escape]: https://raw.githubusercontent.com/HebaruSan/PlanningNode/master/screenshots/escape.png

Other notes:

- You can click the text labels for a planning node to edit it.
- You can use the "New" button in the dialog to create multiple nodes for the same vessel, and the `<` and `>` buttons next to the name field to switch to other nodes.
- Editing in the tracking station would be desirable but is not possible because the stock maneuver editor crashes outside of the flight scene's map view.
- Similarly, you may experience extreme log spam in some instances while editing nodes due to the stock maneuver editor being extremely sensitive about being used in unexpected ways (and the difficulty of figuring out what it takes to pacify it).
- Blizzy's toolbar is not and will not be supported. 0.23.5 was a **long** time ago.

## How to donate

[![Donate][Donation image]][Donation link]

[Donation link]: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7H2LCH6SP7TTE&lc=US&item_name=HebaruSan_Mods&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted

[Donation image]: https://i.imgur.com/M9m07Qw.png

<!--
## Acknowledgements
So far there are no translations, but this section should exist.
-->
Loading

0 comments on commit 34b308d

Please sign in to comment.