Skip to content

Commit

Permalink
Add a couple script commands and re-organize sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltContainer committed Oct 20, 2023
1 parent 1530882 commit f614429
Show file tree
Hide file tree
Showing 18 changed files with 140 additions and 82 deletions.
8 changes: 0 additions & 8 deletions rom-hacking/art/_category_.json

This file was deleted.

8 changes: 0 additions & 8 deletions rom-hacking/audio/_category_.json

This file was deleted.

8 changes: 0 additions & 8 deletions rom-hacking/exefs/_category_.json

This file was deleted.

4 changes: 0 additions & 4 deletions rom-hacking/exefs/debugging.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 7
---

# Debugging

## Introduction
Expand Down
4 changes: 0 additions & 4 deletions rom-hacking/exefs/exlaunch.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 3
---

# Setting Up ExLaunch

## Introduction
Expand Down
4 changes: 0 additions & 4 deletions rom-hacking/exefs/ghidra.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 2
---

# Setting Up Ghidra

## Introduction
Expand Down
4 changes: 0 additions & 4 deletions rom-hacking/exefs/guide.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 1
---

# ExeFS Modding Guide

## Introduction
Expand Down
4 changes: 0 additions & 4 deletions rom-hacking/exefs/headers.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 4
---

# Headers

## Introduction
Expand Down
4 changes: 0 additions & 4 deletions rom-hacking/exefs/hooks.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 5
---

# Hooks

## Introduction
Expand Down
4 changes: 0 additions & 4 deletions rom-hacking/exefs/logging.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 6
---

# Logging

## Introduction
Expand Down
4 changes: 0 additions & 4 deletions rom-hacking/intro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
sidebar_position: 1
slug: /
---
# ROM Hacking

Learn how to make your own modifications to the Pokemon BDSP ROM.
8 changes: 0 additions & 8 deletions rom-hacking/scripting/_category_.json

This file was deleted.

25 changes: 25 additions & 0 deletions rom-hacking/scripting/commands/end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# (3) _END

## Synonyms

- _NOP

## Effect

Ends the script.

## Syntax

```c
_END()
```

## Example

```c
_LDVAL(@LOCALWORK1, 1)
_END()
_SE_PLAY('S_PINPON')
```
The above script will set the work variable @LOCALWORK1 to 1, then end script execution. The command on line 3 will not be executed.
28 changes: 28 additions & 0 deletions rom-hacking/scripting/commands/time-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# (4) _TIME_WAIT

## Effect

Blocks script execution for the amount of time given.
The **result** work is set to 0 on every loop until the time has expired. It is then set to 1 and execution resumes.

## Syntax

```c
_TIME_WAIT(time, result)
```
| Argument | Description | Types |
| - | - | - |
| **time** | The amount of time to wait, in frames (1/30ths of a second) | Work, Float |
| **result** | The work to put the result into | Work |
## Example
```c
_TIME_WAIT(120, @LOCALWORK2)
_SE_PLAY('S_PINPON')
```

The above script will block script execution for approximately 4 seconds. The work variable @LOCALWORK2 is set to 1 upon execution resuming.

Finally, the sound effect 'S_PINPON' plays.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

# EV-AS Guide

This guide is for the setup of z80Rotom's [ev-as scripting tool](https://github.com/z80rotom/ev-as) and expects a few bare minimum skills. You should know how to download GitHub repositories, whether by downloading the zip or cloning the repo. You should also be comfortable with running commands such as `python` and `cd` from the terminal/command prompt/PowerShell.

For Pokémon Luminescent, as of 8th June 2023, I will be recommending the usage of the [`custom_commands` branch](https://github.com/z80rotom/ev-as/tree/custom_commands). This is required to ensure the functionality of Eterna's gym, as well as other events in the future.

# Setup
## Setup

In this tutorial, we will be working with the source code and will therefore need to download some large dependencies. This is so we can work with the latest release at all times and most Unity modding tools will require these dependencies anyway.

Expand All @@ -19,23 +18,23 @@ Once you have your dependencies, Python and ev-as ready to go, create a folder i

Finally, create a folder called `scripts`. We will use this later.

# Additional Setup
## Additional Setup

For the purpose of macro commands, you will need to install the [BDSP Repacker](https://github.com/Ai0796/BDSP-Repacker) and unpack your `romfs\Data\StreamingAssets\AssetAssistant\Message\english` file. Once unpacked, you will have the various JSONs that ev-as requires. No further setup is necessary at this point. The `AssetFolder` must be copied into ev-as' main folder after unpacking.

## Usages
### Usages

When editing scripts, you **must** copy your .ev file of choice from the `parsed` folder and paste it in your `scripts` folder. **Changes made to files in `parsed` will not be reflected**.
ev-as has a few different commands that can be run. This tutorial will assume you have opened a terminal in the main ev-as folder.

## ev_as.py
### ev_as.py

Run via: `python .\src\ev_as.py`

Takes all the .ev files from the `scripts` folder, assembles it and repacks it into the Unity ev_script bundle. It will also check your scripts for improper label usage, as well as pack any macro messages into your dialogue file.

## ev_parse.py
### ev_parse.py

Run via: `python .\src\ev_parse.py`

Takes the provided `Dpr/ev_script` file, extracts and parses all of the individual script files to the generated `parsed` folder.
Takes the provided `Dpr/ev_script` file, extracts and parses all of the individual script files to the generated `parsed` folder.
File renamed without changes.
File renamed without changes.
92 changes: 81 additions & 11 deletions sidebarsROMHacking.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,91 @@

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
ROMHackingSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
tutorialSidebar: [
docs: [
'intro',
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
label: 'Scripting',
link: {
type: 'generated-index',
slug: 'category/scripting',
description: 'Everything about ev_scripts.',
},
collapsed: true,
items: [
{
type: 'category',
label: 'Setting up',
link: {
type: 'generated-index',
slug: 'category/scripting/setup',
description: 'Setup instructions and guides on editing in-game ev_scripts. This is all done in RomFS.',
},
collapsed: true,
items: [
'scripting/setup/ev-as',
'scripting/setup/placedatas',
'scripting/setup/scripting-guide',
],
},
{
type: 'category',
label: 'Commands',
collapsed: true,
items: [
'scripting/commands/end',
'scripting/commands/time-wait',
],
},
],
},
{
type: 'category',
label: 'ExeFS Editing',
link: {
type: 'generated-index',
slug: 'category/exefs',
description: 'Modifying the underlaying game code, or Executable File System (ExeFS).',
},
collapsed: true,
items: [
'exefs/guide',
'exefs/ghidra',
'exefs/exlaunch',
'exefs/headers',
'exefs/hooks',
'exefs/logging',
'exefs/debugging',
],
},
{
type: 'category',
label: 'Art',
link: {
type: 'generated-index',
slug: 'category/art',
description: 'Guides for editing textures models and animations.',
},
collapsed: true,
items: [
'art/animations',
'art/mesh_and_texture_replacement',
],
},
{
type: 'category',
label: 'Editing music and sound files.',
link: {
type: 'generated-index',
slug: 'category/audio',
description: 'Editing music and sound files.',
},
collapsed: true,
items: [
'audio/labels',
],
},
],
*/
]
};

module.exports = sidebars;

0 comments on commit f614429

Please sign in to comment.