Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD

Notices

Reply
 
Thread Tools Display Modes
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old November 4th, 2016, 08:44 PM
I didn't know what was what, so I just posted the basic macros.

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #11 Reply With Quote
Mjolnirh
Member
 
Join Date: Oct 2016
Posts: 39

Old November 4th, 2016, 08:47 PM
I just needed the syntax from a fresh pair of eyes
Mjolnirh is offline   #12 Reply With Quote
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old November 4th, 2016, 08:48 PM
You can thank ShadowChemosh, he showed me that macrio a while back.

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!
Mergon is offline   #13 Reply With Quote
Mjolnirh
Member
 
Join Date: Oct 2016
Posts: 39

Old November 4th, 2016, 09:16 PM
ok so how do I use this

~ abText begins with "The brown dog is jumping on the brown boat."
field[abText].text = replace(field[abText].text, "brown", "red", 1)

~ Result is "The red dog is jumping on the brown boat."

to replace 1d6 with 2d6 at level 11?

once I get these Field associations down, I'll be good lol

previous code:

if (#totallevelcount[] >= 8) then
#extradamage[hero.child[iThaas], " plus 1d6 radiant", field[thingname].text]
endif

Last edited by Mjolnirh; November 4th, 2016 at 09:18 PM. Reason: adding context
Mjolnirh is offline   #14 Reply With Quote
Mergon
Senior Member
 
Join Date: Sep 2012
Location: Ottawa, Canada
Posts: 788

Old November 4th, 2016, 09:47 PM
The following code should do what you want:

Quote:
var iLevel as number
var sText as string
if (iLevel >= 8) then
iLevel = #totallevelcount[]
if (iLevel >= 11) then
sText = "2d6"
else
sText = "1d6"
endif
endif

sText = " plus " & sText & " radiant"
#extradamage[hero.child[iThaas], sText, field[thingname].text]

Watch your back, Conserve your ammo,
and NEVER cut a deal with a dragon!

Last edited by Mergon; November 4th, 2016 at 09:53 PM.
Mergon is offline   #15 Reply With Quote
Mjolnirh
Member
 
Join Date: Oct 2016
Posts: 39

Old November 5th, 2016, 05:34 PM
ok that worked for those two so I thought I'd try a select case for multiple entries, lol didn't work

var iLevel as number
var sText as string
iLevel = #totallevelcount[]
Select Case ilevel

Case >= 8
sText = "1d6"
Case >= 11
sText = "2d6"
Case >= 16
sText = "3d6"
Case >= 20
sText = "4d6"
Case else
sText = "1d6"

end select
Mjolnirh is offline   #16 Reply With Quote
Mjolnirh
Member
 
Join Date: Oct 2016
Posts: 39

Old November 5th, 2016, 06:28 PM
ok I got it oddly enough here are the scripts that worked.

var bonbon as number

if (#totallevelcount[] >= 8) then
bonbon = 1
endif
if (#totallevelcount[] >= 12) then
bonbon = 2
endif
if (#totallevelcount[] >= 17) then
bonbon = 3
endif

hero.child[iThaas].field[Bonus].value = hero.child[iThaas].field[Bonus].value + bonbon

var iLevel as number
var sText as string
iLevel = #totallevelcount[]
if (iLevel >= 8) then
sText = "1d6"
endif
if (iLevel >= 11) then
sText = "2d6"
endif
if (iLevel >= 16) then
sText = "3d6"
endif
if (iLevel >= 20) then
sText = "4d6"
endif


sText = " plus " & sText & " radiant"
#extradamage[hero.child[iThaas], sText, field[thingname].text]
Mjolnirh is offline   #17 Reply With Quote
Hollis
Senior Member
Lone Wolf Staff
 
Join Date: Aug 2012
Posts: 779

Old November 7th, 2016, 09:31 AM
Quote:
Originally Posted by Mjolnirh View Post
ok I got it oddly enough here are the scripts that worked.

var bonbon as number

if (#totallevelcount[] >= 8) then
bonbon = 1
endif
if (#totallevelcount[] >= 12) then
bonbon = 2
endif
if (#totallevelcount[] >= 17) then
bonbon = 3
endif

hero.child[iThaas].field[Bonus].value = hero.child[iThaas].field[Bonus].value + bonbon

var iLevel as number
var sText as string
iLevel = #totallevelcount[]
if (iLevel >= 8) then
sText = "1d6"
endif
if (iLevel >= 11) then
sText = "2d6"
endif
if (iLevel >= 16) then
sText = "3d6"
endif
if (iLevel >= 20) then
sText = "4d6"
endif


sText = " plus " & sText & " radiant"
#extradamage[hero.child[iThaas], sText, field[thingname].text]
When you have a lot of if statements testing the same value, using elseifs can make the code clearer and easier tot read. Like so:

Code:
if (iLevel >= 20) then
  sText = "4d6"
elseif (iLevel >= 16) then
  sText = "3d6"
elseif (iLevel >= 11) then
  sText = "2d6"
elseif (iLevel >= 8) then
  sText = "1d6"
  endif

sText = " plus " & sText & " radiant"
#extradamage[hero.child[iThaas], sText, field[thingname].text]
Hollis is offline   #18 Reply With Quote
Mjolnirh
Member
 
Join Date: Oct 2016
Posts: 39

Old November 9th, 2016, 07:13 PM
Yeah I tried the elseif statement but it would not update with level up

One thing I do notice different about your code than the one I tried though is that you put the higher numbers first
Mjolnirh is offline   #19 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 12:31 AM.


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