Difference between revisions of "Logic"

From Castle Wiki
(added information that prob have bad grammar)
(various improvements)
Line 1: Line 1:
[[File:Logictab.jpg|frame|open logic tab]]Logic is a tab that are found in the inspector which houses rules and variables and they play an important role for the functionality of your decks
[[File:Logictab.jpg|open logic tab|thumb|377x377px]]The Logic tab is a tab that is an inspector tab which includes the rules and variables sections of the blueprint. Rules and actor variables play an important role in the functionality of Castle decks.


== rules ==
== Rules ==
rules add functionalities to your actors with rules like when this is tapped which detects when the actor gets tapped (use this instead of when this is pressed if you dont want something to be held, like seriously i kept seeing people making these mistakes) and other rules, there is alot of rules and im too lazy to list all of them so ye
Rules are pieces of logic that have a [[trigger]] and [[Response|responses]]. Using rules, you can control what your actors do under certain conditions, and in response to specific events.


-justin_
== Variables ==
Variables are used to store numbers which can be used later, there are two kinds of variables.


== variables ==
=== Actor variables ===
variables are used to store numbers in a memory called values which can be used for various stuff, there is 2 kind of variables, local variables and global variables
Local variables are variables that are accessible by only the actor that owns it and its values cant be edited by other actors


=== local variables ===
=== Global variables ===
local variables are variables that are accesible by only the actor that owns it and its values cant be edited by other actors
Global variables are variables that are accessed by all actors in all cards in the deck. They have 2 lifetime types, 'deck play' and 'persistent per player'.


=== global variables ===
==== Deck play ====
Global variables are variables that are accessed by all actors in all cards in the deck and they have 2 lifetime modes, deck play and persistent per player
 
==== deck play ====
Variables that has deck play lifetime has values that only last for a deck play before reseting to its initial value either by the player reseting the deck or the player leaving it
Variables that has deck play lifetime has values that only last for a deck play before reseting to its initial value either by the player reseting the deck or the player leaving it


==== persistent per player ====
==== Persistent per player ====
Variables with persistent per player lifetime can be used for different stuff like saving progress
Variables with persistent per player lifetime can be used for different stuff like saving progress


basically values will save for each player, for example if player 1 got to level 5 and there is a variable that remembers that, then player 1 will get back to level 5 as soon as they start the deck while player 2 who reached level 11 will have that same variable also remember where they left off, but instead of bringing them back to level 5 they will be in level 11 and it wont affect player 1 which is why its useful for saving progress
basically values will save for each player, for example if player 1 got to level 5 and there is a variable that remembers that, then player 1 will get back to level 5 as soon as they start the deck while player 2 who reached level 11 will have that same variable also remember where they left off, but instead of bringing them back to level 5 they will be in level 11 and it wont affect player 1 which is why its useful for saving progress

Revision as of 19:34, 10 May 2022

open logic tab

The Logic tab is a tab that is an inspector tab which includes the rules and variables sections of the blueprint. Rules and actor variables play an important role in the functionality of Castle decks.

Rules

Rules are pieces of logic that have a trigger and responses. Using rules, you can control what your actors do under certain conditions, and in response to specific events.

Variables

Variables are used to store numbers which can be used later, there are two kinds of variables.

Actor variables

Local variables are variables that are accessible by only the actor that owns it and its values cant be edited by other actors

Global variables

Global variables are variables that are accessed by all actors in all cards in the deck. They have 2 lifetime types, 'deck play' and 'persistent per player'.

Deck play

Variables that has deck play lifetime has values that only last for a deck play before reseting to its initial value either by the player reseting the deck or the player leaving it

Persistent per player

Variables with persistent per player lifetime can be used for different stuff like saving progress

basically values will save for each player, for example if player 1 got to level 5 and there is a variable that remembers that, then player 1 will get back to level 5 as soon as they start the deck while player 2 who reached level 11 will have that same variable also remember where they left off, but instead of bringing them back to level 5 they will be in level 11 and it wont affect player 1 which is why its useful for saving progress