Skip to content

Editor Tools and creating NPC and Items

Slashscreen edited this page Jul 4, 2023 · 1 revision

Items

The process for creating an item is as follows:

  1. Create a WorldItem and position it in the world.
  2. In the WorldItem's inspector, create a new instance.
  3. Within the instance, create a new Data, and customize as you see fit. Or, if you already have an ItemData you'd like to use, plug that in.
  4. Fill in both Ref ID Fields.
  5. Make unique and save in your "entites" folder with the same name as your refid. Also do this to the item data if you'd like to use it more than once. Where you save it and what it's called matters not. Done! You should now have a new item. Note: You may have to deselect and reselect the WorldItem to get the position to sync automatically. I'll fix this... at some point.

Item Data

Items have "data" and "instances" of data, so you can make one sword and have multiple of the same kind of sword across the world. Here's a brief look at how to make one of these.

Prefab: This is the scene that spawns in to represent the item in the world. This can be any scene, but it should inherit from ItemPuppet. A premade scene you can instantiate has been provided, but it is not fit for some items.

Hand Model: This is what prefab is spawned in your NPC or Player's hands/body when they equip an item. You don't have to set this - it will default to Prefab if nothing is set - but this is useful for, say, having a spell be some particles in your hand rather than just holding the book you learned it from.

Components: For maximum reusability and extensibility, items' properties are split up into many components made of small chunks of data that determine their behavior; for example, ThrowableComponent allows the item to be thrown, and EquippableComponent allows items to be equipped into slots.

NPCs

Creating an NPC is largely the same as creating an item, with a WorldNPC instead. However, NPC data has some different fields:

Covens: What covens this NPC belongs to, and their rank within them. AI Modules: the AI Modules that this NPC will use to determine their AI behavior. Without them, they won't do a whole lot other than stand there looking pretty. Schedule: The routine this NPC will follow throughout the day.

The deselecting and reselecting thing is an issue with WorldNPC as well.

Granular Navigation

TODO: Write this in more detail, but in theory you just use the network graph normally, but align the Portals with your doors, and save in "res://networks". In the future this will be more tightly integrated.

Doors

To create a door:

  1. Create a door node (shocking).
  2. Give it a model and a collider.
  3. Create a door data resource, and save it somewhere.
  4. Hit "Sync position data". This will update the world (assuming the open scene's root is the world name, which it should be), position, and rotation.
  5. Repeat the same steps for another door.
  6. Drag eachother's door instance resources into the other, linking them together. They are now linked. Note: the "Jump to connection" button is broken right now. This may become less cumbersome to set up in the future, although I have yet to figure out how. One it's set up though, it is trivial to adjust your door, as long as you hit the "update position" button.

Quests

Refer to JournalGD's Wiki.

Clone this wiki locally