Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - d20 System (http://forums.wolflair.com/forumdisplay.php?f=46)
-   -   Ok, why is this not working? (http://forums.wolflair.com/showthread.php?t=67018)

Illyahr May 8th, 2022 11:36 AM

Ok, why is this not working?
 
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.

Phrll May 9th, 2022 03:58 AM

length(stat)-5 might be picking up the . before aWIS, have you tried with -4?

ploturo May 9th, 2022 09: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


Illyahr May 12th, 2022 08:49 AM

Fantastic, that works. :D

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.

Illyahr June 1st, 2022 10: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?

ploturo June 1st, 2022 11:51 AM

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.

Illyahr June 4th, 2022 05: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

Sendric June 4th, 2022 03:16 PM

Quote:

Originally Posted by Illyahr (Post 299208)
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.?]).

Illyahr June 6th, 2022 07:55 PM

Quote:

Originally Posted by Sendric (Post 299216)
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

Sendric June 7th, 2022 03:37 AM

Quote:

Originally Posted by Illyahr (Post 299232)
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.


All times are GMT -8. The time now is 06:12 AM.

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