Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - 4th Edition

Notices

Reply
 
Thread Tools Display Modes
sleepyspoonie
Junior Member
 
Join Date: Feb 2017
Posts: 4

Old May 18th, 2017, 06:22 AM
Sorry, I have no idea how to word this. I need to write a script for a class I'm building, and I'm frankly rather lost. What I'm doing is a modification of the Disruptive Strike/Improved Disruptive Strike from the Hunter class. Improved Disruptive Strike gives the user an additional use of Disruptive Strike as an encounter power per encounter.

The script for Improved Disruptive Strike is as follows:

Quote:
doneif (activated = 0)
hero.childfound[pRgrDisSho].field[spcMax].value += 1
What I want to do instead is rather than just having the one power, I want the user to be able to select from three different powers. I can use the script to add them all at once, but I don't know how to make it so that the user's selection determines which part of the script is active.

Last edited by sleepyspoonie; May 23rd, 2017 at 06:29 AM.
sleepyspoonie is offline   #1 Reply With Quote
sleepyspoonie
Junior Member
 
Join Date: Feb 2017
Posts: 4

Old May 23rd, 2017, 06:28 AM
I expect it would go something like this, with the parts I don't know how to write out marked by **

Quote:
if (**the user selects Trick Shot**) then
hero.childfound[pwGSDisSht].field[spcMax].value += 1

elseif (**the user selects Violent Shot**) then
hero.childfound[pwGSViolSh].field[spcMax].value += 1

else (**the user selects Fan the Hammer**) then
hero.childfound[pwGSFtHam].field[spcMax].value +=1
endif
endif
sleepyspoonie is offline   #2 Reply With Quote
charlieluce
Senior Member
 
Join Date: Jul 2008
Posts: 687

Old May 24th, 2017, 03:30 PM
I had my lovely and patient coding expert take a look at this, and she said:
Quote:
Either add the following 3 lines of XML code or, in the editor click the Edit button for “List of Text Items” and enter Trick Shot, Violent Shot & Fan the Hammer in the boxes for rows 0, 1 & 2.
Code:
      <arrayval field="usrArray" index="0" value="Trick Shot"/>
      <arrayval field="usrArray" index="1" value="Violent Shot"/>
      <arrayval field="usrArray" index="2" value="Fan the Hammer"/>
Quote:
Set your eval script to run at or around Setup 1000, and use the following code:
Code:
  doneif (activated = 0)
  if (compare(field[usrSelect].text, "Trick Shot") = 0) then
    hero.childfound[pwGSDisSht].field[spcMax].value += 1
  elseif (compare(field[usrSelect].text, "Violent Shot") = 0) then
    hero.childfound[pwGSViolSh].field[spcMax].value += 1
  elseif (compare(field[usrSelect].text, "Tan the Hammer") = 0) then
    hero.childfound[pwGSFtHam].field[spcMax].value += 1
  endif
Let me know if this works for you or if you have any problems.

Currently Running: Pathfinder (Iron Gods AP)
Currently playing: Pathfinder
Former Games:
Savage Worlds, Mutants & Masterminds (2nd and 3rd editions), D&D4e.
charlieluce is offline   #3 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 04:48 AM.


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