Skip to content

Commit

Permalink
Finish the documentation for all the main UPE features.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarklord committed Jan 18, 2024
1 parent 4988363 commit 3ba38dd
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Writerside/topics/Documentation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Documentation

You can find developer documentation for Universal Property Enhancer here.
You can find developer documentation for [Universal Property Enhancer](https://zarklord.github.io/spore/universal-property-enhancer.html) here.

<seealso style="cards">
<category ref="features">
Expand Down
30 changes: 16 additions & 14 deletions Writerside/topics/Palette-Icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@
<web-summary>Use UPE to add custom palette icons to your part pages</web-summary>
<card-summary>Use UPE to add custom palette icons to your part pages</card-summary>

All palette icon data is defined inside the <path>paletteicons</path> folder, so you must first create that folder in your mod.

Create a <path>.prop</path> file with a unique name in the <path>paletteicons</path> folder.
<warning>
<p>
Ensure that all prop files in the <path>paletteicons</path> folder have a unique name, if they share a name with another mod, it won't work.
</p>
</warning>
<tip>
<p>
It's usually a good idea to use your mod's name, to reduce the chance of conflicting with other mods.
</p>
</tip>
## Feature

You can add custom palette icons with this feature, like Creepy & Cute and Bot Parts do.

## Usage

<include from="Snippets.topic" element-id="upe-api-folder"/>
<var name="upe-api-type" value="palette icon">
<var name="upe-api-folder" value="paletteicons">

Add the following properties to that prop file:

Expand Down Expand Up @@ -52,4 +48,10 @@ Then for every page you want to have your icon, add the following property:
```
int32 palettePageSetId hash(PALETTEICONPROP)
```
Editing `PALETTEICONPROP` to be the name of your palette icon prop file (excluding the file extension).
Editing `PALETTEICONPROP` to be the name of your palette icon prop file (excluding the file extension).

<seealso style="cards">
<category ref="external">
<a href="https://zarklord.github.io/spore/Universal-Property-Enhancer.html" summary="Mod Page">Universal Property Enhancer</a>
</category>
</seealso>
47 changes: 46 additions & 1 deletion Writerside/topics/Property-List-Duplication.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,49 @@
<web-summary>Use UPE to duplicate property lists to new locations</web-summary>
<card-summary>Use UPE to duplicate property lists to new locations</card-summary>

TODO
## Feature

Allows you to make a single <path>.prop</path> get loaded in multiple places.
A common use case is for EditorKeys, where you commonly need to maintain the same exact file in multiple locations,
with this you can maintain one file and duplicate it to the other places.

## Usage

<include from="Snippets.topic" element-id="upe-api-folder"/>
<var name="upe-api-type" value="property duplications">
<var name="upe-api-folder" value="prop_duplications">

In that <path>.prop</path> file, add a string8s array, with each entry duplicating a <path>.prop</path> file.
```
string8s duplicateList
end
```
To duplicate a property, add an entry to that list, each entry has the following format:
```
"target_keyname source_keyname"
```
There should be a `key` property in the same file, with the same name that you used for `target_keyname`, which tells UPE where to duplicate this <path>.prop</path> file to.

There should also be a `key` property in the same file, with the same name that you used for `source_keyname`, which tells UPE what <path>.prop</path> file is being duplicated.

As an example, your file might look something like this:
```
string8s duplicateList
"ca_editorkeys editor_keys"
"ce_editorkeys editor_keys"
"sa_editorkeys editor_keys"
"ta_editorkeys editor_keys"
end
key ca_editorkeys ca_EditorKeys~!mycustom_editorkeys
key ce_editorkeys ce_EditorKeys~!mycustom_editorkeys
key sa_editorkeys sa_EditorKeys~!mycustom_editorkeys
key ta_editorkeys ta_EditorKeys~!mycustom_editorkeys
key editor_keys mycustom_editorkeys!editorkeys
```

<seealso style="cards">
<category ref="external">
<a href="https://zarklord.github.io/spore/Universal-Property-Enhancer.html" summary="Mod Page">Universal Property Enhancer</a>
</category>
</seealso>
80 changes: 79 additions & 1 deletion Writerside/topics/Property-Postinits.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,82 @@
<web-summary>Use UPE to modify existing property lists</web-summary>
<card-summary>Use UPE to modify existing property lists</card-summary>

TODO
## Feature

Allows you to modify property lists, without actually modifying the original <path>.prop</path> file,
this is primarily useful in maintaining compatibility with other mods.

<tip>
<p>
Currently there is a limitation where you cannot add or remove individual elements from arrays.
</p>
</tip>

## Usage

<include from="Snippets.topic" element-id="upe-api-folder"/>
<var name="upe-api-type" value="property postinit">
<var name="upe-api-folder" value="prop_postinits">

In that <path>.prop</path> file, add a string8s array, with each entry postinit-ing another <path>.prop</path> file.
```
string8s postinitList
end
```
To add a property list postinit, add an entry to that list, each entry has the following format:
```
"source_proplist target_proplist"
```
There should be a `key` property in the same file, with the same name that you used for `source_proplist`, which tells UPE what <path>.prop</path> file to postinit.

There should also be a `key` property in the same file, with the same name that you used for `target_proplist`, which tells UPE what <path>.prop</path> file to for postinit-ing.

As an example, your file might look something like this:
```
string8s postinitList
"cl_mouth_filter_01 cl_mouth_filter_01_postinit"
"cl_mouth_jaw_01 cl_mouth_jaw_01_postinit"
"cl_mouth_poker_01 cl_mouth_poker_01_postinit"
end
key cl_mouth_filter_01 cell_parts~!cl_mouth_filter_01
key cl_mouth_filter_01_postinit my_postinits!cl_mouth_filter_01
key cl_mouth_jaw_01 cell_parts~!cl_mouth_jaw_01
key cl_mouth_jaw_01_postinit my_postinits!cl_mouth_jaw_01
key cl_mouth_poker_01 cell_parts~!cl_mouth_poker_01
key cl_mouth_poker_01_postinit my_postinits!cl_mouth_poker_01
```

Each postinit file can optionally contain these two special properties:
- ```
key newParent path_to!new_parent
```
Which will change the parent of the postinit-ed property.

- ```
uint32s removeProperties
end
```
This is an array of property hashes, that will remove that property from the postinit-ed property.
You can convert from a property name to the hash in the <ui-path>Utilities</ui-path> tab of SMFX.

As an example, it might look like this:
```
uint32s removeProperties
0x9416CEA1 #modelHideDeformHandles
end
```
<tip>
<p>
It's a good idea to use a comment <code>#</code>, to put the actual property name after the number,
so it's easier to read your files.
</p>
</tip>


<seealso style="cards">
<category ref="external">
<a href="https://zarklord.github.io/spore/Universal-Property-Enhancer.html" summary="Mod Page">Universal Property Enhancer</a>
</category>
</seealso>
43 changes: 42 additions & 1 deletion Writerside/topics/Property-Replacement.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,45 @@
<web-summary>Use UPE to universally replace properties</web-summary>
<card-summary>Use UPE to universally replace properties</card-summary>

TODO
## Feature

Allows you to globally modify any property with a new value.

## Usage

<include from="Snippets.topic" element-id="upe-api-folder"/>
<var name="upe-api-type" value="property replacement">
<var name="upe-api-folder" value="prop_overrides">

In that <path>.prop</path> file, add a string8s array, with each entry creating a new global property override.
```
string8s replacementList
end
```
To replace a property, add an entry to that list, each entry has the following format:
```
"data_type target_property_hash source_property_name"
```
`data_type` should be the value type of the target property you are replacing, for example, `float` or `int32`.

`target_property_hash` should be the numeric value of the property you are replacing, for example, to replace the property
`modelMinScale` you would use the number `0xF023ED73`. You can convert from a property name to the hash in the <ui-path>Utilities</ui-path> tab of SMFX.

Define a property with the `data_type` you put, and the name should match `source_property_name`.
This controls the value of the replaced property.

As an example, your file might look something like this:
```
string8s replacementList
"float 0xF023ED73 minScaleValue"
"float 0xF023ED79 maxScaleValue"
end
float maxScaleValue 340282346638528860000000000000000000000
float minScaleValue 0
```

<seealso style="cards">
<category ref="external">
<a href="https://zarklord.github.io/spore/Universal-Property-Enhancer.html" summary="Mod Page">Universal Property Enhancer</a>
</category>
</seealso>
32 changes: 32 additions & 0 deletions Writerside/topics/Snippets.topic
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
title="Snippets" id="Snippets" is-library="true">

<snippet id="upe-api-folder">
<p>All %upe-api-type% data is defined inside the
<path>%upe-api-folder%</path>
folder, so you must first create that folder in your mod.
</p>
<p>Create a
<path>.prop</path>
file with a unique name in the
<path>%upe-api-folder%</path>
folder.
</p>
<warning>
<p>
Ensure that all prop files in the
<path>%upe-api-folder%</path>
folder have a unique name, if they share a name with another mod, it won't be loaded.
</p>
</warning>
<tip>
<p>
It's usually a good idea to use your mod's name, to reduce the chance of conflicting with other mods.
</p>
</tip>
</snippet>
</topic>

0 comments on commit 3ba38dd

Please sign in to comment.