Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export and import scenes #633

Closed
theCapypara opened this issue Oct 3, 2023 · 0 comments
Closed

Export and import scenes #633

theCapypara opened this issue Oct 3, 2023 · 0 comments

Comments

@theCapypara
Copy link
Member

theCapypara commented Oct 3, 2023

Add a way to export and import scenes (SSA/SSS/SSE).

Proposal

  • The import/export functionality is added to the scene editor itself
    • Two buttons (one import, the other export) are added before the "Go to BG" button, using the export/import icons. They are separated by separators/spacing.
    • This means existing scenes can be exported in their data replaced via an import, similiar to other functionality in the editor
  • The export/import format is XML with the specification below
  • Any IDs to invalid outside references (actors, objects, script IDs) that are not found or invalid are replaced by a null or 0 value during import and a warning is shown
    • If an trigger has an invalid event assigned, refuse to import

XML structure

Notes

Triggers in the UI and XML are called Events in the skytemple-files models.
Events in the UI and XML are called Triggers in the skytemple-files models.
This has backwards compatibility reasons with existing tools and research.

Field names correspond to the field names in skytemple-files.

Overview

-> Scene
     -> Layers
         -> [Layer]
             -> [Actor]
                 -> Position
             -> [Object]
                 -> Position
             -> [Performer]
                 -> Position
             -> [Trigger]
                 -> Position
             -> [Unk10]
     -> Events
         -> [Event]
     -> PositionMarks
         -> [PositionMark]
             -> Position

Scene: Root

XML root node is Scene. The node has no attributes.

Position

XML node with the following attributes:

  • direction: This is the SSA value. Could use constants (LEFT,RIGHT, etc.)
  • x_pos
  • y_pos
  • x_offset
  • y_offset

Layers

A node with no attributes.

Layer

A node with no attributes.

Actor

Node with a mandatory Position child and the following attributes:

  • actor_id
  • script_id
  • unk_e

Object

Node with a mandatory Position child and the following attributes:

  • object_id
  • script_id
  • hitbox_width
  • hitbox_height
  • unk_12

Performer

Node with a mandatory Position child and the following attributes:

  • type
  • hitbox_width
  • hitbox_height
  • unk_10
  • unk_12

Trigger

Node with a mandatory Position child and the following attributes:

  • width
  • height
  • unk_e
  • event_id: Index into the event node list, starting with 0.

Unk10

Node with the following attributes:

  • unk_0
  • unk_2
  • unk_4
  • unk_6

Event

Node with the following attributes:

  • script_id
  • coroutine_id
  • unk_2
  • unk_3

PositionMarks

A node with no attributes.

PositionMark

Node with a mandatory Position child and the following attributes:

  • unk_8
  • unk_a
  • unk_c
  • unk_e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant