Starfinder Playlist
  1. #1

    Script add to Description Linklist?

    Hey guys. Small question. I'm working on an extension that generates a list of spells from your campaign. I want to take that list of generated shortcuts/links and have it automatically added to an "Item" in the description field of the item. Is there a function I can call upon to do this already? Getting the path of the "description" fields "linklist" and adding nodes or creating windows in it doesn't appear to be working out for me. There must be an "addLink()" function or something for formattedtext fields, no?

    thanks for any help, in advanced!

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    As formattedtext controls can have all sorts of markup and formatting, there is no API calls available to do what you want. All you can do is get the current value, modify that with the FG formattedtext markup as required, and then setValue with the modified data. This is only possible when using a formattedtextfield (not the base control which isn't tied to a database field) as getValue and setValue is only possible against the database node the control is tied to.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    Quote Originally Posted by Trenloe View Post
    As formattedtext controls can have all sorts of markup and formatting, there is no API calls available to do what you want. All you can do is get the current value, modify that with the FG formattedtext markup as required, and then setValue with the modified data. This is only possible when using a formattedtextfield (not the base control which isn't tied to a database field) as getValue and setValue is only possible against the database node the control is tied to.
    ok. so, could this be edited via script then? much like how one could put a <p> to create a new paragraph?

    Code:
    <text type="formattedtext">
    						<p>Pugilists in the Arena Royale fight club travel the world earning their keep as equal parts performer and gladiator. Whether performing in staged physical competitions, or fighting it out in unscripted brawls, pugilists in the Arena Royale care as much about the theatrics of a fight as they do its outcome. Pugilists in this fight club also care deeply about their reputation and work to build up local and regional legends about their performing personas.</p>
    						<p />
    						<linklist>
    							<link class="reference_classfeature" recordname="class.id-00002.features.id-00021">Bonus Proficiency</link>
    </linklist>
    Edit: so I’d create the description string like “This is a spellbook with x number of spells <p><linklist><link class=reference_classfeature" recordname="” .. sPath ..”">” .. sName ..”</link>
    </linklist>” and set the value.
    Last edited by pr6i6e6st; January 12th, 2021 at 19:33.

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by pr6i6e6st View Post
    I’d create the description string like “This is a spellbook with x number of spells <p><linklist><link class=reference_classfeature" recordname="” .. sPath ..”">” .. sName ..”</link>
    </linklist>” and set the value.
    Kinda of (your tags aren't fully correct - you have an unclosed <p> ) - so make sure that the tags are 100% valid, and the whole data is within <p> </p> tags.
    Last edited by Trenloe; January 12th, 2021 at 22:17.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5
    got it! beautiful! thank you again Trenloe!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Character Create Playlist

Log in

Log in