Skip to content

CFConst

Divided by Zer0 edited this page Jan 13, 2021 · 96 revisions

CFConst

Extends: Reference

Description

Card Gaming Framework global Behaviour Constants

This class contains constants which handle how all the framework behaves.

Tweak the values to match your game requirements.

Enumerations

FocusStyle

const FocusStyle: Dictionary = {"BOTH":2,"SCALED":0,"VIEWPORT":1}

The focus style used by the engine

  • SCALED means that the cards simply scale up when moused over in the hand
  • VIEWPORT means that a larger version of the card appears when mousing over it
  • BOTH means SCALED + VIEWPORT

ReturnCode

const ReturnCode: Dictionary = {"CHANGED":1,"FAILED":2,"OK":0}

The possible return codes a function can return

  • OK is returned when the function did not end up doing any changes
  • CHANGE is returned when the function modified the card properties in some way
  • FAILED is returned when the function failed to modify the card for some reason

IndexShiftPriority

const IndexShiftPriority: Dictionary = {"HIGHER":1,"LOWER":0}

Options for displacing choosing which of the CardContainers sharing the same anchor to displace more.

  • LOWER: The CardContainer with the lowest index will be displaced more
  • HIGHER: The CardContainer with the highest index will be displaced more Do not mix containers using both of these settings, unless the conflicting container's OverlapShiftDirection is set to "NONE"

OverlapShiftDirection

const OverlapShiftDirection: Dictionary = {"DOWN":2,"LEFT":3,"NONE":0,"RIGHT":4,"UP":1}

Options for displacing CardContainers sharing the same anchor

  • NONE: This CardContainer will never be displaced from its position
  • UP: This CardContainer will be displaced upwards. Typically used when this container is using one of the bottom anchors.
  • DOWN: This CardContainer will be displaced downwards.Typically used when this container is using one of the top anchors.
  • LEFT: This CardContainer will be displaced leftwards. Typically used when this container is using one of the right anchors.
  • RIGHT: This CardContainer will be displaced rightwards.Typically used when this container is using one of the left anchors.

ShuffleStyle

const ShuffleStyle: Dictionary = {"AUTO":0,"CORGI":3,"NONE":1,"OVERHAND":6,"RANDOM":2,"SNAP":5,"SPLASH":4}

Options for pile shuffle styles.

  • auto: Will choose a shuffle animation depending on the amount of cards in the pile.
  • none: No shuffle animation for this pile.
  • random: Will choose a random shuffle style each time a shuffle is requested.
  • corgi: Looks better on a small amount of cards (0 to 30)
  • splash: Looks better on a moderate amount of cards (30+)
  • snap: For serious people with no time to waste.
  • overhand: Shuffles deck in 3 vertical raises. Best fit for massive amounts (60+)

Constants Descriptions

ARRAY_PROPERTY_JOIN

const ARRAY_PROPERTY_JOIN: String = " - "

ATTACHMENT_OFFSET

const ATTACHMENT_OFFSET: Array = ["(-0.2, -0.2)","(0, -0.2)","(0.2, -0.2)","(0.2, 0)","(-0.2, 0)","(-0.2, 0.2)","(0, 0.2)","(0.2, 0.2)"]

Here you can adjust the amount of offset towards a side of their host card that attachments are placed.

This is a multiplier based on the card size.

You define which placement offset an attachment uses by setting the "attachment_offset" exported variable on the card scene

BOTTOM_MARGIN_MULTIPLIER

const BOTTOM_MARGIN_MULTIPLIER: float = 0.5

The margin towards the bottom of the viewport on which to draw the cards.

More than 0 and the card will appear hidden under the display area.

Less than 0 and it will float higher than the bottom of the viewport

CARD_SCALE_WHILE_DRAGGING

const CARD_SCALE_WHILE_DRAGGING: Vector2 = "(0.4, 0.4)"

The below scales down cards down while being dragged.

if you don't want this behaviour, change it to Vector2(1,1)

CARD_SET_NAME_PREPEND

const CARD_SET_NAME_PREPEND: String = "SetDefinition_"

The text which is prepended to files to signify the contain Card definitions for a specific set

CARD_SIZE

const CARD_SIZE: Vector2 = "(150, 240)"

The card size you want your cards to have. This will also adjust all CardContainers to match If you modify this property, you must adjust the min_rect of the various control nodes inside the card front and back scenes.

CostsState

const CostsState: Dictionary = {"DECREASED":"0.65,1.3,0,1.3","IMPOSSIBLE":"1.3,0,0,1.3","INCREASED":"1.3,0.65,0,1.3","OK":"1,1,1,1"}

This is used when filling in card property labels in Card.setup() when the property is an array, the label will still display it as a string but will have to join its elements somehow.

The below const defines what string to put between these elements. Returns a color code to be used to mark the state of cost to pay for a card

  • IMPOSSIBLE: The cost of the card cannot be paid.
  • INCREASED: The cost of the card can be paid but is increased for some reason.
  • DECREASED: The cost of the card can be paid and is decreased for some reason.
  • OK: The cost of the card can be paid exactly.

