WIP [Storm] MultipleDynamicPortrait Alpha 0.1

Discussion in 'Mods' started by duffmk, Mar 18, 2016.

  1. duffmk

    duffmk Aquatic Astronaut

    Hi o/

    I'm kinda new to the forum I saw a bunch of really cool Portraits here at the forum and I wanted to use them all, so a make this mod with Storm API. I'm not sure if it's gonna be useful to someone and probably it's full of bugs, but I don't think it'll crash your game because of the amazing job the Storm team make with the API (btw, if you see some really bad practices at my code, like calling a method at an event that shouldn't be used, don't hesitate and post here I'll fix as soon as possible, same as bugs).

    ah.. Sorry about the title, sounds more excited than it is

    Features:

    Editing config.json file to:

    Load multiple PNGs portraits per character
    Set the folders(inside mod folder) to load for each PNG
    Set the default portrait
    Set parameters to each PNG such day of the month, day of the week or random daily (same % for all PNGs)

    There's three main archives "MultipleDynamicPortrait.dll" "config.json", "manifest.json"
    and two folders with example of portraits

    I added two folders with examples for Alex and Sam, the config.json is already setted to this two examples
    if you want you can delete these, and re-set the config.json file or you can delete the config.json, when you open your game again, it will create another one, with one structure, to edit. (Don't delete the "manifest.json" or the mod will not work)

    At the config.json you'll find some parameters to change like:


    Debug:
    will show some information at your game such: if and what portrait has been loaded at the game, when the portrait change to a specific character, you can activate it by set the value to "true"

    AllowStandardPortraitAtRandomDaily:
    if you set it "True" the standard portrait will be randomized with your other portraits setted to random, this option apply for other characters too.

    The basic structure

    Json file edit exemple


    [​IMG]


    1.List of Characters you can: edit, delete or add names to the list by simple copy and paste the structure after the first curly brace of

    ListOfCharacterPortraits" as

    ""ListOfCharacterPortraits": { Paste the structure here" (separate the structures with comma)

    Character Name should be exactly the same as the game archives with the capital letter and underline if that's the case like "Maru_Hospital"


    [​IMG]


    2. List of portraits you can: edit, delete or add portraits to the list by simple copy and paste the structure after the first square bracket of

    "ListOfPortraits" as ""ListOfPortraits": [ Paste the structure here" (separate the structures with comma)


    [​IMG]



    3. FileName as it said it's the name of the file with extension at the end ".Png"

    4. Path is the path to the folder where you put your pngs it should be inside of the tool(MultipleDynamicPortrait) folder and need "\\" at the end "MyFolder\\"

    5. SetAsDefaultPortrait if its true the chosen portrait will be set as default, but if there's another portrait set to the day of month, day of

    week, or setted to randomize, it'll change.
    if it's set to false and that's the only portrait, it'll be setted as default

    6. SetRandomDaily if it's true the portrait will be randomize every day with the others that are setted too. but, will be prioritized days of

    month and days of week

    7. WeekDays List of weekdays the portrait should be used, if there's more than one at the same day of the week, it'll randomize between them, but

    will be prioritized days of month. week days are numbers 0 - 6 as 0 = Monday

    ""WeekDays": [0, 3]," <- the portrait will be used at Monday and Thursday

    8. MonthDays List of days of month that the portrait will be used

    ""MonthDays": [1, 5 , 27]" <- the portrait will be used at the day 1, 5 and 27

    you don't need to set everything to change the portrait, you just need to set the path and the name file.

    Priority: day of month > day of week > random > default



    Instalation:
    You'll need Storm.
    Place the MultipleDynamicPortrait folder and contents in your %appdata%/StardewValley/Mods folder.

    Next:
    More parameters
    Portrait Animation?
    Make an friendly interface to add specific data to json?

    Huge thanks to:
    Storm Team for make this awesome API
    ThatNorthernMonkey for the source code of his mods, especially the chest one really helps me to understand the API
    glumi and zelzius for authorize me use their amazing Sam's and Alex's Portraits as an example to load

    check and like their awesome posts :D

    http://community.playstarbound.com/...y-use-1-05-before-posting-i-will-know.108484/
    http://community.playstarbound.com/threads/storm-chest-labels.109609/
    http://community.playstarbound.com/threads/good-looking-sam-portrait-sprite.109334/
    http://community.playstarbound.com/threads/portrait-bara-shounen-style-by-zelzius.110036/


    Download Link:
    Source Link:
    any suggestions, bugs, etc... post here.
     

    Share This Page