wulfy1 Posted January 9, 2011 Share Posted January 9, 2011 Hi guys, I have been working on a mod for a long time and am rounding the bend on it being completed (beta release anyway), and I'm having a problem. First some back-ground. This is will a pretty large mod. 6 companions from a new custom race. over 200 pieces of clothing, 100 pieces of armor, 20ish weapons including 2 new bows, 2 player homes and a pretty big quest line. I have all the armor, clothing, weapons, homes and quests finished besides a few finishing touches. I was initially going to make the companions from scratch but soon figured out that I suck at scripting, I then opted for CM partners but after playing with them for a very long time, I decided that they were not special enough. I then got permission to use Sonia/Rhianna as resource and reference and began to convert one of the companions over. I converted all of the scripts, quests, dialogues, to this NPC so there would be no conflicts then I inserted/merged my quest-line so that it all flowed. The problem I am experiencing is that she attacks the hell out of me. I will go to the bandit camp at Vilverin and she makes a B-line to me and starts wacking away. She wont even look at the bandits. I checked her aggression (15), disposition to me (100), personality (40). It's odd but she has a high (75) disposition to the bandits but that should not make her choose to attack me over them. I started plugging in various BeginOnCombat blocks from other companion scripts that make the companion not attack the player, to no avail. Once thing of note here... she accepts yields from the player. Also, she does not attack and just keep attacking. If you do not stop her, she will stop herself after about three or four hits. The variations of the scripting I have used follow: (Approach 1 from Sonia Companion) Begin onActivate if IsActionRef Player == 1 if IsInCombat == 1 if GetCombatTarget == Player Yield else set "SAAAshaniQuest".AshaniSayGoHurtSomething to 1 endif Return endif if Player.IsSneaking == 1 set "SAAAshaniQuest".AshaniSayHuhIDontThinkSo to 1 Return endif ;Never interrupt a woman. (As Jumonji said :) if "SAAAshaniQuest".fTalkTimer > 1.5 || GetCurrentAIProcedure == 4 || GetCurrentAIProcedure == 5 || GetCurrentAIProcedure == 25 || GetCurrentAIProcedure == 29 Return endif endif activate End --------------------------------------------- (Approach 2 from Vilja Companion) ref AshaniCombatTarget Begin OnStartCombat set AshaniCombatTarget to GetCombatTarget ; she shouldn't fight the player, the deer, or highwaymen that have been paid if SAAAshaniCombatTarget == Player || SAAAshaniCombatTarget.GetInFaction Prey || ( HighwaymanGotMoney == 1 && SAAAshaniCombatTarget.GetInFaction BanditFaction && SAAAshaniCombatTarget.GetBaseAV Personality == 10 ) ModDisposition SAAAshaniCombatTarget 5 StopCombat SCAOnActor elseif GetDistance Player <= 2000 && Player.IsWeaponOut == 0 Say Attack ; alert the player that she's found an enemy endif End ---------------------------------------- (Approach 3 from the basic creature companion ref AshaniRefTarget Begin OnStartCombat set AshaniRefTarget to GetCombatTarget SetIgnoreFriendlyHits 30 if AshaniRefTarget == Player Yield Return EndIf set AshaniRefEnemy to getCombatTarget if GetShouldAttack AshaniRefEnemy == 0 && Player.GetShouldAttack AshaniRefEnemy == 0 StopCombat StopCombatAlarmOnActor playGroup Idle 1 return endif End If anyone has any clue why this would happen, or an idea on troubleshooting, please let me know. Thank,Wulf Link to comment Share on other sites More sharing options...
David Brasher Posted January 9, 2011 Share Posted January 9, 2011 Aggression of 15 is too high. Sometimes it works and sometimes it doesn't. You can't depend on 15 working for you in a particular case. It will betray you. Aggression of 5 is much safer. Some companion mods have dialogs to let you change this, so if a companion is not behaving quite right or the game glitches, you can easily and immersively raise or lower aggression. If you put potential companions into the Player faction before you even meet them, they are less likely to attack you unprovoked. Link to comment Share on other sites More sharing options...
wulfy1 Posted January 9, 2011 Author Share Posted January 9, 2011 Aggression of 15 is too high. Sometimes it works and sometimes it doesn't. You can't depend on 15 working for you in a particular case. It will betray you. Aggression of 5 is much safer. Some companion mods have dialogs to let you change this, so if a companion is not behaving quite right or the game glitches, you can easily and immersively raise or lower aggression. If you put potential companions into the Player faction before you even meet them, they are less likely to attack you unprovoked. Thanks for the response David. She was set to player faction when she was smacking me around. I think I just figured it out though. It was an activator I had placed in her cell that triggers an attack when you first meet her. I didn't have the script set right to end combat with the player properly when the timer expired. I corrected that and of course it straightened out. I thought I had that set correctly but I went brain dead today. </Face_Palm> Thanks again,Wulf Link to comment Share on other sites More sharing options...
Recommended Posts