Senior Member
Join Date: Mar 2011
Location: USA
Posts: 383
|
Hey, I am trying to make a new material for weapons. I thought I had it figured out but now I am getting an error. The material adds +1 to hit and damage but that isn't a magical property or enhancement bonus. It should stack with everything. I took the code from another ablity and copied the phase and priority
Code:
Phase Post-level (users) Priority 1100 container.parent.field[wDamBonus].value += 1 container.parent.field[wAttBonus].value += 1 Code:
Phase Post-Attributes (Users) Priority 5000 Index 1 field[wMaxStr].value = hero.child[aSTR].field[aModBonus].value Phase Post-level (users) Priority 1100 Index 2 container.parent.field[wDamBonus].value += 1 container.parent.field[wAttBonus].value += 1 |
#1 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464
|
Maybe avoid the different (users) phases. LWD has advised against using them at this point, and indeed I have run into strange problems in the past because of them
|
#2 |
Senior Member
Join Date: Mar 2011
Location: USA
Posts: 383
|
I copied the phases from the code I duplicated. I got my red steel script from Gehennan Morghuth-Iron. I used the same phases and timing. My bow I modified is a duplicate of the elven bow same phases for the script. I only mentioned the phases to help with error checking.
|
#3 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Alchemical Silver uses the phase First/20000. I would try that and see if that changes anything.
If that doesn't work, we'll need to look at how you are creating the bow and applying the material. Alternatively, you can also just use adjustments to apply the bonuses. Last edited by Sendric; October 12th, 2020 at 06:04 AM. |
#4 |
Senior Member
Join Date: Mar 2011
Location: USA
Posts: 383
|
It doesn't work as I get the same error. The bow is a duplicate of the Bow of Elvenkind with the this bit taken out. Everything else is the same except the description text.
Code:
~ If we're not a elf, get out now if (hero.tagis[Race.Elf] = 0) then done endif |
#5 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
|
|
#6 |
Senior Member
Join Date: Mar 2011
Location: USA
Posts: 383
|
Yeah I was putting it directly into the item. That was the question I am asking is how to add it directly. I couldn't find an example to copy from.
Sigh, after looking closely at magical weapon it seems I can add a bonus to hit and to damage in the fields. I can modify my item that way. Last edited by Provos; October 12th, 2020 at 08:29 PM. |
#7 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
Code:
field[wDamBonus].value += 1 field[wAttBonus].value += 1 |
|
#8 |
Senior Member
Join Date: Mar 2011
Location: USA
Posts: 383
|
I couldn't get the script to work but on magic weapons you can add bonuses with a field.
Code:
field[wDamBonus].value += 1 field[wAttBonus].value += 1 Thanks for any suggestions. |
#9 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
|
|
#10 |
|
|