VioneT

Doing Perchance.org things…

Links

  • 58 Posts
  • 760 Comments
Joined 2 years ago
cake
Cake day: June 21st, 2023

help-circle







  • The image you linked is still the ‘public’ gallery of the text-to-image-plugin, just that you are using a different gallery location. The new private gallery is fully private as it saves the info locally and doesn’t send it to the server.

    The new send to private gallery is beside the ‘persona’ button on the ai-text-to-image-generator and the button to open it is on the bottom middle of the screen. The buttons have the 🛡️ emoji.

    On the page that I linked second, which wraps the text-to-image-plugin with the buttons for the private gallery, shows the following on Firefox:

    Where the ‘Show’ will show the gallery and ‘Add to’ will add to the gallery. Clicking the ‘Show’ should open something like this:

    Then when you click ‘Add to’, an alert should popup:

    Then when you click the ‘Show’ again, it would reflect the new added image to the private gallery.

    On the two examples I made, I have also disabled the ‘public’ gallery with the hideGalleryButtons setting of the text-to-image-plugin which is why it doesn’t show:






  • You can use JavaScript array methods for that.

    Fruit
      apple
        text = a red fruit
      pear
        text = a green fruit
    
    output
      [Fruit.selectAll.map(fruit => fruit.text).join(", ")]
    
    • Fruit.selectAll will create an array of all the items in the Fruit list, you can also use .selectMany(...) or .selectUnique(...) to create an array of items.
    • .map(fruit => fruit.text) will essentially transform the array to have the text property of the fruit as the elements, instead of the fruit themselves.
    • .join(", ") would join the items into a single string with , as the delimiter

  • I forgot to enclose the value=${this[a]} with quotations, so that is one problem. You can remove the value of the option if you are using the value to access back the list like so:

    $output = [this.selectAll.map(a => a.getName).filter(a => gender.includes('♀️') ? !a.includes('♂️') : !a.includes('♀️')).map(a => `<option>${a}</option>`).join('')]
    

    So that clothingTop will return the list name e.g. Dress♀️, then using it with [clothingList[clothingGroup][clothingTop]] should return the item below it i.e. evening dress with deep neckline.

    Setting the value to this[a] would have the value of the option set directly to evening dress with deep neckline and not Dress♀️ so [clothingList[clothingGroup][clothingTop]] would not work, but you can access the value directly with clothingTop.



  • Something like this worked:

    clothingList.Top.selectAll.map(a => a.getName).filter(a => gender.includes('♀️') ? !a.includes('♂️') : !a.includes('♀️')).joinItems('<\option>')
    
    • .map(a => a.getName) - returns the name of the item, and not the item under it, and not a list since .selectAll returns an object and not a string.
    • filter(a => gender.includes('♀️') ? !a.includes('♂️') : !a.includes('♀️') - checks if the gender is female, if so, then filter out the items with ♂️ (!a.includes('♂️') essentially says if the name doesn’t have♂️, then return it), else filter out items with ♀️

    Also I’d recommend using $output on the list, so you just have to call clothingList.Top like so:

    clothingList // clothing top, bottom, footwear, headwear, accessories, color, pattern
      Top
        $output = [this.selectAll.map(a => a.getName).filter(a => gender.includes('♀️') ? !a.includes('♂️') : !a.includes('♀️')).map(a => `<option value=${this[a]}>${a}</option>`).join('')]
        ---
        Any
        None
        Bikini top♀️
          bikini top
        Blouse♀️
          blouse
    
    


  • What you could probably do to have the ‘any’ list to have equal odds with others would be to select all the items, get all the items that can be chosen, then get the number of that item e.g.:

    // given that weaponrange = melee
    weapon
      1
        Any
          Magic Weapon
          Challenge-Seeking Weapon^[weaponrange == "melee"] 
          Distance Weapon^[weaponrange == "ranged"]
        Axe
          [weapon[itemLevel].Any]^[weapon[itemLevel].Any.selectAll.filter(a => a.getOdds).length]
        Heavyb
          [weapon[itemLevel].Any]^[weapon[itemLevel].Any.selectAll.filter(a => a.getOdds).length] 
          // this would have an odds of 2 since Magic Weapon and Challenge-Seeking Weapon can be chosen, which would mean two out of three times this list should be chosen, so it is no longer 50/50 with the Bard's Songblade
          Bard's Songblade