City of Arabel
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Standard Subraces are viewed with disgust

    Scheduled Pinned Locked Moved Closed Bugs
    15 Posts 6 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • EchoE
      Echo
      last edited by

      Being reviewed. Thanks for the input!

      "You can complain if you weren't asked; you can't complain if you were asked but didn't contribute." ~ Professor.

      1 Reply Last reply Reply Quote
      • ZoolZ
        Zool @Wulfric
        last edited by

        @Wulfric said in Standard Subraces are viewed with disgust:

        I was bored so I gave it some more thought to open up more possibilities.
        This can be extended to multiple levels of disgust (or even friendliness, depends on the configuration) towards subraces.

        Disclaimer: I didn't test this in the toolset, I wrote it here on the forums, so may have a few syntax errors :)

        Base code here:

        // List of possible subraces and the attitude of commoners or merchants towards them
        //
        // Format: "[subrace name]:[attitude], [subrace name 2]:[attitude2], ..."
        //
        // (Example) Attitudes:
        // 0: neutral
        // 1: distrusted
        // 2: hated
        string sSubraceAttitudes = "sun elf:0, hill dwarf:0, aasimar:1, tiefling:2";
        
        // Get the attitude towards a player subrace
        // The attitudes are listed before the sSubraceAttitudes variable
        int DetermineAttitude(string sSubrace);
        
        int DetermineAttitude(string sSubrace) {
            if (sSubrace == "") {
                // default is neutral for no subrace
                return 0;
            }
        
            int iSrPosition = FindSubString(sSubraceAttitudes, GetStringLowerCase(sSubrace));
            if (iSrPosition < 0) {
                // The player has a subrace, but we don't know about it. Should not happen
                // returning neutral for now, should ask the player to bug report this
                return 0;
            }
        
            // Find the attitude associated with the given subrace
            int iSrOffset = iSrPosition + GetStringLength(sSubrace) + 1;
            int iAttitude = StringToInt(GetSubString(sSubraceAttitudes, iSrOffset, 1));
        
            return iAttitude;
        }
        

        And an example on how to use it:

        // on merchant open somewhere in the code
        switch (DetermineAttitude(sSubrace)) {
            case 0:
                // open store normally
                break;
        
            case 1:
                // I don't like you, but eh, here you go
                break;
        
            case 2:
                // Go away you freak!
                break;
        }
        

        You can assign different meanings to numbers, though this has a limit of 10 possible attitudes (0-9), but that should be more than enough.

        Cheers!

        EDIT: You can make sSubraceAttitudes a parameter for the function and then the attitudes can be fully customised for whatever purpose you want to use this script :)

        Cool, thanks.

        > !!!MOLES for the MOLE GOD!!!

        1 Reply Last reply Reply Quote
        • PuffyP
          Puffy
          last edited by

          Its a misspelling in the script, the ok subraces are spelled with small letters whilst it should be capital letters to work.

          @SpiffyMeister
          the real bench mark for success is if you seduce a puffy pc or npc
          @Prof-Misclick
          Puffy said "Don't you trust me? Then vote yes NERD!"
          #scaredofstrongwomen

          1 Reply Last reply Reply Quote
          • PuffyP
            Puffy
            last edited by

            Should be resolved 7322

            @SpiffyMeister
            the real bench mark for success is if you seduce a puffy pc or npc
            @Prof-Misclick
            Puffy said "Don't you trust me? Then vote yes NERD!"
            #scaredofstrongwomen

            1 Reply Last reply Reply Quote
            • EthikaE
              Ethika
              last edited by

              This is still an issue

              1 Reply Last reply Reply Quote
              • PuffyP
                Puffy
                last edited by Puffy

                Ping me on discord when you are IG, so I can check your variables.

                @SpiffyMeister
                the real bench mark for success is if you seduce a puffy pc or npc
                @Prof-Misclick
                Puffy said "Don't you trust me? Then vote yes NERD!"
                #scaredofstrongwomen

                1 Reply Last reply Reply Quote
                • PuffyP
                  Puffy
                  last edited by

                  Need to put in GetStringLowerCase

                  @SpiffyMeister
                  the real bench mark for success is if you seduce a puffy pc or npc
                  @Prof-Misclick
                  Puffy said "Don't you trust me? Then vote yes NERD!"
                  #scaredofstrongwomen

                  1 Reply Last reply Reply Quote
                  • EchoE
                    Echo
                    last edited by

                    Try again after v7327

                    "You can complain if you weren't asked; you can't complain if you were asked but didn't contribute." ~ Professor.

                    1 Reply Last reply Reply Quote
                    • EchoE
                      Echo
                      last edited by

                      Any testing/update on this?

                      "You can complain if you weren't asked; you can't complain if you were asked but didn't contribute." ~ Professor.

                      PuffyP 1 Reply Last reply Reply Quote
                      • PuffyP
                        Puffy @Echo
                        last edited by

                        @Echo said in Standard Subraces are viewed with disgust:

                        Any testing/update on this?

                        @SpiffyMeister
                        the real bench mark for success is if you seduce a puffy pc or npc
                        @Prof-Misclick
                        Puffy said "Don't you trust me? Then vote yes NERD!"
                        #scaredofstrongwomen

                        EchoE 1 Reply Last reply Reply Quote
                        • EchoE
                          Echo @Puffy
                          last edited by

                          Tested with Gold Dwarf. Worked as intended.
                          0b7c4edd-33bd-4a8d-9d4c-e89a5d127284-image.png

                          "You can complain if you weren't asked; you can't complain if you were asked but didn't contribute." ~ Professor.

                          1 Reply Last reply Reply Quote
                          • EchoE Echo moved this topic from Bug Reports on
                          • 1 / 1
                          • First post
                            Last post