Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 356

Old May 8th, 2022, 12:36 PM
Doing some code and, as far as I can tell, it all works. However, it keeps coming back wrong.

Code:
var stat as string
var bonus as number
var trunc as number
stat = hero.child[cHelpStk].tagids[User.a?]
Comes back as "User.aWIS" (it can be changed later, hence the code)

Code:
trunc = length(stat)-5
stat = right(stat,trunc)
Comes back as "aWIS"

Code:
stat = "#attrmod[" & stat & "]"
Comes back as "#attrmod[aWIS]"

Code:
bonus = stat
Comes back as 0. Actually putting the stat in comes back correctly, but not if I use the script.

I have a Patreon and PayPal. Donations are appreciated but are not mandatory. They are only to show support while I program stuff.

Last edited by Illyahr; May 8th, 2022 at 12:42 PM.
Illyahr is offline   #1 Reply With Quote
Phrll
Member
 
Join Date: Dec 2014
Location: Cincinnati, OH
Posts: 52

Old May 9th, 2022, 04:58 AM
length(stat)-5 might be picking up the . before aWIS, have you tried with -4?
Phrll is offline   #2 Reply With Quote
ploturo
Member
 
Join Date: May 2021
Posts: 79

Old May 9th, 2022, 10:30 PM
So the lines

Code:
stat = "#attrmod[" & stat & "]"
bonus = stat
are making a string, and then converting that string to a value (which is 0, since there isn't a number in the string).

You aren't actually using the #attrmod macro, it's just text in the string.



The field might be different for d20, but in Pathfinder I would change those lines to be something like this instead:
Code:
~ make a tag expression to match the right attribute
stat = "thingid." & stat

~ get the current bonus/modifier for that attribute
bonus = hero.firstchild[stat].field[aModBonus].value
ploturo is offline   #3 Reply With Quote
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 356

Old May 12th, 2022, 09:49 AM
Fantastic, that works.

The reason I needed this code to work is that it is going to be repeated a lot in Path of War and Path of War: Expanded. Maneuvers and abilities rely on "initiation modifier" instead of just stating what modifier to use.

I have a Patreon and PayPal. Donations are appreciated but are not mandatory. They are only to show support while I program stuff.
Illyahr is offline   #4 Reply With Quote
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 356

Old June 1st, 2022, 11:24 AM
Ok, these Things will be able to be shared among multiple classes. How would I go about making these Things check for the tag on the class they are in?

I have a Patreon and PayPal. Donations are appreciated but are not mandatory. They are only to show support while I program stuff.
Illyahr is offline   #5 Reply With Quote
ploturo
Member
 
Join Date: May 2021
Posts: 79

Old June 1st, 2022, 12:51 PM
I think all class-based special abilities (for d20 and pathfinder) are tagged with a SpecSource.? tag that gives you the id string for the class helper that provides the class special ability.

If it is tagged with SpecSource.cHelpExample, you can find the class helper by searching for thingid.cHelpExample in the Hero container.
ploturo is offline   #6 Reply With Quote
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 356

Old June 4th, 2022, 06:44 AM
Doesn't help in this regard. These Things have their own unique source so they can be assigned to a class with a script. What I need is to be able to run script that'll pull a tag from the class they have been assigned to

I have a Patreon and PayPal. Donations are appreciated but are not mandatory. They are only to show support while I program stuff.
Illyahr is offline   #7 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,060

Old June 4th, 2022, 04:16 PM
Quote:
Originally Posted by Illyahr View Post
Doesn't help in this regard. These Things have their own unique source so they can be assigned to a class with a script. What I need is to be able to run script that'll pull a tag from the class they have been assigned to
How are they getting assigned? Are you using a chooser? If so, you can pull information through the chooser (ie field[usrChosen1].chosen.tagnames[Classes.?]).

Last edited by Sendric; June 5th, 2022 at 08:23 AM.
Sendric is offline   #8 Reply With Quote
Illyahr
Senior Member
 
Join Date: Feb 2013
Posts: 356

Old June 6th, 2022, 08:55 PM
Quote:
Originally Posted by Sendric View Post
How are they getting assigned? Are you using a chooser? If so, you can pull information through the chooser (ie field[usrChosen1].chosen.tagnames[Classes.?]).
The ToB disciplines (and Path of War, by extension), each have their own Source. Each of the PoW classes have access to different disciplines and have different initiation modifiers (kinda like how a Wizard uses Int for spells and a Sorcerer uses Cha). Some disciplines are shared among different classes and can even be assigned to a class later.

I am trying to tell the individual maneuvers to check what modifier the class uses and use that to set the DC

I have a Patreon and PayPal. Donations are appreciated but are not mandatory. They are only to show support while I program stuff.
Illyahr is offline   #9 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,060

Old June 7th, 2022, 04:37 AM
Quote:
Originally Posted by Illyahr View Post
The ToB disciplines (and Path of War, by extension), each have their own Source. Each of the PoW classes have access to different disciplines and have different initiation modifiers (kinda like how a Wizard uses Int for spells and a Sorcerer uses Cha). Some disciplines are shared among different classes and can even be assigned to a class later.

I am trying to tell the individual maneuvers to check what modifier the class uses and use that to set the DC
Ok. Well, in ToB, when a maneuver is taken by a class, it gets assigned the tag "CustTaken.cHelp???" which indicates which class has taken it. I can't think of a way to discover which attribute to use, so you might just have to tell the script.

ie:

if (tagis[CustTaken.cHelpCru] <> 0) then
use STR
endif

That is, unless whatever you're doing above works.

Last edited by Sendric; June 7th, 2022 at 04:40 AM.
Sendric is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:36 AM.


Powered by vBulletin® - Copyright ©2000 - 2022, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.