FANCY_MOVEMENT

const FANCY_MOVEMENT: bool = true

Switch this off to disable fancy movement of cards during draw/discard

FOCUS_HOVER_COLOUR

const FOCUS_HOVER_COLOUR: Color = "1,1,1,1"

The colour to use when hovering over a card.

Reduce the multiplier to reduce glow effect or stop it altogether

FOCUS_STYLE

const FOCUS_STYLE: int = 2

The focus style selected for this game. See enum FocusStyle

HAND_USE_OVAL_SHAPE

const HAND_USE_OVAL_SHAPE: bool = true

If set to true, the hand will be presented in the form of an oval shape If set to false, the hand will be presented with all cards horizontally aligned

HOST_HOVER_COLOUR

const HOST_HOVER_COLOUR: Color = "1,0.8,0,1"

The colour to use when hovering over a card with an attachment to signify a valid host.

We multiply it a bit to make it as bright as FOCUS_HOVER_COLOUR for the glow effect.

Reduce the multiplier to reduce glow effect or stop it altogether

NEIGHBOUR_PUSH

const NEIGHBOUR_PUSH: float = 0.75

The amount of distance neighboring cards are pushed during card focus

It's based on the card width. Bigger percentage means larger push.

PATH_ALTERANT_ENGINE

const PATH_ALTERANT_ENGINE: String = "res://src/core/AlterantEngine.gd"

This specifies the path to the Alterant Engine. If you wish to extend The alterant engine functionality with your own tasks, Point this to your own script file.

PATH_ASSETS

const PATH_ASSETS: String = "res://assets/"

The path where assets needed by this game are placed such as token images

PATH_CARDS

const PATH_CARDS: String = "res://src/custom/cards/"

The path where card template scenes exist. These is usually one scene per type of card in the game

PATH_CORE

const PATH_CORE: String = "res://src/core/"

The path where the Card Game Framework core files exist. (i.e. mandatory scenes and scripts)

PATH_CUSTOM

const PATH_CUSTOM: String = "res://src/custom/"

The path where scenes and scripts customized for this specific game exist (e.g. board, card back etc)

PATH_SCRIPTING_ENGINE

const PATH_SCRIPTING_ENGINE: String = "res://src/core/ScriptingEngine.gd"

This specifies the path to the Scripting Engine. If you wish to extend The scripting engine functionality with your own tasks, Point this to your own script file.

PATH_SCRIPT_PER

const PATH_SCRIPT_PER: String = "res://src/core/ScriptPer.gd"

This specifies the path to the ScriptPer class file. We don't reference is by class name to avoid cyclic dependencies And this also allows other developers to extend its functionality

PATH_SETS

const PATH_SETS: String = "res://src/custom/cards/sets/"

The path where the set definitions exist. This includes Card definition and card script definitions.

PATH_TOKENS

const PATH_TOKENS: String = "res://assets/tokens/"

This specifies the location of your token images. Tokens are always going to be seeked at this location

PLAY_AREA_SCALE

const PLAY_AREA_SCALE: Vector2 = "(0.8, 0.8)"

The scale of a card while on the play area

SCRIPT_SET_NAME_PREPEND

const SCRIPT_SET_NAME_PREPEND: String = "SetScripts_"

The text which is prepended to files to signify the contain script definitions for a specific set

SHOW_TOKEN_BUTTONS

const SHOW_TOKEN_BUTTONS: bool = false

If true, each token will have a convenient +/- button when expanded to allow the player to add a remove more of the same

TARGETTING_ARROW_COLOUR

const TARGET_HOVER_COLOUR: Color = "0,0.52,1.3,1.3"

The colour to use when hovering over a card with an targetting arrow to signify a valid target

We are using the same colour as the TARGET_HOVER_COLOUR since they they match purpose

You can change the colour to something else if you want however

TARGET_HOVER_COLOUR

const TARGET_HOVER_COLOUR: Color = "0,0.52,1.3,1.3"

The colour to use when hovering over a card with an targetting arrow to signify a valid target

We are using the same colour as the TARGET_HOVER_COLOUR since they they match purpose

You can change the colour to something else if you want however

TOKENS_MAP

const TOKENS_MAP: Dictionary = {"bio":"green.svg","blood":"red.svg","gold coin":"yellow.svg","industry":"grey.svg","magic":"purple.svg","plasma":"blue.svg","tech":"blue.svg","void":"black.svg"}

This dictionary contains your defined tokens for cards

The key is the name of the token as it will appear in your scene and labels Please use lowercase only for the key

The value is the filename which contains your token image. The full path will be constructed using the PATH_TOKENS variable

This allows us to reuse a token image for more than 1 token type

TOKENS_ONLY_ON_BOARD

const TOKENS_ONLY_ON_BOARD: bool = true

If this is set to false, tokens on cards will not be removed when they exit the board

Clone this wiki locally