• 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

Estoc Editor Help

CorzatTheGray

Well-known member
Need a little help figuring out how to get the damage for an Estoc from Rogue Genius Games' Bullet Points into the editor.
Code:
Exotic 1-handed sword
Estoc   2d4 (sm)   [color=red]1d4+1d6 (med)[/color]   (no damage listed for large)
Would it be best to use the Fixed Melee Dam entry, which works for Medium damage, but how would I get it to adjust for size if so? I'm at a loss...
 
You would need to write a script to adjust the Fixed Melee Damage yourself. As you already typed in the Medium value the field will display on the weapon. Just click the "Fields" button in the TOP right corner to get the field name.
 
Still not sure how to go about modifying the wFixDamage field based on size...

Looking through the Pick Tags doesn't show anything about size of user or weapon while the Pick Fields has gSize for User Size (and a few others relating to size) that shows medium as 0 and then adjusts negative to go smaller or positively to go larger by steps accordingly.

I'm only seeing a large nested If/Then statement (that I have no idea how to maneuver through) through the sizes to show the damage that the Estoc will do. I'm sure there is a more elegant way to do this that I'm not aware of than the nested if/thens as I remember reading that nested if/thens can be processing intensive.

I know I'm on the right track just not sure how to find my way to the finish line.
 
Doing a little happy dance over here after spending all afternoon on this...

I've got it working, and after consulting others on the damage as it changes size (even got a message from the designer, Mr. Stevens, himself...) here is what I've come up with:
Code:
~Find size of item and give appropriate damage
if (field[gSize].value = -4) then
   field[wFixDamage].text = "1d3"
   elseif (field[gSize].value = -3) then
     field[wFixDamage].text = "2d3"
     elseif (field[gSize].value = -2) then
       field[wFixDamage].text = "1d3+1d4"
       elseif (field[gSize].value = -1) then
         field[wFixDamage].text = "2d4"
         elseif (field[gSize].value = 0) then
           field[wFixDamage].text = "1d4+1d6"
           elseif (field[gSize].value = 1) then
             field[wFixDamage].text = "2d6"
             elseif (field[gSize].value = 2) then
               field[wFixDamage].text = "2d6+1d8"
               elseif (field[gSize].value = 3) then
                 field[wFixDamage].text = "4d8"
                 elseif (field[gSize].value = 4) then
                   field[wFixDamage].text = "4d8+1d10"
                   endif
Owen Stevens was kind enough to answer my question on how the damage scaled by answering that he essentially was wanting to skew the damage to the "middle" as the 2d4 does, and since 2d5 wasn't in most dice collections he went with the 1d4+1d6. He goes on to explain that the damage should alternate between increasing the die as size increases past Medium.

Following his advice (and examples) to the letter left the estoc only dealing 1d8+1d10 as a colossal weapon... when compared to a longsword that is dealing 6d6 (36 max). Extrapolation time... current damage on the Estoc for a colossal weapon at 4d8+1d10 gives a max of 42 without attributes. I think that is fair along the lines of increasing damage when compared to a longsword.

So now the question remains... is there a more elegant way to make this make happen other than the nested if/thens?
 
I don't believe there is. I don't really see enough of a pattern to do otherwise. Also, I assume you're going to total up the various damage bonus fields and append that to the fixed damage text?
 
Also, I assume you're going to total up the various damage bonus fields and append that to the fixed damage text?
After I saw this I started messing around with this a little more...

There are a LOT of fields on the weapon that deal with damage in some way shape or form.

Easiest to start with was increase STR - Okay I see where that goes - wDamAttr
But not seeing the bonus listed to the damage as expected.

Next was Weapon Specialization - Okay I see where that goes - wDamBonus
Also not seeing the bonus listed to the damage as expected.

After that I went to create a magic weapon and it all hit the fan. Back to not having any damage listed.
Fields that I'm seeing affected by the Enhancement: BonEnhance, atmBonEnh (attack bonus), and dmmBonEnh (damage bonus) both of these for melee and then their counterparts for ranged.

What am I missing that would cause this to not be able to handle being made magical?

And I have no idea how to tackle the totaling all the various damage bonuses and appending them after frying my brain reading through it all. Will look into it more tomorrow after having time to process what I've read. Any help appreciated on this front as well.

