Senior Member
Volunteer Data File Author
Join Date: Feb 2009
Posts: 173
|
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 by Kairos; April 13th, 2013 at 05:19 PM. |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#2 |
Senior Member
Volunteer Data File Author
Join Date: Feb 2009
Posts: 173
|
Quote:
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 by Kairos; April 14th, 2013 at 04:46 AM. |
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Yes, so you will need passes - they're for when there's a variable number of sub-rounds/round.
|
#4 |
Senior Member
Volunteer Data File Author
Join Date: Feb 2009
Posts: 173
|
Quote:
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. |
|
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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> |
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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 |
#7 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#8 |
Senior Member
Volunteer Data File Author
Join Date: Feb 2009
Posts: 173
|
Thanks, Mathias! This is just what I need to get me rolling.
|
#9 |
Senior Member
Volunteer Data File Author
Join Date: Feb 2009
Posts: 173
|
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. |
#10 |
|
|