¶ THIS POST IS OBSOLETE
Please note that this post is obsolete and soon will be replaced with an updated version.
Thank you for your understanding!
Article written for PTU Version 2.0+ / 1.5-Beta-16+
Actors, both Pokémon and Trainers in the PTU Foundry System can have AEs ('Active Effects') assigned to them, allowing players and GMs alike to modify Pokémon their data while keeping track where these changes are coming from.
The system also creates these effects automatically for you in certain scenarios. For example, any status ailment applied through the right click context menu on a token will apply the respective AE applying the proper rules for the effect in question.
TL:DR
Wow! This is a big article with a lot of technical information. I'm just a simple person with a simple desire to better keep track of my stat changes, can you give me a quick example on how to do this?
Well, you're in luck! Just follow the blue balloons like this one to explain how to get to the values we need, skipping most of the tech mumbo-jumbo. You can always read the fine print when you need it after all!
Effects can be found in the Effects tab (see images) on both Character & Pokémon sheets.
While in the effects tab, there are a couple things to note:
Within the effects tab there are the following controls:
The edit tab is where most of the magic happens. As this is where you can setup the effects and how they function.
Some effects have this button hidden(/disabled). These effects are system-generated and should not be tampered with.
Whenever you edit an Effect you will be opening the 'Configure Effects Window' within this window and its 3 tabs we can setup all the details for the effect.
During this example we'll be creating an effect for "Stat Ace: Atk", which grants your Pokémon an increase of +1 atk per every 10 levels of your Pokémon (+1). In our case we'll be working on our lvl 16 Mankey which will get a +2 atk boost.
Within the Details tab basic info for the effect is set. This is entirely a preset created by Foundry, hence why there are some options the system doesn't use like "Icon" or "Icon Tint Color".
For our example, all we have to do here is set the label to what we want it to be!
The used fields and their effects are:
The Duration tab is used to keep track of when an effect should expire. Currently we only support expiring at the start/end of turns in combat.
In general you will not be using this tab, and it's application is considered "advanced" in nature. So feel free to skip to the next section.
For our example, we actually won't be doing anything here.
The used fields are:
These fields are only applicable when an effect has been created within an Active Combat. If no Combat is created these settings have no functionality.
The rounds field is fairly simple, it's in how many rounds the effect should expire.
However, the turns field's use is slightly more complex.
If Turns is set to "0" an effect will expire at the start of the turn it was created in after the specified amount of rounds has passed.
If Turns is set to "1" the effect will instead expire at the end of the turn it was created in after the specified amount of rounds has passed.
An example:
An effect has been created during the 3rd turn of round 2, and has a duration of 2 rounds and 0 turns.
At the start of the 3rd turn on round 4, the effect will automatically be deleted.
While if the turns was set to 1, it would have been at the end of the 3rd turn of the 4th round.
Now this is where the magic happens.
In the Effects tab you are able to actually describe to the system what 'changes' you wish to create, adding more with the simple press of the [+] button.
There's quite a few options. So let's go over them one at a time:
The Attribute key is the data path of the value you're trying to change. That's quite a mouthful, isn't it?
Well in simple terms, it's the actual thing you want to change in some way shape or form. Check the section on how to find your attribute key for more info!
For our example, we want to change the modifier of the ATK Stat. Our data path is as followed:
data.stats.atk.mod.mod
Let's break that down real quick:
All paths always start with thedata
keyword, as that's what we're manipulating after all, Data!
After that we find the actual type of data we wish to changestats.atk.mod
the mod field of the atk stat!
Finally we appendmod
to the end, active effects should ALWAYS append themod
of a certain value and not thevalue
itself. As if you do you will not be able to edit the value directly in the sheet anymore, and can cause unintended side-effects.
The Change Mode is the way we wish to change our selected attribute. The options are as followed:
For our example, we want to use the Add mode as we wish to add
2
to the atk modifier.
As implied will add the value of the effect value to the current selected attribute's value.
A negative value is the equivalent of subtracting
As implied will multiply the current value of the selected attribute with the effect value.
The Override mode will completely overwrite the value of the attribute to whatever value you provide. It doesn't matter what the original value was, now it will become whatever the effect decides.##### Downgrade and Upgrade
Down/Upgrading will modify the current value of the selected attribute and either increase (upgrade) or decrease (downgrade) it to the provided effect value.
For example:
if your current atk modifier is 5, and you were to upgrade it to 8, it changes it to 8.
However if your current atk modifier was already 10, and you upgrade it to 8, it will not be changed as 10 is higher than 8, so the "upgrade" would be a "downgrade" and is therefore not executed.
Similarly, if your current atk is 5, and you downgrade it to 3, it will be changed to 3. But if it was already 0, nothing would change.
Custom application method allows you to write a macro to describe how the value should be updated. This feature is highly advanced and we do not recommend you using it. If you wish to know how this you'll have to research foundry development.
The effect value is quite simple, it is the literal number by which you wish to change the effect.
For our example, we will simply fill in
2
as that's the value we wish to increase the atk by.
The priority system in PTU has been tweaked slightly than how other systems might appreciate it, as explained in the little "Priority Tip" in the screenshot:
Priority in this system has special meaning.
Effects with priority 50+ are applied after system stat calculations, while all below 51 are applied before.
This means that if you are trying to modify a derrived value, you should give it a priority of 51+
The module itself follows priority rule for post-derrived value calcs as: 51 + (Mode * 10)
Now what does this actually mean?
Some values in PTU are stored by foundry, for example the amount of level up points you've put in the ATK stat is one of these values.
While other types of values are "calculated" by foundry, this would be the 'total' of your ATK stat, taking into account the base stat, any modifiers, your level up points and stages of the given stat. We call these Derrived Values
The thing about these derrived values is that we can only calculate these values once when a given character is loaded. So an effect can only either apply itself before or after the calculation of these values. This means one big thing:
Any derrived value that is based off of other derrived values can NEVER be changed successfully by active effect
So what does this mean for us? Well, a simple example is to do with base stats.
A Pokémon's base stats are defined by it's species and are not stored on your actor, making it a derrived value.
However your base stat is then in term used for calculating the total of that stat, alongside the modifier, level-up points, and possible stages.
Because of this if you try to change the base stat with an active effect, it won't actually effect the system, it might visibly look that way, but if you do the math yourself you'll see it won't add up.
Now, why am I telling you all of this? Well it is to explain why a lot of values have specific modifier
versions. Stats having one of the most obvious mod
fields. This is to circumvent this exact issue.
Whenever effects are applied to an actor they're done so in order from the lowest priority to the highest priority. Think of it as doing a math operation with brackets.
Let's say we have one effect that adds +5 to the atk mod, and another that multiplies the value by 3!
If by default our value is 0, and the priority of the 'add' effect is 20, while that of the 'multiply' effect is 10, the actual math operations would become: (0*3)+5)=5)
. Oops, we multiplied by 0! That doens't do anything ofcourse...
Now if we change the priority of the 'multiply' effect to 30, making it lower than that of the 'add' effect, the sum would become (0+5)*3=15
properly applying our effect.
Keep in mind that if the value you're trying to change, like for example 'Max HP' is a derrived value, you will have to use priorities above 51 to make your calculation, as otherwise they will be ignored by the system.
As a rule of thumb, when you're in doubt what priority to use, use priorities below 50. Does the effect not work? Try to add +50 to your priority, and it will probably work!
For our example: We will simply use priority
20
, this is the default for effects and because we don't particularly care when the operation is applied, we won't change this value
Aaaand finally having created the full effect, we can check the stats page of our Mankey to see that it's modifier field has increased by 2, and we can even see when we hover over it that the modifier is coming from the effect "Stat Ace: Atk"!
The "hardest" part of creating an effect is finding the right attribute key you need to use, there are a couple ways of finding our what you need.
Every modern browser has a 'developer tab', this allows you to see the code of the website you're looking at. Usually you can access this by either pressing ctrl+shift+i
or f12
on your keyboard.
This opens a side window much like this one on the right (but can look different, or even be in a different spot like on the left or at the bottom, depending on your browser, but Chrome, Edge and any browser like it should open it on the right)
Zooming in on the top of the developer console, we can find this button in the 'Elements' tab:
Once we click on this, our mouse will become like a super search tool allowing us to view all the hidden details of a website, in our case we want to know the value of what we want to change.
Let's say we're looking for the path to the spdef stage
. What we do is we click on the input field of the stage much like this:
Once we do so we so, the elements section on the right side will show us the "code" of the element that we have clicked on.
Here we can see more details of the element, but the thing we are looking for is the field called name
. As we can see here it shows us a data path! Just what we're looking for. In our case it is data.stats.spdef.stage.value
HOWEVER this is not our actual attribute key! As we don't want to directly manipulate the value, but rather we want to apply a modifier to this, the way we actually get our attribute key is to remove the final value
from the name we found, and change it to mod
.
The end result would look like this: data.stats.spdef.stage.mod
NEVER directly manipulate the
value
of a certain field, only modify themod
as manipulating thevalue
will stop you from editing the value directly on the sheet, and may cause unexpected side effects.
Let's take a look at one more field:
Here we can see that the effect range modifier has the following data path: data.modifiers.effectRange.value
, so similar to spdef we do not want to directly manipulate the value, and instead use data.modifiers.effectRange.mod
as our actual attribute key.
Now- while the above method is the easiest and a pretty fool-proof method, there is one other method that you may prefer.
This method also holds one key benefit, it shows hidden values and how our data is structured, helping you form a better understanding.
Instead of the Elements tab of the developer console we take a look at the Console tab:
It won't look as clean as this one, as I emptied for this example, but here we can find all the info we need!
The easiest way to get the info you need is to select a token on the map by left clicking on it, after that you can type the following in the console:
console.log(canvas.tokens.controlled[0].actor.data)
From here we can see all the information hidden within an actor, from the effects it has, to the items it owns, and much more. Right now however we're looking for info in the data
tab, so we can open that up by using the little arrows >
to view more details:
Wow! There's a lot of data to find here, and well, don't worry about some of these values being a little weird, my little mankey here an initative and evasion bonus of 999, you know, for testing purposes!
Either way using this method we can dig through all the fields to see the format of our data. When you're using Active Effects you'll most likely be digging through the following 3 fields the most:
These 3 categories contain the most used data for active effects, and once you have found the value you're looking for you can just transform that into one of those nifty data.etc
attribute values!