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.
CardFilter
class can now call custom_check()
. This allows any game to extend it with extra functionalityCardFilter
class can now filter against array/dictionary size_pre_task_exec()
in ScriptingEngineSetPreload
somewhere in your custom folder.
You can copy over "res://src/dreamscape/cards/sets/SetPreload.gd"
from CGF to get started.get_scripts()
function needs to be extended to require a second, boolean variable. You can use it to return script results that are otherwise onformated
and they will be stores permanently in cfc, in case you want to be able to retrieve an individual card's script for permanent modificatio outside of the Card class.CardFilter
class which can be fed the properties of any card and return true/false if the card fulfils the filter.has_card()
in CardContainerhas_card_name()
in CardContainerhas_preview_card()
in CVPreviewPopupsort_scriptables_by_name()
can now handle 'card_name'spawn_card_to_container
which allows new cards to be spawned directly to containers.
It also allows for the player to be asked to select a card out of selection from the whole card library, using CardFiltersstate_changed
signal on Cardtarget_found
signal on Targeting Arrowprocess_more_card_inputs()
overridable methodcfc.quit_game()
to allow the cgf-related stuff to be deinstanced (for example when returning to a main screen)CFConst.FONT_SIZE_CACHE
has to exist. Best practice is to set it to "user://CGFFontCache.json"CardConfig.BOOL_PROPERTY_TO_HIDE_IN_CARDVIEWER
has to exist. Defaults to "hide_in_dekbuilder"
but this const allows you to set it to anything else.CardConfig.TYPES_TO_HIDE_IN_DECKBUILDER
renamed to CardConfig.TYPES_TO_HIDE_IN_CARDVIEWER
CardConfig.REPLACEMENTS
has to exist. Defaults to an empty dictionary. See comments for its descriptioncfc.hide_all_previews()
which will hide all currently opened card preview popups."subject":"previous"
tasksnested_script
task allows to execute more tasks recursively. It allows for infinite amount of nests, which can create pretty complex combinations of scripts.KEY_NEEDS_SELECTION
, KEY_SELECTION_COUNT
, KEY_SELECTION_TYPE
, KEY_SELECTION_OPTIONAL
, KEY_SELECTION_IGNORE_SELF
_rect_adjustment
text_expansion_multiplier
compensation_label
CardViewer
. new CardLibrary inherits from the same class.CGFBoardControlLayout.tscn
New CFConst poperties added:
THUMBNAIL_SCALE
PREVIEW_SCALE
FOCUSED_SCALE
These allow you to adjust how much to scale the cards depending on where they're placed. You NEED to add these to CFConst.
get_class()
common_pre_run()
which can be used to run custom methods in an extended scripting engine before executioncache_cleared
which fires every time the cache is cleared, which typically signifies a game-state-changeset_to_idle()
get_all_scriptables()
which can be extended to gather any type of object needed.shuffle_container()
will now wait for animations to finish before shuffling, and then wait until its own animation is finished before proceeding.VIEWPORT_FOCUS_ZOOM_TYPE
is set to "resize"now happens recursively which allows games to easily use this feature without manually specifying all the rects in the card_front.
This allows a designer to design the card layout in the GODOT GUI and then the game will automatically handle the scaling.
This is not perfect as when scaling too high or too low, some elements might get slightly out of alignment compared to the scale 1,1, but it should be good enough.tutor
and boardseek
subjects now accept a new key sort_by
which can resort the gathered cards based on a property, a token, or even randomly.modify_properties()
task can now accept per_
as valueMain.tcsn has been modified with a new node called FocusInfo
which shows card details under the viewport focus. For this scene, the "Info Panel Scene" to use needs to be specified. It is an exported variable so you can set it in the inspector.
A sample such scene has been provided in res://src/custom/CGFInfoPanel.tcsn
. If this is not set, the game will crash when mousing over the cards.
If the deckbuilder is also inherited in a custom scene, it will likewise has the same FocusInfo
node for which the "Info Panel Scene" has to be specified in the inspector.
New mandatory CardConfig property added: TYPES_TO_HIDE_IN_DECKBUILDER
(Array). Any card type specified here will not be shown in the deckbuilder.
New mandatory CardConfig property added: EXPLANATIONS
(Dictionary). It stores details about tags and keywords that you want to display under your card popups in game or deckbuilder.
You will need to specify these new CardConfig properties, even if they're empty
New CFConst poperty added: VIEWPORT_FOCUS_ZOOM_TYPE
. Set to either "resize" or "scale" (default = "resize"). If set to scale, will magnify the card during viewport focus using godot scaling. If set to resize, will resize the card's viewport dupe's dimentions. This prevent blurry text, but needs more setup in the card's front script.
Game has been adjusted to allow the ScriptingEngine to work non-Card classes. To enable this the following changes have been made which might affect your game if you've extended the Card or ScriptingEngine classes
card_name
property has been renamed to canonical_name
retrieve_card_scripts
function has been renamed to retrieve_scripts
owner_card
variable has been renamed to owner
and is not expected that it be a Card class"_hide_in_deckbuilder": true
. If you do, they will not be shown in the deckbuilder.