-
March 6th, 2021, 17:17 #41
- Join Date
- Mar 2020
- Posts
- 31
As for M or D, well there could be some help in that it's suffix. I am not aware of any spell ending with capital D or M.
From what I've seen in lua 5.1 documentation we could use string.find (s, pattern [, init [, plain]]) to check this. We could either check if
string.find(spellname, 'D') === string.len(spellname)
string.find(spellname, 'D', string.len(spellname)) != nil
APXX sounds good.Last edited by Corun; March 6th, 2021 at 17:20.
-
March 6th, 2021, 17:21 #42bmos' extensions
he/them
-
March 6th, 2021, 17:45 #43
- Join Date
- Mar 2020
- Posts
- 31
If only lua had full regex features, then it would be easy :C
Unfortunately capture groups cannot be treated with repetition operators(?, +, * etc.).
Maaaybe if we would strip out DC first together with space before it checking for [DM] character set.
Sostrsub (spellname, %s%(DC%s%d+%), '')Last edited by Corun; March 6th, 2021 at 17:48.
-
March 7th, 2021, 22:34 #44
I think you should take a look at the function that I'm using for this. It's already trimming out the DC stuff.
To summarize the process:
- trim off DC in parentheses
- remove any series of 4 consecutive uppercase letters
- remove any series of 3 consecutive uppercase letters
- remove "AP" followed by any number of consecutive digits
- remove any series of 2 consecutive uppercase letters
- remove any number of consecutive spaces followed by a colon
- remove a comma followed by any number of consecutive spaces
- remove square brackets containing a single letter
- remove any non-letter characters
- move "greater" to the end in case it's at the beginning
Are you sure about this? I think there is such a feature.
https://riptutorial.com/lua/example/...ttern-matching
You can see this in action in FG here.
EDIT: thanks for your help. I think I have it working in v1.9.Last edited by bmos; March 7th, 2021 at 23:21.
bmos' extensions
he/them
-
March 8th, 2021, 03:20 #45
v1.10-beta.2 adds some NPC actions to the spells tab automatically.
If anyone wants to try automating more abilities, you can do so here.
string_ability_type can be Feats or Special Abilities
level is what spell level the ability should be added as (usually 0)
actions / zeffect-1, zeffect-2, etc are the individual effects that will be added if this is a match
within zeffect-X are tables containing type=string/number/etc and value=the value of that db node.
the table named label in zeffect-X can also contain a number keyed as "tiermultiplier" which will be replaced in the label string when it is created. This tiermultiplier value will be multiplied by a number that is entered after the ability name (such as Ancestral Enmity 2 (resulting in +4) vs Ancestral Enmity 1 (resulting in +2).
Next up: breath weaponsLast edited by bmos; March 9th, 2021 at 22:45.
bmos' extensions
he/them
-
March 8th, 2021, 06:11 #46
- Join Date
- Mar 2016
- Location
- Bergen
- Posts
- 313
So exited about this. This will be a HUGE help. Breath weapons are common. And dragons are a pain since they dont have their abilities automated.
I looked into your code, and be aware that ATK also affects CMB, so in your power attack example you subtract CMB twice for each.
-
March 8th, 2021, 09:15 #47
- Join Date
- Mar 2020
- Posts
- 31
1) Ah, awesome somehow I've misunderstood purpose of grabbing this character "(".
2) It's close but not exactly what I want
I don't want to have only [DM], I though about grabbing everything by using one complex pattern. Grab things such as (2, DC 15), (2, DC 9), (3), (DC 27) by looking for repeating parentheses with optional combination digit followed by optional comma and optional combination of DC + spacebar + one to two digits. Bit complex to describe.
According to:
https://www.lua.org/manual/5.1/manual.html#5.4.1
Lua allows to use pattern items of length of 1 character, or exactly one of the first nine captures or %bxy balanced expressions. So there is no such feature.
3) Awesome I will test both versions soon.
-
March 8th, 2021, 12:19 #48bmos' extensions
he/them
-
March 8th, 2021, 19:06 #49
- Join Date
- Mar 2016
- Location
- Bergen
- Posts
- 313
-
March 9th, 2021, 23:03 #50
Basic breath weapon action creation included in v1.10-beta.3.
FG's 3.5E ruleset has been updated and now all included effects relying on QBAB should be functional.
Please report npcs that have breath weapons that are not picked up correctly so I can try to improve parsing.Last edited by bmos; March 9th, 2021 at 23:12.
bmos' extensions
he/them
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks