db0 / godot-card-game-framework

A framework which comes with prepared scenes and classes to kickstart your card game, as well as a powerful scripting engine to use to provide full rules enforcement.
http://dbzer0.com/projects/godot-card-game-framework/
GNU Affero General Public License v3.0
895 stars 96 forks source link

Optional Definition Meta attributes #106

Closed zombieCraig closed 3 years ago

zombieCraig commented 3 years ago

Allows for setting attributes in your SetDefinitions without needing a matching label. For

instance you can create a "Rarity" attribute that tells your deck building function how many cards to put in a deck. If you don't have matching label it will spit out a warning but won't crash. If you start your attribute with an '_' like "_Rarity" it will surpress this warning.

db0 commented 3 years ago

Hmm, why would you ever want that though? As the developer, I think you'd want to crash to let you know when you forgot a property? This is why I didn't prevent it in the first place. This can only happen if you've defined properties for a card type that don't exist in _card_labels so would be caused purely by a developer omission which I'm sure they'd want to prevent.

Just trying to envision the scenario this prevents.

zombieCraig commented 3 years ago

I want to have meta values defined in my set. Instead of printing a warning we could abort if they don't start the label with a _ such as "_Rarity". I want to be able to easily define specific values in my sets that the engine/deckbuilder can use to make decisions that are unrelated to scripting.

Personally I don't care if it prints out a warning or aborts for a missing label but I do want the ability to have "internal labels" that start with a _

db0 commented 3 years ago

Ah I see what you mean now. I thought I had that implemented already, but obviously not :)