Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Spyderbane
Member
 
Join Date: Apr 2017
Posts: 65

Old November 16th, 2023, 09:46 AM
How can I perform an action if a skill is a class skill?
I was looking at adding this directly in a custom skill

Code:
doneif (field[kClass].value <> 0)
but this throws an error


Any suggestions? I'm trying to add bonus points if it is a class skill.

Full code
Code:
doneif (field[kClass].value <> 0)
var nPoints as number
nPoints = (#totallevelcount[] * 5)
field[Bonus].value += nPoints
Attached Images
File Type: png Screenshot 2023-11-16 094210.png (151.7 KB, 11 views)
Spyderbane is offline   #1 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,135

Old November 16th, 2023, 10:17 AM
Class skills are determined by the class, not by the skill or even the hero. So, you'll need to look at all the classes to determine if it's a class skill.

Do you want it to be a class skill for a specific class or for any class? For any class, you might try something like this:

Code:
var classskill as number
foreach pick in hero from BaseClHelp where "BaseSkill.nen2"
  classskill += 1
nexteach
doneif (classskill = 0)
I assumed "nen2" is the thingid of your skill based on the error message. If not, put the thingid of the skill in question in its place.
Sendric is offline   #2 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 03:49 PM.


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