View Single Post
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old August 23rd, 2012, 10:48 PM
Alright, I have this all figured out. I had to do a little fancy trickery with the coding, but I think everyone will be pleased with the result. You can now have round counters in your Tactical Console! But, a few caveats to begin with which will make your job much easier.

First, there might be a few Adjustments you may want to source (where the effect is originating) in the Editor so that you won't have to source them during play. You can do this in your Adjustment tab by clicking on the Field button and inputing "pSource" as the Field ID and the origin of the effect in the Value. I would only do this if it is static and the originating source never changes (for example, a Bless is always the same source, so by sourcing it as a Bless, you don't need to do it on the fly while in the midst of a battle in the Tactical Console). This is just a suggestion, it is not needed. If you do not source an Adjustment, it will default to the name of the Adjustment. And you can always source it right in the Tactical Console as needed.

Second, the conditions work slightly differently than the temporary adjustments. Conditions have the round counter in the condition summary window (the big eye button) and appears next to the actual condition. You just have to remember to check on it each round in this window (and it's just a good idea with the counters to call up the window for each character that acts). Temporary adjustments appear in the Tactical Notes with the durations attached so you can keep an eye on them, but again, always a good idea to check those notes in the conditions window since they have a tendency to run off the screen (and thus, be hidden). When the round counter is at 0 AND it is the relevant character's turn, you need to go into the conditions window and remove both the duration and the checkmark. If you DON'T do this, the temporary adjustment will disappear from the Tactical Notes, BUT the effects will still be applied (the effect is still active because it is checked).

Third, in order to get the round counter to work, you will need to look at the current round number, then add to that the number of rounds the effect would last, putting that into the Duration box on the Conditions window. At that point, each round it will count down until it gets to 0. For example, if Bless lasts 5 rounds and the current round it was cast was Round 1, you would put the number 6 into the Duration box for the effect you would have for a Bless Adjustment (condition or temporary). If there is no duration (say for a condition, such as Dying), putting no duration in the Duration box will still display the effect without a duration (therefore letting you know it is active on the character in question).

Finally, DO NOT type anything into the Tactical Notes area of the Condition window. Anything you do type there will get deleted almost immediately (this was the only way I could get the round counters to appear the way they do, it's a trade off I know).

I think that about covers it. I may have missed something, but I can't think of it at the moment. Here is the nice thing about this, it doesn't require you to do a lot of coding, you only need the following bit of code to get this to work. In order for it to apply at all times for every character in the Tactical Console, you will need to have a Condition (not a Temporary Adjustment) that you can edit in the Editor. If you do not, don't worry, just go to the Adjustment tab in the Editor, select the Duplicate button at the bottom, and select the Blinded condition. Rename the Unique ID to pcnBlinded (d20 system), then on the middle right side, put pcnBlind in the box labeled Replaces Thing ID. Save this replaced condition and test it. If you already have a Condition you created in the Editor handy, use that one instead.

Now click the Eval Script button on the right side, then click the "Click to add another eval script". Set the new script's Phase to Final Phase (Users) and it's Priority to 50000. Once you have done that, copy and paste the following code into the new script, hit OK, then save and test. Your combats will now always have round counters for conditions and temporary effects!

Code:
~ If we're not in combat, get out now.
doneif (state.iscombat = 0)

~ Summarize our effects and turns remaining.
var first as number
first = 1
trustme
herofield[tactNotes].text = ""
foreach pick in hero where "Helper.AdjTemp | Helper.AdjCond"
  var durnum as number
  var durstr as string
  var turn as number
  turn = state.combatturn
  durstr = each.field[pDuration].text
  durnum = durstr
  durnum -= turn
  if (each.field[pIsOn].value <> 0) then
    if (durnum >= 0) then
      if (each.tagis[Helper.AdjCond] <> 0) then
        each.field[pChkName].text &= " {text 00ff00}" & durnum
      elseif (first = 1) then
        herofield[tactNotes].text = each.field[pSource].text & " " & durnum
        first = 0
      else
        herofield[tactNotes].text &= ", " & each.field[pSource].text & " " & durnum
      endif
    elseif (each.tagis[Helper.AdjTemp] <> 0) then
      if (compare(each.field[pSource].text, "") = 0) then
        each.field[pSource].text = each.field[pChkName].text
      endif
      if (first = 1) then
        herofield[tactNotes].text = each.field[pSource].text
        first = 0
      else
        herofield[tactNotes].text &= ", " & each.field[pSource].text
      endif
    endif
  endif
nexteach
See, there is always a way if you can think a bit "outside the box".

Last edited by Kendall-DM; August 24th, 2012 at 09:17 AM. Reason: Minor edits and corrections.
Kendall-DM is offline   #13 Reply With Quote