peacy66 Posted October 14, 2017 Share Posted October 14, 2017 Hello guys i am trying to modify a script wich i thought would be easy but i am totally noob at scripting. Basically i have a script that adds amulets but it is only for female npc(neck seam cover). So i wanted to add it for males too for personal use, thought it would be simple (probably is) but im lost. So here is the original script: ScriptName KhNSCEDistributionQuestScript;Updated script by claustromaniac. Thanks, friend!ref ThisNPCref rNextref TempRefshort WhichNSCarray_var IsFemaleBegin GameModeif eval !GetCellChangedreturnendifLet rNext := GetFirstRef 69 1while ThisNPC := rNextLet rNext := GetNextRefif eval ThisNPC.GetIsCreaturecontinueelseif eval !ThisNPC.IsFemalecontinueelseif eval ThisNPC.GetInFaction Beggarscontinueelseif eval ThisNPC.GetEquippedObject 8continueelseif eval (TempRef := ThisNPC.GetEquippedObject 2)if eval GetHidesAmulet TempRefcontinueendifendifIf eval !GetPlayerInSEWorldLet WhichNSC := Rand 1 77If eval WhichNSC == 1Let TempRef := KhWNeckSeamCopperAElseIf eval WhichNSC == 2Let TempRef := KhWNeckSeamCopperBlackSoulAElseIf eval WhichNSC == 3Let TempRef := KhWNeckSeamCopperBloodAElseIf eval WhichNSC == 4Let TempRef := KhWNeckSeamCopperChippedWelkyndBlueAElseIf eval WhichNSC == 5Let TempRef := KhWNeckSeamCopperChippedWelkyndGreenAElseIf eval WhichNSC == 6Let TempRef := KhWNeckSeamCopperChippedWelkyndRedAElseIf eval WhichNSC == 7Let TempRef := KhWNeckSeamCopperChippedWelkyndWhiteAElseIf eval WhichNSC == 8Let TempRef := KhWNeckSeamCopperMagickaAElseIf eval WhichNSC == 9Let TempRef := KhWNeckSeamCopperOrbAElseIf eval WhichNSC == 10Let TempRef := KhWNeckSeamCopperPoisonAElseIf eval WhichNSC == 11Let TempRef := KhWNeckSeamCopperWelkyndAmberAElseIf eval WhichNSC == 12Let TempRef := KhWNeckSeamCopperWelkyndAquaAElseIf eval WhichNSC == 13Let TempRef := KhWNeckSeamCopperWelkyndBloodAElseIf eval WhichNSC == 14Let TempRef := KhWNeckSeamCopperWelkyndBlueAElseIf eval WhichNSC == 15Let TempRef := KhWNeckSeamCopperWelkyndGreenAElseIf eval WhichNSC == 16Let TempRef := KhWNeckSeamCopperWelkyndPaleAElseIf eval WhichNSC == 17Let TempRef := KhWNeckSeamCopperWelkyndRedAElseIf eval WhichNSC == 18Let TempRef := KhWNeckSeamCopperWelkyndVioletAElseIf eval WhichNSC == 19Let TempRef := KhWNeckSeamCopperWelkyndWhiteAElseIf eval WhichNSC == 20Let TempRef := KhWNeckSeamGoldAElseIf eval WhichNSC == 21Let TempRef := KhWNeckSeamGoldBlackSoulAElseIf eval WhichNSC == 22Let TempRef := KhWNeckSeamGoldBloodAElseIf eval WhichNSC == 23Let TempRef := KhWNeckSeamGoldChippedWelkyndBlueAElseIf eval WhichNSC == 24Let TempRef := KhWNeckSeamGoldChippedWelkyndGreenAElseIf eval WhichNSC == 25Let TempRef := KhWNeckSeamGoldChippedWelkyndRedAElseIf eval WhichNSC == 26Let TempRef := KhWNeckSeamGoldChippedWelkyndWhiteAElseIf eval WhichNSC == 27Let TempRef := KhWNeckSeamGoldMagickaAElseIf eval WhichNSC == 28Let TempRef := KhWNeckSeamGoldOrbAElseIf eval WhichNSC == 29Let TempRef := KhWNeckSeamGoldPoisonAElseIf eval WhichNSC == 30Let TempRef := KhWNeckSeamGoldWelkyndAmberAElseIf eval WhichNSC == 31Let TempRef := KhWNeckSeamGoldWelkyndAquaAElseIf eval WhichNSC == 32Let TempRef := KhWNeckSeamGoldWelkyndBloodAElseIf eval WhichNSC == 33Let TempRef := KhWNeckSeamGoldWelkyndBlueAElseIf eval WhichNSC == 34Let TempRef := KhWNeckSeamGoldWelkyndGreenAElseIf eval WhichNSC == 35Let TempRef := KhWNeckSeamGoldWelkyndPaleAElseIf eval WhichNSC == 36Let TempRef := KhWNeckSeamGoldWelkyndRedAElseIf eval WhichNSC == 37Let TempRef := KhWNeckSeamGoldWelkyndVioletAElseIf eval WhichNSC == 38Let TempRef := KhWNeckSeamGoldWelkyndWhiteAElseIf eval WhichNSC == 39Let TempRef := KhWNeckSeamPewterAElseIf eval WhichNSC == 40Let TempRef := KhWNeckSeamPewterBlackSoulAElseIf eval WhichNSC == 41Let TempRef := KhWNeckSeamPewterBloodAElseIf eval WhichNSC == 42Let TempRef := KhWNeckSeamPewterChippedWelkyndBlueAElseIf eval WhichNSC == 43Let TempRef := KhWNeckSeamPewterChippedWelkyndGreenAElseIf eval WhichNSC == 44Let TempRef := KhWNeckSeamPewterChippedWelkyndRedAElseIf eval WhichNSC == 45Let TempRef := KhWNeckSeamPewterChippedWelkyndWhiteAElseIf eval WhichNSC == 46Let TempRef := KhWNeckSeamPewterMagickaAElseIf eval WhichNSC == 47Let TempRef := KhWNeckSeamPewterOrbAElseIf eval WhichNSC == 48Let TempRef := KhWNeckSeamPewterPoisonAElseIf eval WhichNSC == 49Let TempRef := KhWNeckSeamPewterWelkyndAmberAElseIf eval WhichNSC == 50Let TempRef := KhWNeckSeamPewterWelkyndAquaAElseIf eval WhichNSC == 51Let TempRef := KhWNeckSeamPewterWelkyndBloodAElseIf eval WhichNSC == 52Let TempRef := KhWNeckSeamPewterWelkyndBlueAElseIf eval WhichNSC == 53Let TempRef := KhWNeckSeamPewterWelkyndGreenAElseIf eval WhichNSC == 54Let TempRef := KhWNeckSeamPewterWelkyndPaleAElseIf eval WhichNSC == 55Let TempRef := KhWNeckSeamPewterWelkyndRedAElseIf eval WhichNSC == 56Let TempRef := KhWNeckSeamPewterWelkyndVioletAElseIf eval WhichNSC == 57Let TempRef := KhWNeckSeamPewterWelkyndWhiteAElseIf eval WhichNSC == 58Let TempRef := KhWNeckSeamSilverAElseIf eval WhichNSC == 59Let TempRef := KhWNeckSeamSilverBlackSoulAElseIf eval WhichNSC == 60Let TempRef := KhWNeckSeamSilverBloodAElseIf eval WhichNSC == 61Let TempRef := KhWNeckSeamSilverChippedWelkyndBlueAElseIf eval WhichNSC == 62Let TempRef := KhWNeckSeamSilverChippedWelkyndGreenAElseIf eval WhichNSC == 63Let TempRef := KhWNeckSeamSilverChippedWelkyndRedAElseIf eval WhichNSC == 64Let TempRef := KhWNeckSeamSilverChippedWelkyndWhiteAElseIf eval WhichNSC == 65Let TempRef := KhWNeckSeamSilverMagickaAElseIf eval WhichNSC == 66Let TempRef := KhWNeckSeamSilverOrbAElseIf eval WhichNSC == 67Let TempRef := KhWNeckSeamSilverPoisonAElseIf eval WhichNSC == 68Let TempRef := KhWNeckSeamSilverWelkyndAmberAElseIf eval WhichNSC == 69Let TempRef := KhWNeckSeamSilverWelkyndAquaAElseIf eval WhichNSC == 70Let TempRef := KhWNeckSeamSilverWelkyndBloodAElseIf eval WhichNSC == 71Let TempRef := KhWNeckSeamSilverWelkyndBlueAElseIf eval WhichNSC == 72Let TempRef := KhWNeckSeamSilverWelkyndGreenAElseIf eval WhichNSC == 73Let TempRef := KhWNeckSeamSilverWelkyndPaleAElseIf eval WhichNSC == 74Let TempRef := KhWNeckSeamSilverWelkyndRedAElseIf eval WhichNSC == 75Let TempRef := KhWNeckSeamSilverWelkyndVioletAElseIf eval WhichNSC == 76Let TempRef := KhWNeckSeamSilverWelkyndWhiteAEndIfElseLet WhichNSC := Rand 77 98If eval WhichNSC == 77Let TempRef := KhWNeckSeamSECopperAmberAElseIf eval WhichNSC == 78Let TempRef := KhWNeckSeamSECopperAsterBloomAElseIf eval WhichNSC == 79Let TempRef := KhWNeckSeamSECopperFlyTrapAElseIf eval WhichNSC == 80Let TempRef := KhWNeckSeamSECopperSporeAElseIf eval WhichNSC == 81Let TempRef := KhWNeckSeamSECopperWitheringMoonAElseIf eval WhichNSC == 82Let TempRef := KhWNeckSeamSEGoldAmberAElseIf eval WhichNSC == 83Let TempRef := KhWNeckSeamSEGoldAsterBloomAElseIf eval WhichNSC == 84Let TempRef := KhWNeckSeamSEGoldFlyTrapAElseIf eval WhichNSC == 85Let TempRef := KhWNeckSeamSEGoldSporeAElseIf eval WhichNSC == 86Let TempRef := KhWNeckSeamSEGoldWitheringMoonAElseIf eval WhichNSC == 87Let TempRef := KhWNeckSeamSEPewterAmberAElseIf eval WhichNSC == 88Let TempRef := KhWNeckSeamSEPewterAsterBloomAElseIf eval WhichNSC == 89Let TempRef := KhWNeckSeamSEPewterFlyTrapAElseIf eval WhichNSC == 90Let TempRef := KhWNeckSeamSEPewterSporeAElseIf eval WhichNSC == 91Let TempRef := KhWNeckSeamSEPewterWitheringMoonAElseIf eval WhichNSC == 92Let TempRef := KhWNeckSeamSilverWelkyndPaleAElseIf eval WhichNSC == 93Let TempRef := KhWNeckSeamSESilverAmberAElseIf eval WhichNSC == 94Let TempRef := KhWNeckSeamSESilverAsterBloomAElseIf eval WhichNSC == 95Let TempRef := KhWNeckSeamSESilverFlyTrapAElseIf eval WhichNSC == 96Let TempRef := KhWNeckSeamSESilverSporeAElseIf eval WhichNSC == 97Let TempRef := KhWNeckSeamSESilverWitheringMoonAEndIfEndIfThisNPC.AddItem TempRef 1ThisNPC.EquipItemSilent TempRefloopEnd And here is my attempt at making a script for males using the same way to implement it: ScriptName KhNSCEDistributionQuestScript;Updated script by claustromaniac. Thanks, friend!ref ThisNPCref rNextref TempRefshort WhichNSCBegin GameModeif eval !GetCellChangedreturnendifLet rNext := GetFirstRef 69 1while ThisNPC := rNextLet rNext := GetNextRefif eval ThisNPC.GetIsCreaturecontinueelseif eval !ThisNPC.IsMalecontinueelseif eval ThisNPC.GetInFaction Beggarscontinueelseif eval ThisNPC.GetEquippedObject 8continueelseif eval (TempRef := ThisNPC.GetEquippedObject 2)if eval GetHidesAmulet TempRefcontinueendifendifIf eval !GetPlayerInSEWorldLet WhichNSC := Rand 1 3If eval WhichNSC == 1Let TempRef := LuNecklaceCopperElseIf eval WhichNSC == 2Let TempRef := LuNecklaceGoldElseIf eval WhichNSC == 3Let TempRef := LuNecklaceSilverEndIfElseLet WhichNSC := Rand 4 6If eval WhichNSC == 4Let TempRef := LuNecklaceCopperElseIf eval WhichNSC == 5Let TempRef := LuNecklaceGoldElseIf eval WhichNSC == 6Let TempRef := LuNecklaceSilverEndIfEndIfThisNPC.AddItem TempRef 1ThisNPC.EquipItemSilent TempRefloopEnd I thought it would be as easy as change the necklace id's and switch the IsFemale with Ismale, but IsMale doesn't work...Help would be much appreciated. Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted October 14, 2017 Share Posted October 14, 2017 Hmm, well, there is in fact no "IsMale" function counterpart to "IsFemale", but you also don't need any. "IsFemale" returns either 1 or 0, true or false, nothing else, and as such can be used to check for both. Don't laugh, but the correct way of changing the female-only script above to male-only would have been to remove the "!" = "not" from in front of the "IsFemale" check, where it says "if the gender is not female, abort at this point" like so: Turn ... elseif eval !ThisNPC.IsFemale continue ... (abort, if not female, i.e. male)into ... elseif eval ThisNPC.IsFemale continue ... (abort, if female, i.e. not male)Hope it helps. :thumbsup: Link to comment Share on other sites More sharing options...
peacy66 Posted October 14, 2017 Author Share Posted October 14, 2017 Ty Drake, I did try to do like you said (removing the !) but for some reasons none of my males npc get a necklace. I am obviously very lost in scripting world. I even tried to keep the original script unchanged and just remove the !, still no luck. I do not understand, seems so simple to do and it does not work. That is why i never script haha. Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted October 15, 2017 Share Posted October 15, 2017 Hmm, maybe one or more of the other restrictions is fulfilled, i.e. they wear something which hides amulets, etc. But could you give us the whole script the exact way it is now? It's always easier to check an actual script and see where something's wrong, than to blindly guess your way through to the culprit. Link to comment Share on other sites More sharing options...
Recommended Posts