• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

state.combatpass and newpass action

Kairos

Well-known member
In the tactical console, what is a pass? As in "Press this button to start a new pass for all characters?" I noticed "state.combatpass" and the "newpass" action on a portal in form_taccon.dat but can't seem to find either documented on the wiki. Does anyone know what this is/does? It seems to be related to turns, but it's not clear to me.

Thanks

Code:
    <portal
      id="newpass"
      style="actBig"
      tiptext="Press this button to start a new pass for all characters.">
      <action
        action="newpass"
        buttontext="Next Pass">
        </action>
      </portal>

Code:
pass = state.combatpass
 
Last edited:
Tell me about the initiative system in your game - let's figure out what you need.

Passes were added for Shadowrun, which has initiative rounds and sub-rounds (called pases), so if your game doesn't use that, ignore it.
 
Tell me about the initiative system in your game - let's figure out what you need.

Passes were added for Shadowrun, which has initiative rounds and sub-rounds (called pases), so if your game doesn't use that, ignore it.

That sounds promising, actually. Qin uses a similar structure (maybe? I'm not familiar with SR).

Whenever at least one character has more than one action per round, the round is divided into several exchanges. The number of exchanges in a given round equals the highest weapon skill of any one combatant. (Weapon skill determines number of actions).

So, if I'm wielding a sword with a skill of 3, and my opponent has a weapon skill of 2, there will be 3 exchanges in that round total, but my opponent won't be able to act past exchange 2.

A combatant can perform 1 action per exchange, in decreasing initiative order, alternating among the combatants until their actions are expended for that round.

Thanks again, M
 
Last edited:
Yes, so you will need passes - they're for when there's a variable number of sub-rounds/round.

I can't seem to figure out how to make portal[newpass] visible on the taccon form. It appears to disable when out of combat, but I can't figure out how to make it appear in combat...since it doesn't seem to be set visible = 0 anywhere.

In other words, according to the position script, it should be sitting there to the right of the new turn button, but it doesn't show. Unless I'm missing something.

Any help is, as always, greatly appreciated.
 
In definition.def, you'll need to define a <newpass> script that works like the <newturn> script (and appears immediately after it (<newturn> appears immediately after <newcombat>), but instead of processing the changes that need to happen when the turn moves on, it processes the changes that happen when the pass moves on.

In definition.def, you can also rename the "pass" - I believe you want to call yours "exchange";
Code:
<structure
folder="shadowrun"
  summarymin="115"
  summarymax="250"
  combatpassterm="pass">
  </structure>
 
I've copied the relevant parts of the <newpass> script from Shadowrun. Hopefully you can understand what's going on here, and how you'll adapt it to your game. Please ask if you need me to interpret anything.

Code:
~find out the last initiative pass needed by any actor
~Note that when determining the number of initiative passes, use the
~lower of the value at the start of the turn, and the current value. This
~is because when you gain initiative passes during a turn, they don't
~apply until next turn, but when you lose them, the loss happens
~immediately.
~NOTE: Make sure to skip characters that aren't actually part of combat.
var lastpass as number
var passes as number
foreach actor in portfolio where "!combat.noncombat"
passes = minimum(eachpick.hero.child[attrPass].field[trtFinal].value, eachpick.herofield[acPassSave].value)
lastpass = maximum(lastpass,passes)
nexteach

~if that's less than the current initiative pass, we're finished with
~this turn
if (lastpass < state.combatpass) then
@complete = 1
endif

~if the hero is in noncombat mode, skipping their combat pass screws
~things up, so just skip them entirely. This is kinda a bug in Hero Lab,
~see case 3340 in fogbugz for full details.
doneif (hero.tagis[combat.noncombat] <> 0)

~work out how many combat passes are available to us this turn, using the
~same logic as above
passes = minimum(hero.child[attrPass].field[trtFinal].value, herofield[acPassSave].value)

~otherwise we have to go ahead with the pass - this actor gets skipped if
~it doesn't have enough initiative passes to act now, unless we have a
~delayed action saved up
if (state.combatpass > passes) then
if (herofield[acDelayed].value = 0) then
perform hero.combatskip
done
endif
endif

~ Actors with initiative 0 or less don't get to act
if (herofield[tactInit].value <= 0) then
perform hero.combatskip
done
endif
 
The <newturn script in Shadowrun is much shorter - the only relevant part of it is the same tactInit <= 0 section that closes the newpass script.

You may not even need that - in Shadowrun, your wound penalties are subtracted from your initiative total, and if that's not positive, you don't act in that round, so you may be able to leave out the <newturn> script if your game doesn't have any special handling like that.
 
Off to a good start. I added an actions trait to track # of actions per round which gets set when a weapon is equipped. The newpass script looks to this trait.

Thanks again.
 

Attachments

  • hl_qin13.JPG
    hl_qin13.JPG
    144.9 KB · Views: 3
Back
Top