Apparently did the happy dance a little early :rolleyes:

Oh well, just means an even bigger one when it all does finally coalesce! :D
 
When you create a magic weapon and choose the base weapon, it is contained inside the thing you add to the character. Once you've generated all the text you need for the wFixDamage field, you need to check whether you're on the character or inside a magic weapon and then apply the text to yourself or the container.

The lowest fields are the ones that hold the final values, so those are the ones you'll want to total, and again, where you look will depend on if you're in a container or not. You'll basically be recreating part of the tFinalDam procedure....

Eh, now that I look at it, tFinalDam is one of the most complex procedures we have. This is probably too much of an ask for someone just starting off. Here is my crack at paring it down to just the necessary parts. It's not tested, so I would say try it out and if it isn't working as you expect, then try tweaking it.

Final 9000
Code:
    ~ Set the focus to ourselves or the container, depending on where we are.
    var finaltext as string

    if (container.ishero<> 0) then
      perform parent.setfocus
    else
      perform this.setfocus
      endif

    ~ First get the dice...
    if (focus.field[gSize].value = -4) then
      finaltext = "1d3"
    elseif (focus.field[gSize].value = -3) then
      finaltext = "2d3"
    elseif (focus.field[gSize].value = -2) then
      finaltext = "1d3+1d4"
    elseif (focus.field[gSize].value = -1) then
      finaltext = "2d4"
    elseif (focus.field[gSize].value = 0) then
      finaltext = "1d4+1d6"
    elseif (focus.field[gSize].value = 1) then
      finaltext = "2d6"
    elseif (focus.field[gSize].value = 2) then
      finaltext = "2d6+1d8"
    elseif (focus.field[gSize].value = 3) then
      finaltext = "4d8"
    elseif (focus.field[gSize].value = 4) then
      finaltext = "4d8+1d10"
      endif

    ~ Now get the bonus
    var v_style as number
    v_style = focus.field[wCurrEquip].value

    ~ If we're adding attribute bonuses, get our strength bonus to add to
    ~ the weapon damage
    var bonus as number
    var halfbonus as number
    var extrabonus as number
    var twobonus as number

    ~start with the stored value for attribute bonus to damage for this weapon
    bonus = focus.field[wDamAttr].value

    ~ Calculate half our strength bonus for later use
    halfbonus = round(bonus / 2, 0, -1)

    ~ calculate 1.5x our strength bonus for later use
    extrabonus = round(bonus * 1.5, 0, -1)

    ~ calculate 2x our strength bonus for later use
    twobonus = bonus * 2

    ~ If we're wielding the weapon in both hands, but not as a double weapon,
    ~ add an extra 50% of the strength bonus, rounded down (unless this weapon
    ~ doesn't get extra strength from that.). Don't do this if our bonus is
    ~ negative, since it doesn't make sense for a -2 penalty to become a
    ~ -3 penalty.
    if (bonus >= 0) then
      if (v_style <> #wepdouble[]) then
        ~ If we have the special 'always 2h' tag, multiply our bonus
        if (focus.tagis[Helper.NatTwoHand] <> 0) then
          bonus = extrabonus

        elseif (v_style = #wepboth[]) then
          if (focus.tagis[Helper.NoDblStr] = 0) then
            bonus = extrabonus
            endif

        ~ If we're just wielding in our off-hand, we get half our strength bonus
        ~ (again unless the bonus is negative, in which case that wouldn't make
        ~ sense).
        ~ this also only applies if we DON'T have the Double Slice ability, and
        ~ also if this weapon does not have the NoHalfStr tag (used by Monks
        ~ for Unarmed Strike).
        elseif (v_style = #wepoff[]) then
          if (hero.tagis[Hero.DblSlice] + focus.tagis[Helper.NoHalfStr] = 0) then
            bonus = halfbonus
            endif
          endif
        endif

      ~ powerful attacks gain 2x STR damage
      if (focus.tagis[Helper.Powerful] <> 0) then
        bonus = twobonus
        endif
      endif

    ~ Calculate any other bonuses that apply. Start with the weapon bonus
    ~ and any damage bonus the weapon has.
    var otherbonus as number
    otherbonus = focus.field[wBonus].value + focus.field[wDamBonus].value

    otherbonus += focus.field[wDamMelee].value

    ~ Add the typed bonuses for melee attacks
    otherbonus += focus.field[dmmBonus].value + focus.field[dmmPenalty].value + focus.field[dmmRacial].value + focus.field[dmmBonAlch].value + focus.field[dmmModCirc].value + focus.field[dmmBonComp].value + focus.field[dmmPenComp].value + focus.field[dmmBonEnh].value + focus.field[dmmBonIns].value + focus.field[dmmBonLuck].value + focus.field[dmmPenLuck].value + focus.field[dmmBonMora].value + focus.field[dmmPenMora].value + focus.field[dmmBonProf].value + focus.field[dmmPenProf].value + focus.field[dmmBonSacr].value + focus.field[dmmPenSacr].value + focus.field[dmmBonTrt].value + focus.field[dmmPenTrt].value

    ~ Add any generalised damage bonus the hero has for whatever reason
    otherbonus += hero.child[Damage].field[tDamBonus].value

    ~ Depending on the category of the weapon, add a damage bonus to it
    if (focus.tagis[component.BaseWep] <> 0) then
      if (focus.field[wClass].value = 0) then
        otherbonus += hero.child[Damage].field[tDamLight].value
      elseif (focus.field[wClass].value = 1) then
        otherbonus += hero.child[Damage].field[tDamOne].value
      elseif (focus.field[wClass].value = 2) then
        otherbonus += hero.child[Damage].field[tDamTwo].value
        endif
      endif

    ~ If this is a weapon that can have Weapon Finesse applied to it, apply
    ~ the appropriate damage bonus
    if (focus.tagis[Helper.Finesse] <> 0) then
      otherbonus += hero.child[Damage].field[tDamFiness].value
      endif

    ~ Add our weapon bonus to the damage
    bonus += otherbonus
    halfbonus += otherbonus

    ~ Add whatever strength bonus we deserve to the text
    if (bonus <> 0) then
      finaltext &= signed(bonus)
      endif

    if (focus.tagis[wSpecial.Nonlethal] <> 0) then
      finaltext &= " nonlethal"
      endif

    ~ Now get the extra damage
    finaltext &= focus.field[wDamExtra].text

    ~ Everything should be combined into a single string now, so set that into the fixed damage field
    focus.field[wFixDamage].text = finaltext
 
Last edited:
When you create a magic weapon and choose the base weapon, it is contained inside the thing you add to the character. Once you've generated all the text you need for the wFixDamage field, you need to check whether you're on the character or inside a magic weapon and then apply the text to yourself or the container.

The lowest fields are the ones that hold the final values, so those are the ones you'll want to total, and again, where you look will depend on if you're in a container or not. You'll basically be recreating part of the tFinalDam procedure....

Eh, now that I look at it, tFinalDam is one of the most complex procedures we have. This is probably too much of an ask for someone just starting off. Here is my crack at paring it down to just the necessary parts. It's not tested, so I would say try it out and if it isn't working as you expect, then try tweaking it.
Aaron, first off - Thank you for looking into this for me!

Finally got around to looking into this more Saturday afternoon. I know you said that your code was untested and it did yield errors
Estoc Errors said:
Attempt to access non-existent parent pick for a top-level container from script
Location: 'eval' script for Thing 'wRGEstoc' (Eval Script '#2') near line 5
- - -
Attempt to access 'focus' pick from script when no focus exists
Location: 'eval' script for Thing 'wRGEstoc' (Eval Script '#2') near line 11
- - -
Attempt to access 'focus' pick from script when no focus exists
Location: 'eval' script for Thing 'wRGEstoc' (Eval Script '#2') near line 14
- - -
Attempt to access 'focus' pick from script when no focus exists
Location: 'eval' script for Thing 'wRGEstoc' (Eval Script '#2') near line 16
- - -
Attempt to access 'focus' pick from script when no focus exists
Location: 'eval' script for Thing 'wRGEstoc' (Eval Script '#2') near line 18
- - -
Attempt to access 'focus' pick from script when no focus exists
Location: 'eval' script for Thing 'wRGEstoc' (Eval Script '#2') near line 20
- - -
Attempt to access 'focus' pick from script when no focus exists
Location: 'eval' script for Thing 'wRGEstoc' (Eval Script '#2') near line 33
- - -
Attempt to access 'focus' pick from script when no focus exists
Location: 'eval' script for Thing 'wRGEstoc' (Eval Script '#2') near line 43
- - -
Attempt to access 'focus' pick from script when no focus exists
Location: 'eval' script for Thing 'wRGEstoc' (Eval Script '#2') near line 62
- - -
Attempt to access 'focus' pick from script when no focus exists
Location: 'eval' script for Thing 'wRGEstoc' (Eval Script '#2') near line 84
The error shows as soon as the estoc is purchased as mundane equipment. No error when purchased as magical. Neither mundane nor magical is showing damage, though, again.

The above errors occur while the script I copied from the lance dealing with being a one-handed weapon while mounted is included with the added line of code that also makes it a martial weapon while wielded 1-handed and mounted.

Pre-levels 4000
Code:
      ~ if we're mounted, we're a one-handed weapon
      if (#hascondition[pstMounted] <> 0) then
        perform tagreplace[wClass.TwoHanded,wClass.OneHanded]
        perform assign[Helper.PowTwoHand]
        perform tagreplace[wProfReq.Exotic,wProfReq.Martial]

        ~ if we're a magic weapon, instead modify our parent
        if (container.ishero = 0) then
          perform parent.tagreplace[wClass.TwoHanded,wClass.OneHanded]
          perform parent.assign[Helper.PowTwoHand]
          perform tagreplace[wProfReq.Exotic,wProfReq.Martial]
          endif
        endif

If I remove that script, the magical estoc still throws no errors (with no damage) but now the mundane estoc is throwing the following error:
Estoc Error - mounted code removed said:
Attempt to access non-existent parent pick for a top-level container from script
- - -
Attempt to access 'focus' pick from script when no focus exists
- - -
Attempt to access 'focus' pick from script when no focus exists
- - -
Attempt to access 'focus' pick from script when no focus exists
- - -
Attempt to access 'focus' pick from script when no focus exists
- - -
Attempt to access 'focus' pick from script when no focus exists
- - -
Attempt to access 'focus' pick from script when no focus exists
- - -
Attempt to access 'focus' pick from script when no focus exists
- - -
Attempt to access 'focus' pick from script when no focus exists
- - -
Attempt to access 'focus' pick from script when no focus exists
I've looked into the 'setfocus', 'focus', and 'finaltext' bits on the wiki and I'm still at a loss for how it all is supposed to be falling into place. With the inline description I can follow what is supposed be happening but figuring out where it isn't happening and isn't falling into place to be pushed to wFixDamage just isn't happening for me.

Gah!! I'm trying... I've been following all the codes posted on these boards for awhile now and I can normally follow (not so much come up with on my own though) what's happening, and I've been able to cobble things together before this from finding examples of what I'm looking for in existing things but this is throwing me for a loop and I'm not able to pick it apart...
 
WOW!
A roller coaster on this one...

Got it figured out though... Taking a day or 2 off to get out from underneath 15 inches of snow and come back to it with fresh eyes helped.

I was looking through all the code as listed above, and when comparing the container focus statement that Aaron gave to the one used by the lance that I cannibalized things weren't matching.

What Aaron gave as untested was saying the opposite of the desired outcome. "If container is the hero, then set the focus to the parent object" was sending the focus error as the focus was already the parent object if contained on the parent. We wanted the code to say "if the container is not the hero, then set the focus to the parent object"

Simple switch in the code from
Code:
 if (container.ishero[B]<>[/B] 0) then
      perform parent.setfocus
    else
      perform this.setfocus
      endif
to the correct code for the desired outcome
Code:
 if (container.ishero[B]=[/B] 0) then
      perform parent.setfocus
    else
      perform this.setfocus
      endif
and all the damage lists correctly!

Got the focus to workout the way we wanted it to!

Doing the happy dance for real this time!!!

Thanks again Aaron for looking into this one for me!
 
Hey, glad you got it figured out. Congrats! Sometimes it's a simple thing like that which you don't notice until you circle back to something after a break.
 
Back
Top