Skip to content

Commit 1182d3f

Browse files
author
Okaetsu
authored
Merge pull request #40 from Okaetsu/docs_040
Docs Update for 0.4.0
2 parents 1c85869 + 5fb9dfa commit 1182d3f

18 files changed

Lines changed: 2980 additions & 1976 deletions

website/docs/features.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Features
6+
7+
PalSchema is a mod that allows runtime modification of assets in Palworld with json files without introducing conflicts with other mods that modify the same game files. As the name suggests, heavy use of json schema is utilized, so mod creators can have autocompletion and error checking to make creation of table mods easier.
8+
9+
---
10+
11+
- **Runtime Modification of Assets** - Main purpose of PalSchema is to be able to modify the game's assets via `.json` or `.jsonc` files. This includes `DT (Data Table)`, and `BP (Blueprint)` assets. Note that when it comes to Data Tables, you'll also be able to add new rows.
12+
13+
- **Stability throughout Updates** - As we know, Palworld is in Early Access and this means frequent updates which results in traditional `.pak` mods breaking often. Lua mods are a great stable alternative, but they require coding knowledge and have some limitations currently on what they can and can't do. PalSchema aims to bring stability to the table while also making it super easy to create and modify existing mods.
14+
15+
- **Custom Localization** - Ever wondered when a game plans on adding support for your language? If it doesn't exist, you'll be able to create it with PalSchema very easily.
16+
17+
- **Auto-reload** - When enabled via the config, PalSchema detects any new changes made to your json files, reloads and applies those changes all while the game is still running which means you'll never have to exit the game to test for new changes, however there are some exceptions to this.
18+
19+
- **Pak Reader Redirection** - Allows you to package any PalSchema related `.pak` files with your mod by creating a `paks` folder within your PalSchema mod. PalSchema will then read any `.pak` files you have within that `paks` folder, rather than having to do complicated setups via the default `Paks` location.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "Enums",
3+
"position": 5,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}
59 KB
Loading
6.96 KB
Loading
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Adding New Enums
6+
7+
So in case you've been working with adding custom Pals, you'll immediately notice that the `Tribe` property becomes pretty important. With 0.4 adding Enum support, it's now possible to create new tribes and we'll go through the basics of adding new enums.
8+
9+
## Setting up your Project
10+
11+
1. You'll want to create your mod folder, for this tutorial let's just call it `MyCustomEnums`.
12+
13+
2. Create another folder called `enums` inside `MyCustomEnums`. It's very important to call the sub folder `enums` because this is where PalSchema will look for any custom enums.
14+
15+
3. Next, let's create a json file inside our `enums` folder. You can call the .json file whatever you want, I decided to call mine `new_tribes.json`.
16+
17+
![](assets/newenums/tribes_file.png)
18+
19+
4. Open the `new_tribes.json` file and add the following inside of it:
20+
21+
```json
22+
{
23+
"EPalTribeID": [
24+
"PurpleCat",
25+
"KarateDog"
26+
]
27+
}
28+
```
29+
30+
Let's break the above into parts:
31+
- `EPalTribeID` is the Enum we want to target.
32+
- You must then provide an array of strings which are the new Enum values you want to add, in this case to `EPalTribeID`.
33+
- You must make sure to not include the namespace in the value, so make sure you don't do something like `EPalTribeID::PurpleCat`. Just do `PurpleCat`.
34+
35+
## Confirming in Live View
36+
37+
You can confirm the addition of your new values by starting up Palworld with UE4SS' LiveView enabled and searching for `EPalTribeID` in the Live View tab and then clicking on the EPalTribeID that popped up during search. Introduction to Live View can be found on the [UE4SS docs](https://docs.ue4ss.com/dev/feature-overview/live-view.html).
38+
39+
![Live View search result with new enums showing up inside EPalTribeID](assets/newenums/liveview_result.png)
40+
41+
## Using your Custom Enums
42+
43+
To use your newly added enums, you just reference them like you would do it normally. We'll assume we have our custom pal created in the pals folder with the following in it:
44+
45+
```json
46+
{
47+
"PurpleCat": {
48+
"Tribe": "EPalTribeID::PurpleCat"
49+
},
50+
"KarateDog": {
51+
"Tribe": "EPalTribeID::KarateDog"
52+
}
53+
}
54+
```
55+
56+
And there you have it! You can do this with any native Enum. You can differentiate by checking if the Enum starts with /Game/, this means that it's a User Defined Enum which is a blueprint asset basically. Native Enums start with /Script/.
57+
58+
Do note that having the ability to create Enums is very powerful and is not only limited to custom pals.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Wildcard
6+
7+
In Raw Tables, you have the ability to use wildcards to apply changes to every row of the table you're targeting. This can be a very useful alternative to just manually duplicating your change to every row.
8+
9+
Using wildcards is very simple, you just write a `*` instead of the row name, I'll leave an example below:
10+
11+
```json
12+
{
13+
"DT_PalMonsterParameter": {
14+
"*": {
15+
"WorkSuitability_EmitFlame": 5
16+
}
17+
}
18+
}
19+
```
20+
21+
Now every Pal should have maxed out Kindling work suitability, though it's a different story if they can utilize it! You can use wildcards for any data table and property.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Translations",
3+
"position": 7,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}
8+
227 KB
Loading
21.9 KB
Loading
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Intro to Translations
6+
7+
Hello there! So you're interested in creating new localization entries for the game? You've come to the right place!
8+
9+
With PalSchema you can also support languages that aren't normally supported by the game.
10+
11+
## Setup
12+
13+
1. First, let's create a new mod folder called `MyTranslation`.
14+
15+
2. Inside `MyTranslation`, you'll want to create another folder called `translations`. This folder **must** be called `translations` so it can be recognized by PalSchema.
16+
17+
## Language Codes
18+
19+
Before we get back to our mod, we'll have to first understand what a 'language code' is. Language code is basically abbreviations that represent different languages like `en` for English for example. This is something commonly used in computing context for translation related stuff.
20+
21+
PalSchema utilizes ISO 639 two-letter codes to determine which language it should be using, just like Unreal Engine does. You can check all the available language codes over here https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes
22+
23+
For now, let's just use `en`, so English. However you're welcome to try different languages.
24+
25+
## Creating the Localization Folder(s)
26+
27+
1. In the [Setup](#setup) section, the last thing we did was creating a `translations` folder, we'll want to create a folder called `en` inside the `translations` folder which means we'll be altering or creating translations for the English localization.
28+
29+
2. Inside the `en` folder, create a new file called `example_translation.json`.
30+
31+
3. Open `example_translation.json` and write this inside of it:
32+
33+
```json
34+
{
35+
"DT_PalNameText": {
36+
"PAL_NAME_PinkCat": "Not Cattiva"
37+
}
38+
}
39+
```
40+
41+
`DT_PalNameText` is where the names of all Pals are stored and you might notice that it has this weird prefix `PAL_NAME_`. This is different for each localization file and is necessary to make sure the game actually reads these entries. We'll be modifying the name of Cattiva in the above example.
42+
43+
4. Now we can launch the game and check if our changes took effect!
44+
45+
![Cattiva with a modified name of Not Cattiva in-game](assets/intro/cattiva.png)
46+
47+
Success!
48+
49+
## Going Further
50+
51+
Now that you have the basic understanding of translation mods, you'll be able to create and modify localizations for anything in the game. I recommend using FModel and exploring the localization files which can be found in `Pal/Content/L10N`.
52+
53+
![Preview of the L10N folder as seen in FModel](assets/intro/fmodel.png)

0 commit comments

Comments
 (0)