Im seem to be missing the point on whether Im setting or logging variables and if they have to be local or global.
1) I want to pass a variable (status name [DEX]) from the ability (Breath weapon) to a formula that performs the saving throw (based upon variable [DEX])
2) The variable is going to be part of the "target change.value Change" for hit Points on the attack
3) The formula (calculating dam w/ a Saving throw) would load (set/log?) the variable in initial state and then evaluate by checking the targets' DEX score and then further performing the saving throw.
The variable doesn't seem to pass into the formula at all, my test calc is always zero
Pointers?
To use it in a formula, use the Selected variable origin and the selected key action. E.g.:
- use Value node
- value type: Game Variable
- variable key: the name of your float variable (on the ability)
- variable origin: Selected
- selected key value type: Value
- selected key value: action
- data origin: Local (it's passed to the formula as local selected data)
Since there's only one ability passed on, the Multi Value Use doesn't influence it. In case you have multiple things stored in selected data (e.g. getting object variables from multiple combatants), you can use this to e.g. combine all values together (Add) or use the Highest value.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
So I have an ability; its breath weapon
The breath weapon allows a saving throw (based upon DEX)
In the attack, under the "target value changes" for HP I will call the Damage Formula
As I call the damage formula I want to set a variable that declares this damage allows a save versus Dexterity (of the attributes avail).
The damage formula is going to call a child formula that "asks" the variable for which attribute matters during the save (DEX). The selection of DEX from all 6 attributes is nowhere except in a new created variable called "DC ATT" that this particular ability (breath weapon) sets.
The generic child formula then checks the combatant's Dexterity, as a result of this variable and proceeds to pull the Dex bonus and then call the d20 roll and check the save.
--
I can't get the value I try to assign to variable "DC ATT"(saving throw attribute) to pass to the damage formula. If I use "DC ATT" as a string "DEX" or as a value of 3; I cant get it to load into the damage calc, or at least the "test calculation" doesn't confirm it.
If I force an initial value of 3 to the damage formula and then I resolve a DEX check because is the third of 6 abilities (i make a value fork), then I can get the rest of the formula to work correctly.
-- My goal is to have a generic "Damage with Save" formula and then be able to pass dynamically the target Attribute (STR,INT,DEX,CON,CHA,etc) into the formula from many different abilities.
I would like to set a similar approach for a generic damage calc step as follows:
Any ability would pass in two variables
1) the damage die (4d, d6,d20)...i.e. "8"
2) the number of dice (i.e. "4")
for a damage calc formula to resolve as 4d8
This way a long list of varied abilities could pass into a single dynamic damage calculator based upon standard RPG dice.
Until the game is running the global variable isnt initiated?
(it's tough to just trust this [via the selected origin and action value...])
The key question is: What are you trying to access and where?
I assume STR, INT, DEX, etc. are status values.
Now, where are the variables stored you want to use?
E.g. are they set up on the ability as Ability Variables, are you using Local variables in the formula (i.e. only available for the formula itself and other formulas called by the formula), are they Global variables?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
So its not the status value (value) that the formula needs initially. It is instead just the key for which of the six "core attributes" (status values) is selected by the attack.
Each attack/melee ability/action will pass it's particular SAVING throw (status value) individually in variable called "DC Target" (difficulty-check target[status value]).
So the breath weapon attack passes "DC Target" = DEX
and the Psionic attack passes "DC Target" = INT
and a poison attack passes "DC target" = CON
Then the "dynamic dmg calc" formula loads the "DC target" variable to resolve which "Status value" is the saving throw. [step 1].
Then the formula calls the combatant's Status value(DEX).value(17) [step 2]
Then any status value.value of 17 = equals a bonus of +3 (from another formula) [step 3]
Then the bonus (3) is applied to a sub-formula for a d20 roll = (11 +3 =15) [step 4]
Then the attack also passes another variable ,"DC success" (18) when it passes the "DC Target" [step5]
THe DC roll (15) is compared to the "DC Success" (18) = FAILURE [step6]
THe remaining portion of the DMG calc formula proceeds and the target takes full damage to HP because the saving throw was failed. [step 7]
---
SO I just struggle to test those initial variables "DC target" and "dc success" passing/loading into the damage calc formula. At least, I cant seem to "test calculation" successfully.
If I "force" hard-coded values of "DEX" for "DC target" and 18 for "DC success" then the formula Dmg Calc works as intended. But I cant get those values to load as global variables int ot formula. Again, I suppose this is because the attack isnt live in a running-game and therefore the variable isnt yet initialized?
I just wish I could confidently test the full cycle without having to run a real fight in-game with logging and flying texts (to confirm). Im struggling for a way to confirm via only the "test calculation" in dmg formula.
---
Thanks for all the help, by the way,
------------------
im setting "DmgDice" variable this way in the ability:
Change Variable 2
Variable Key
Value type = Game Variable
Value= DmgDice
Type= Float
Operator= SET
Value Type= Value
Value=3
---------------------
Then the Damage calc formula (sub-formula) tries to access this "DmgDice" variable thus:
Value node
enabled
Operator=Add
Value
Value Type= Game variable
Variable Key= DmgDice
Variable Origin= Selected
Selected Key
Value Type= Value
Value= action
Data Origin= Local
Multi Value Use= First
-------------------------
In combat, these attacks always result in zero damage (formula isnt accessing the variables)
For the variable key you usually want to use the Value value type, i.e. directly defining the variable key. Using Game Variable here means that the variable key is defined in the string variable of the defined key - which can be a helpful thing when doing more complex stuff, but doesn't work out in regular situations :)
So, in the variable definition on the ability, make sure to use Value value type for the variable key (and also for values, when you want to define a value directly instead of using one stored in another variable).
Regarding formula testing in the editor - I know this can be somewhat of an issue for certain setups. E.g. testing a formula that depends on ability variables from the ability that uses them, it'll not really work out because the editor test doesn't provide the ability.
I'll look into solving this issue somehow.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
(it is working)
Also, the next version will add new settings for formula testing to optionally select an ability or item (also equipment, etc.) as action selected data.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!