You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,12 @@ New **mandatory** CardConfig property added: `EXPLANATIONS` (Dictionary). It sto
16
16
17
17
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.
18
18
19
+
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
20
+
21
+
* Card `card_name` property has been renamed to `canonical_name`
22
+
* Card `retrieve_card_scripts` function has been renamed to `retrieve_scripts`
23
+
* ScriptingEngine and ScriptObject `owner_card` variable has been renamed to `owner` and is not expected that it be a Card class
24
+
19
25
### Bugs
20
26
21
27
* Fixed crash when window x-axis resized to minimum
@@ -28,6 +34,7 @@ New CFConst poperty added: `VIEWPORT_FOCUS_ZOOM_TYPE`. Set to either "resize" or
28
34
* Deckbuilder will now display the total or filtered count of cards shown
29
35
* Added new class: GameStats, which can be used to submit stats to your own instance of [CGF-Stats](https://github.com/db0/CGF-Stats)
30
36
* Can now show extra info below card focus viewport, such as keyword explanations or illustrator info
Copy file name to clipboardExpand all lines: INSTALL.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ While everything in there can be modified, some files need to exist in one form
24
24
* You **need** CustomScripts.gd, even if it custom_script() function does not match anything.
25
25
* You **need** CFConst, but you should customize its constants to fit your needs. It is in custom so that you do not lose your changes during an upgrade.
26
26
* You **need** at least 1 Card Back, 1 Card Front and 1 CardManipulationButton scene, to link to your card templates.
27
+
* You **need** at least 1 Info Panel Scene. You can re-use CGFInfoPanel.tcsn
27
28
28
29
All other files, especially those starting with "CGF" can be deleted, or you can keep them around for reference.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,7 @@ Please see the [Install Guide](INSTALL.md)
124
124
125
125
One of the most powerful features of this framework, is the possibility to easily script each individual card's abilities from start to finish, so that a player only needs to double-click on a card and your code will handle the proper execution. This allows games to very easily create complete rules enforcement of all card abilities, from the simplest to the most tricky ones.
126
126
127
-
Please see the [ScriptDefinitions](https://github.com/db0/godot-card-gaming/wiki/ScriptDefinitions) documentation for more details
127
+
Please see the [ScriptingEngine](SCRIPTING_ENGINE] and [ScriptDefinitions](https://github.com/db0/godot-card-gaming/wiki/ScriptDefinitions) documentation for more details.
128
128
129
129
The game comes with some sample scripted cards which can be found under `res://src/custom/cards/sets`.
The ScriptingEngine (ScEng) of the Card Game Framework is a way to allow complex interactions and manipulations of the board to be encoded in objects in the game through a simple json dictionary.
4
+
5
+
Please check the [basic information in the wiki](https://github.com/db0/godot-card-gaming/wiki/ScriptDefinitions) first.
6
+
7
+
## Connecting new objects to the ScriptingEngine
8
+
9
+
The ScriptingEngine has been created in such a way so as to allow even non-card objects to make use of its capabilities.
10
+
11
+
To achieve that, you need to prepare you object in the following way:
12
+
13
+
1. Add the object to the "scriptables" group. Objects in this group are checked whenever looking for effects that modify automatic intereactions with the board
14
+
1. Add a "canonical_name" variable to your object's script and set it so that it has a human-readable value which refers to that object. This is used in dialogues to the player and for filtering effects
15
+
1. Add an `execute_scripts()` method to the object. This will be called automatically due to signals and should be called with manual intereactions. It should behave similar to the `execute_scripts()`
16
+
in the Card object, checking filters, checking confirmations and finally invoking the ScriptingEngine with a list of tasks. The best approach would be to copy `execute_scripts()` and modify it.
17
+
1. Add a `get_state_exec()` method to the object. This should return a string of one of the various states the object can be in, which are used to filter the correct scripts for execution.
18
+
1. Add a `retrieve_scripts()` method to the object. This should retrieve all of the object's scripts, from wherever they are stored.
0 commit comments