• 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

Magic Items to change attribute values

MagicSN

Well-known member
Hi!

In my D&D 5e datafiles I still have a problem with the Gauntlets of Ogre power. Basically an eval like this would be needed:

var thestr as number
thestr = #trait[attrStr]
if (thestr<19) then
#traitmodify(...,19-thestr,"Gauntlets of Ogre Power")
endif

My problem: I did not yet find out what the correct phase and priority is. Either the modify does not work or the #trait contains 0.

Anyone has an idea of how to do this (basically the code is very similar to the D&D 4e code in many aspects, especially the MagicItem component).

I can do items which raise the Str by 2, but "setting to 19" seems to be a problem (my current implementation tells the user to do a permanent adjustment after acquiring the gauntlets).

Best regards,
MagicSN
 
If you're writing this game system, then you're in control of the phase & priority of EVERYTHING, and you can move them around as you need to. As part of that, if you're starting from an existing set of files, it's essential that you figure out when important things are happening.

First, look up #trait[] and #traitmodify[] in definition.def - figure out what fields they're altering.

Then, in the Trait component, probably in traits.str, figure out when those fields are being calculated and when you could make changes to them.
 
If you're writing this game system, then you're in control of the phase & priority of EVERYTHING, and you can move them around as you need to. As part of that, if you're starting from an existing set of files, it's essential that you figure out when important things are happening.

First, look up #trait[] and #traitmodify[] in definition.def - figure out what fields they're altering.

Then, in the Trait component, probably in traits.str, figure out when those fields are being calculated and when you could make changes to them.

Ah, my big problem is probably that I don't really understand how and by what this is controlled.

<scriptmacro
name="trait"
param1="trait"
result="hero.child[#trait].field[trtFinal].value"/>

<scriptmacro
name="traitmodify"
param1="trait"
param2="field"
param3="value"
param4="text"
result="perform hero.child[#trait].field[#field].modify[+,#value,#text]"/>

The code regarding the trait component is probably 1:1 the same as in the 4e Datafiles. If you can give me a hint that would be great!

Thanks.

Best regards,
MagicSN
 
In traits.str, scroll through there and find the traits component. It will start with the definitions of fields. Look through there - do any of them have <calculate> scripts that happen at a certain time?

Then look through the eval scripts. Identify what each one of them is doing, and if they're using the fields you're working with, identify when that's happening.
 
Back
Top