GithubHelp home page GithubHelp logo

Comments (4)

Amazinite avatar Amazinite commented on June 12, 2024 2

Third approach: create a new root node bay. We'd keep category "bay type" to define which ships can be carried. We'd then have these named bay nodes that specify which ships from the "bay type" category they include. When defining a bay hardpoint on a ship, the type of bay that it is would use the named bay types instead of the category of ship that the bay holds. To make things easy, we could just have "Fighter" and "Drone" bay types where "Fighter" bay types can carry both fighters and drones so that we don't need to change any ship definitions to account for this new behavior.

# The categories of ship that can be carried in bays.
category "bay type" 
 	"Drone" 
 	"Fighter"

# Fighter bays carry both fighters and drones.
bay "Fighter"
	"Fighter"
	"Drone"

# Drone bays carry only drones.
bay "Drone"
	"Drone"

# This "Fighter" bay refers to the "Fighter" bay node instead of the "Fighter" category.
ship ...
	bay "Fighter" x y

For the sake of compatibility with plugins that may have added new "bay type" category entries, we'd need to also fall back onto looking for a category instead of a bay node if no bay node is found.

# Imagine a plugin added a new bomber bay type.
category "bay type" 
 	"Drone" 
 	"Fighter"
 	"Bomber"

# Since vanilla doesn't have a "Bomber" bay node, this would fail if we didn't 
# fall back onto looking at the "bay type" category if no bay node with this name
# exists.
ship ...
 	bay "Bomber" x y

This maintains the customization options of the first approach while maintaining backwards compatibility with save files and plugins like the alternative approach.

from endless-sky.

OcelotWalrus avatar OcelotWalrus commented on June 12, 2024

Definitely a nice addition!

from endless-sky.

xX-Dillinger-Xx avatar xX-Dillinger-Xx commented on June 12, 2024

Maybe, change the name of the bays to something like Landing Bays or Docking Bays. I think it makes more sense if the bays are to become universal. Will it make it easier to use with the UI?

EDIT: forget this comment, the 3rd approach sounds great.

from endless-sky.

tibetiroka avatar tibetiroka commented on June 12, 2024

Third approach: create a new root node bay. [...]

I really like this idea. We should make sure that these bay nodes can be expanded, so plugins can add new ship types to existing bays without having to redefine the entire node (which would not work if multiple plugins wanted to add new entries to the same bay).

from endless-sky.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.