Standard Subraces are viewed with disgust
-
Area name:
Issue Location:
Quest Name:
Store Name:
NPC Name:
NPC Location:
Server Version: 7266
Screen Shot:
Time: https://www.timeanddate.com/Issue Description: Seems that even the regular subraces such as gold dwarf are also treated with distain!
-
Needs more detailed if checks for specific subrace strings rather than just if(sSubrace != "") {TellEmTheySuck()}
-
Possible solution:
string sFriendlySubraces = "Sun Elf, Hill Dwarf, blabla"; if (sSubrace != "" && FindSubString(sFriendlySubraces, sSubrace) < 0) { theySuck(); }
Or, to be case insensitive:
string sFriendlySubraces = "sun elf, hill dwarf, blabla"; if (sSubrace != "" && FindSubString(sFriendlySubraces, GetStringLowerCase(sSubrace)) < 0) { theySuck(); }
-
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 :) -
Being reviewed. Thanks for the input!
-
@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.
-
Its a misspelling in the script, the ok subraces are spelled with small letters whilst it should be capital letters to work.
-
Should be resolved 7322
-
This is still an issue
-
Ping me on discord when you are IG, so I can check your variables.
-
Need to put in GetStringLowerCase
-
Try again after v7327
-
Any testing/update on this?
-
@Echo said in Standard Subraces are viewed with disgust:
Any testing/update on this?
-
Tested with Gold Dwarf. Worked as intended.
-