Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
davystyles
Junior Member
 
Join Date: Aug 2017
Posts: 13

Old November 1st, 2019, 09:06 PM
need help figuring out problem with this code, i used the same code as the Draconinc Ancestor and am trying to adapt it to the Giant Soul Sorcerous origin here is the code is have,


doneif (tagis[Helper.ShowSpec] = 0)
doneif (tagis[Helper.Disable] <> 0)

~these vars will hold the tag expressions for spells and cantrips

var cantrip as string
var spell as string
var known as string
var first as string
var second as string
var third as string
var fourth as string
var fifth as string
var sixth as string
var seventh as string
var eighth as string
var ninth as string
var tenth as string
var eleventh as string
var twelfth as string

~ fetch spell expressions
spell = hero.childfound[cHelpSor].field[cSpKnoExpr].text
known = hero.childfound[cHelpSor].field[cSpellExpr].text


~ these receive the extra spells for each circle
first = " | thingid.spFogClou | thingid.spMinoIllu "
second = " | thingid.spBurnHand | thingid.spFireBolt"
third = " | thingid.sp5CArmAga | thingid.spRayFros"
fourth = " | thingid.spHeroism | thingid.spShillela"
fifth = " | thingid.spEntangle | thingid.spspResistan"
sixth = " | thingid.spspShocGras | thingid.spThunderw"
seventh = " | thingid.spFogClou | thingid.spMinoIllu | thingid.spInvisibi"
eighth = " | thingid.spBurnHand | thingid.spFireBolt | thingid.spFlamSphe"
ninth = " | thingid.sp5CArmAga | thingid.spRayFros | thingid.spHoldPers"
tenth = " | thingid.spHeroism | thingid.spShillela | thingid.spEnlargeR"
eleventh = " | thingid.spEntangle | thingid.spspResistan | thingid.spSpikGrow"
twelfth = " | thingid.spspShocGras | thingid.spThunderw | thingid.spGustWind"


doneif (tagis[Helper.ShowSpec] = 0)

doneif (tagis[Helper.Disable] <> 0)

if (field[usrIndex].value = 0) then
spell &= first
known &= first
elseif (field[usrIndex].value = 1) then
spell &= second
known &= second
elseif (field[usrIndex].value = 2) then
spell &= third
known &= third
elseif (field[usrIndex].value = 3) then
spell &= fourth
known &= fourth
elseif (field[usrIndex].value = 4) then
spell &= fifth
known &= fifth
elseif (field[usrIndex].value = 5) then
spell &= sixth
known &= sixth
elseif (field[usrIndex].value = 0) & (#levelcount[Sorcerer] >= 3) then
spell &= seventh
known &= seventh
elseif (field[usrIndex].value = 1) & (#levelcount[Sorcerer] >= 3)then
spell &= eighth
known &= eighth
elseif (field[usrIndex].value = 2) & (#levelcount[Sorcerer] >= 3)then
spell &= ninth
known &= ninth
elseif (field[usrIndex].value = 3) & (#levelcount[Sorcerer] >= 3)then
spell &= tenth
known &= tenth
elseif (field[usrIndex].value = 4) & (#levelcount[Sorcerer] >= 3)then
spell &= eleventh
known &= eleventh
elseif (field[usrIndex].value = 5) & (#levelcount[Sorcerer] >= 3)then
spell &= twelfth
known &= twelfth
endif

this is the error i keep getting

invalid use of reserved word elseif in script on line 64

any help is appreciated
davystyles is offline   #1 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old November 2nd, 2019, 06:41 AM
You actually have a second problem even if you fix the syntax error on line 64.

In your code you'll never hit line 64 (if you got it working) because if usrIndex is 0, coding always takes the first true statement it hits; that's your first if statement on line 46.

A suggestion would be to bootstrap all these spells and put a conditional on them that restricts them to your usrIndex and puts some tags on them that would make them free/memorized/sorcerer.

For example - the cloud giant spells (fog cloud, minor illusion, invisibility) correspond to usrIndex = 0 so on each of these spells you would click on the condition button and you can type in
fieldval:usrIndex = 0

for the fire giants
fieldval:usrIndex = 1

etc.

On the Tags button for each of these spells you would add the following tags:
(Group ID) (Field ID)
SpellType cHelpSor
Helper Memorized
Helper Free
BonusSplAt #

Where # is either 1 or 3 in your case, the 3rd level spell obviously would get the 3.
dungeonguru is offline   #2 Reply With Quote
davystyles
Junior Member
 
Join Date: Aug 2017
Posts: 13

Old November 2nd, 2019, 07:06 AM
Thank you so Much its been driving me crazy
davystyles is offline   #3 Reply With Quote
Reply


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 06:52 AM.


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