Modding Help NPC's Giving Gifts to player.

Discussion in 'Mods' started by kingdisen, Jun 12, 2018.

  1. kingdisen

    kingdisen Void-Bound Voyager

    So I'm working on a bunch of dialogue mods that will make one giant marriage overhaul in the end. If you want to help with a different part, you can cheack out one of my other posts: Dialogue: mulitble boxes with conditions or Festival dialogue changes: marriage

    As for this post, I'm overhauling the festivals. The one I'm working on right now is Winter 25, otherwise known as the The Feast of the Winter Star.
    Even though your spouse may not be your "secret friand" that year, it doesn't make sence that he or she doesn't give you a gift on this obviously Christmas inspired holiday. Now I know how to make an NPC give the player a gift. In the dialogue box you want them to give gift after, you end code with [item id] and to randomly choose between different items you end with ["item id" "item id"] with as many item id'sas you want. Note: "item id" stands for the id number of the item. When making the code you don't use the quotation marks.

    For example I'm curent code I'm using is:
    [name]_spouse: "Hi honey...$3#$b#Merry Winter Star Day!$1#$b#This has nothing to do with the the secret gift, but I go you something.$0#$b#Hope you like it.[60 64 72 74 499 347 337 749 536 537 686 687 694 695 692 693 691 773 349 621 645]" #!String Note: "[name]" is meant to be replaced by the name of the player's spouse.
    I've gotten this much to work. Here are some images:
    gift 1.jpg gift 2.jpg
    Now here's where i'm stuck. There's two more things I want to be able to do.

    1:you may notice that one of the items in my code is 337(the id for Iridium Bars) but getting oly one Iridium Bar isn't verry helpful. I want the player to recive five Iridium Bars but I don't know how to implement that.

    2: I was thinging about adding seeds as well, but I didn't want to list every seed. I wantedit to pick an item id between 425 and 499. I don't know if that's possible, but if it is, i'd like to know how to do it.
     
      Last edited: Jun 12, 2018
      HopeWasHere likes this.
    • genman

      genman Subatomic Cosmonaut

      On Nexus , there is a mod named "Happy Birthday".
      This mod makes Npc give gifts at the birthday yourself.
      You can edit "PossibleGiftList" to change both quantity and item types depending on your relationship.

      It is a open-source mod and you can get it from github , thus you can study how to do it.
      This mod is easy to read and understand , so I modified that Npc will give gifts both my birthday and someone's birthday.
       
        HopeWasHere likes this.
      • kingdisen

        kingdisen Void-Bound Voyager

        I know the mod you're talking about and I even have it. I have tried to looked boefore I made this post at it but I can't seem to tell how it decides how many of an item to give the player. The reason it took me so long to make this reply is that there was a newer version of the mod that I didn't know how to data mine. Thanks to you I was able to, but the PossibleGifts page seems to be the same. I also noticed that there are numbers in on the pages that don't seem to be in the item id page so I also did one more test before replying.
        However, trying it out myself only made the NPC hand me an Error Item(yes the game even said that and it had a discrption{???}) Then I tried copying and pasting a line of gift choices from the mod I coose 74 1 446 1 204 1 446 5 773 1. (P.S. THis line was the only one that included the ID for the "Rabbit's Foot" which is an Item that I know can be given in groups of 5.

        It gave me the sam result.
        If you know how to read the mod please tell me how. Also If you can fid out where the NPC dialogue is located in this version of the mod so I can Make a marriage overhaul version of it as well, I'd appreciate it.
         
        • genman

          genman Subatomic Cosmonaut

          @kingdisen

          In happy birthdayMod , possibleGifts.cs decide the gifts type and quantity.
          Code:
                          ["Universal_Love_Gift"] = "",
                          ["Universal_Like_Gift"] = "",
                          ["Universal_Neutral_Gift"] = "",
                          ["Robin"] = " BestGifts/-27 6 709 50 388 200 390 200 -24 50/GoodGift/-27 3 709 10 388 80 390 80/NeutralGift/388 40 390 40 330 20 771 60/",
                          ["Demetrius"] = " Best Gifts/103 1 104 1 107 1 114 1 121 1 122 1 126 1 127 1/Good Gifts/105 1 106 1 108 1 109 1 110 1 111 1 112 1 113 1 115 1 116 1 117 1 118 1 119 1 120 1 123 1/NeutralGift/-23 1 -12 1/",
                          ["Maru"] = " BestGift/288 3 334 12 335 6 336 3 337 1 338 15 787 1/Good Gift/287 3 382 20 334 6 335 3 336 1/NeutralGift/286 3 382 10/",
                          ["Sebastian"] = " Best/787 2/Good/787 1/Neutral/167 1 171 1 172 1/",
                          ["Linus"] = " Best/-81 5 774 50/Good/-81 2 685 50 296 30 410 30/Neutral/16 1 20 1 399 1 296 10 410 10/",
                          ["Pierre"] = " Best/474 25 479 25 490 25/Good/472 10 475 10 481 10 484 10 491 10 492 10/Neutral/495 5 496 5 497 5 498 5/",
                          ["Caroline"] = " Best/425 15 427 15 429 15 431 15 453 15 455 15/Good/425 8 427 8 429 8 431 8 453 8 455 8/Neutral/425 1 427 1 429 1 431 1 453 1 455 1/",
                          ["Abigail"] = " Best/288 3 24 10 192 10 256 10 264 10 270 10 272 10 278 10 280 10 190 5 254 5 276 5/Good/287 3 24 5 192 5 256 5 264 5 270 5 272 5 278 5 280 5/Neutral/286 3 152 10 153 10 157 10/",
                          ["Alex"] = " Best/296 80 410 80/Good/296 40 410 40/Neutral/296 20 410 20/",
                          ["George"] = " Best/390 400 -12 5/Good/390 200/Neutral/390 75/",
                          ["Evelyn"] = " Best/-80 10/Good/-80 5/Neutral/18 1 16 1 22 1 402 1/",
                          ["Lewis"] = " Best/645 1 621 2/Good/621 1/Neutral/599 1/",
                          ["Clint"] = " Best/384 50 386 15 334 20 335 10 336 5 337 1 338 20/Good/378 75 380 40 382 30 384 15 386 4 334 6 335 3 338 1/Neutral/378 40 380 20 382 20 384 10/",
                          ["Penny"] = " Best/245 30 246 30 247 30 423 30 419 30/Good/245 10 246 10 247 10 423 10 419 10/Neutral/245 5 246 5 247 5 423 5 419 5/",
                          ["Pam"] = " Best/395 5 303 5 346 5/Good/346 1/Neutral/303 1/",
                          ["Emily"] = " Best/428 4 444 5 440 4/Good/444 3 440 2/Neutral/444 1/",
                          ["Haley"] = " Best/613 1 634 1 635 1 636 1 637 1 638 1/Good//Neutral//",
                          ["Jas"] = " Best/613 1 634 1 635 1 636 1 637 1 638 1 126 1 127 1/Good/103 1/Neutral//",
                          ["Vincent"] = " Best/104 1 107 1 114 1 100 1 101 1 105 1 106 1 108 1 109 1 110 1 111 1 112 1 113 1 115 1 116 1 117 1 118 1 119 1 120 1 121 1 122 1 123 1/Good/100 1 101 1 105 1 106 1 108 1 109 1 110 1 111 1 112 1 113 1 115 1 116 1 117 1 118 1 119 1 120 1 121 1 122 1 123 1/Neutral/96 1 97 1 98 1 99 1/",
                          ["Jodi"] = " Best/369 50 366 50/Good/368 40 369 20 365 40 366 20/Neutral/368 15 365 15/",
                          ["Kent"] = " Best/288 2 188 5 24 5 192 5 256 5 264 5 270 5 272 5 278 5 280 5/Good/287 2 24 2 192 2 256 2 264 2 270 2 272 2 278 2 280 2/Neutral/286 2 24 1 192 1 256 1 264 1 270 1 272 1 278 1 280 1/",
                          ["Sam"] = " Best/167 20 787 1/Good/167 10/Neutral/167 1/",
                          ["Leah"] = " Best/78 20 416 15 408 20 281 10 20 20 399 20 404 15 412 20 422 10/Good/78 10 416 5 408 10 281 5 20 10 399 10 404 5 412 10/Neutral/20 1 399 1 404 1 412 1/",
                          ["Shane"] = " Best/346 2 176 10 180 10 174 10 182 10 306 5/Good/176 5 180 5 174 5 182 5/Neutral//",
                          ["Marnie"] = " Best/174 10 182 10 442 10 444 10 186 5 438 5 440 5 446 2/Good/176 10 180 10 442 5 184 5 436 5/Neutral/176 1 180 1 442 1 184 1/",
                          ["Elliott"] = " Best/-4 2 -23 10 -23 10 -23 10/Good/-23 1/Neutral/-4 1/",
                          ["Gus"] = " Best/-7 1 206 1/Good/346 1 196 1 224 1 395 1/Neutral/216 1/",
                          ["Dwarf"] = " Best/60 5 62 5 64 5 66 5 68 5 70 5 72 2 82 5 84 10 86 10/Good/60 2 62 2 64 2 66 2 68 2 70 2 82 2 84 2 86 2/Neutral/378 10 380 10 384 10/",
                          ["Wizard"] = " Best/203 1 203 1 203 1 74 1/Good//Neutral//",
                          ["Harvey"] = " Best/349 3 351 3/Good/395 4 349 1 351 1/Neutral/395 1/",
                          ["Sandy"] = " Best/88 8 90 8 124 1 125 1/Good/88 4 90 4/Neutral/88 1 90 1/",
                          ["Willy"] = " Best/128 3 143 3 149 3 151 3 155 3 698 3 699 3 704 3 707 3/Good/130 1 136 1 138 1 139 1 141 1 144 1 148 1 154 1 700 1 701 1 705 1 708 1/Neutral/129 1 131 1 132 1 137 1 142 1 145 1 147 1 706 1 702 1/",
                          ["Krobus"] = " Best/305 1 768 25 769 25/Good/768 10 769 10/Neutral/766 10 767 10/",
                          ["Alec"] = " Best Gifts/103 1 104 1 107 1 114 1 121 1 122 1 126 1 127 1/Good Gifts/105 1 106 1 108 1 109 1 110 1 111 1 112 1 113 1 115 1 116 1 117 1 118 1 119 1 120 1 123 1/NeutralGift/-12 1 96 1 97 1 98 1 99 1/",
                          ["Nagito"] = " Best/-4 2 -23 10 -23 10 -23 10/Good/-23 1/Neutral/-4 1/"
          
          first 3 lines denote the general giftlist, all npc may choice them.

          "best" means friendship above 7 hearts,"good" between 4 to 6 hearts,"neutral" below 4 hearts.

          after the friendship column , there are pairs of number .
          if the first one <0 , it means a mass type of thing.
          for example , -7 is all cooking items.(you can get from content/data/objectInformation.xnb)
          NPC will give you one of these pairs.
          So if you want someone only give rabbit foot , clear general line and certain NPC individual line and add it on best, good and neutral field.

          In happybirthday.cs , you may only concentrate on "IsBirthday" method , which check if npc will give you gift at this day.
           
            HopeWasHere likes this.
          • kingdisen

            kingdisen Void-Bound Voyager

            Thank you for the reply. You did a great job telling me how the code works(even though I knew about the file, you explained alotof things I didn't know, like the negitive numbers which aslohelps with my second request for this post) but I still can't identify the part that decides the quantity. I read your explanation multiple times now to make sure I didn't miss anything but I can't find it.
             
            • genman

              genman Subatomic Cosmonaut

              eg.
              best/ -7 5/good/ -7 3/neutral/-7 1 -7 2/
              8 heart give 5 cooking item
              5 heart for 3
              0 heart for 1 or 2

              item index from objectinformation.xnb
               

              Share This Page