Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old August 28th, 2014, 06:53 AM
Sorry for all these questions, I'm only asking about things that I can't find on the wiki.

What does the splice function do and what are the parameters passed into it?

splice(x,y,z), what are x, y, and z?

Thanks.
sincla is offline   #1 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old August 28th, 2014, 09:27 AM
So normally Splice() is used in languages like JavaScript to splice apart a long string (ie URL) into tokens by a specific value. So for a URL you normally slice it apart by its "/" to get each piece as a token. Anyways it appears that HL splice does the exact opposite.

So splice() here puts strings together by a specific value.
Code:
      ~append any special details for this weapon
      special = splice(special,field[wpSpecial].text,", ")
So above would put the existing text in "special" together with the text in field[wpSpecial].text adding ", " in between.

So if Special had "shadow" and field[wpSpecial].text had "chemosh" then special at the end would have "shadow, chemosh" in it.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #2 Reply With Quote
sincla
Member
 
Join Date: Aug 2014
Posts: 52

Old August 28th, 2014, 10:33 AM
Thanks. Yeah that's kind of an odd use of the word splice. I guess what's being "spliced" is the middle character between two strings.
sincla 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 01:03 PM.


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