Jump to content

Modding Question: How to stop Companion from reporting my crimes/attac


s14

Recommended Posts

Just like the topic says. :| I'm currently trying to make a custom standalone voiced companion.

 

My companion is AI'd when he's alone, so his responsibility is set pretty high (95 right now), just so he will not accidentally kill NPC's if he steals an object. Thing is, since his responsibility is so high, he also reports any crime I commit while he's following me. >.<

 

He doesn't attack me, as I've found a way around that by resetting his disposition towards me if it ever falls down to zero (I got the idea from examining the scripting in CM partners), but he still reports me and then actually helps me kill the guards! Grrr...

 

Also even with a setignorefriendlyhits 1, he still attacks me if I hit him accidentally.

 

I'd appreciate it if anyone with more experience can point me to the right direction/resources, heh. I don't need a step by step explanation, I'm pretty good at just dissecting things and reapplying them to my own purposes, but this got me stumped. After a day of emoragequitting, I guessed it was time to ask for help.

 

P.S. Anyone know how those nifty inventory sharing scripts are made as well? Haha

 

EDIT: Topic is cut of. Should say 'Modding Question: How to stop Companion from reporting my crimes/attacking me if I hit him accidentally"

Link to comment
Share on other sites

I recently made my own companion; who is by the way mute which is a problem I still have to fix, but if I accidently attack her she won't attack me back; so thát part works, so I'll give you the script I have for that:

 

begin OnStartCombat

 

;make sure not to attack friends after accidental hits.

 

set rEnemy to getCombatTarget

if GetShouldAttack rEnemy == 0 && Player.GetShouldAttack rEnemy == 0

StopCombat

StopCombatAlarmOnActor

playGroup Idle 1

return

endif

end

 

I got it from here by the way:

http://savageartistry.darkbb.com/tes-iv-oblivion-technical-info-f11/my-simple-creature-companion-tutorial-t129.htm

 

Its ment for animal companions, but it works fine on NPC's too, only the toggling follow with onactivate disables speech, which for me is ok since my npc can't talk anyway.

I don't know about the responsibility setting; but if you find a solution let me know :) Also, you might happen to know if its possible to get a golden saint NPC to accept custom topics in speech? Mine won't.

Link to comment
Share on other sites

Thank you! :)

 

By this time, I have already fixed it though, heh. Again I got the solutions from Blackie's CM Partners and TalkieToaster's Inventory Script. They will still attack me, but only if I deliberately hit him three times outside of combat. It's as simple as this function, where NPCREF is the reference ID of your companion:

 

NPCREF.setignorefriendlyhits 10

 

But thanks, this might be useful for commanding my companion to stop attacking.

 

Also for the solution to stop them from reporting crimes. It's also as easy as toggling their responsibility. My NPC normally has 100 responsibility to stop him from stealing when I leave him alone, but whenever I tell him to follow I just set his responsibility to 0. Then he stops caring if I lockpick or steal things. :D Hehe. I remember to set it back to 100 whenever I leave him alone though (in the stay command or the part ways command).

 

Here are the code snippets, where 'FollowAI' is the name of your Follow package. I also declared the variable follow earlier, useful for determining if the NPC is following or not in other scripts.

 

short follow

Begin OnPackageStart "FollowAI"
set follow to 1
NPCREF.SetActorValue Responsibility, 0 
End

 

Begin OnPackageChange "FollowAI"
set follow to 0
NPCREF.SetActorValue Responsibility, 100 
End

 

Explanation on the two Begin blocks: OnPackageStart executes once every time a certain AI package is loaded, OnPackageChange executes once every time the NPC's AI switches FROM the specified package. Since creatures do not steal, I don't think you need it though.

 

For Golden Saints, I do not actually know if Golden Saints use NPC/Player bodies. (I have never actually seen a Golden Saint ingame yet, haha, my character is still level 4). If they use custom ones, it might be impossible to get them to speak with lips moving.

 

But... I could think of several ways:

 

1) Create an invisible dummy NPC. I found this in the CS wiki by Dragoon Wraith:

 

For dialogue, though, you couldn't use a creature... hmm.

 

My guess would be that if you want to be able to talk to the pet, you create an invisible dummy NPC (using SetActorAlpha 0), which you position in the middle of the pet (using MoveTo and SetPos), and when the player Activates the pet (an OnActivate block in the pet's script), you have the player talk to the NPC. Because the NPC is invisible and in the middle of the pet, the player will look at the pet, so the pet will look like it's talking. Then you just have to modify the dialogue on the NPC to affect the pet.

 

Alternatively, you could try using a MessageBox menu. We have a tutorial for that.

 

These are just some ideas, I've never actually tried to make a companion or a pet. If you're looking for more information, you may want to try the Forums. If you find anything, it would be awesome if you reported back here! - Dragoon Wraith

 

From here: http://cs.elderscrolls.com/constwiki/index.php/Talk:Simple_Companion_Tutorial, you can also click on the Article tab to read about a dialogue tutorial.

 

2) As Dragoon Wraith said above, you could also use a messagebox menu and just play the appropriate sounds whenever a player chooses a button.

 

3) If you just want him to talk, here's one of my 'random speeches' codes. This enables my companion to say 'Ow!' whenever my player hits him :P Where NPCREF is the ref id of your NPC and 'TopicWatchIt', is the Conversation topic that I created earlier. Again, since the Golden Saint is a creature, I don't know how effective it is. It might be useful if you decide to create the invisible NPC like above, or if you decide to create a custom race of your Golden Saint (remember there are also certain problems associated with creating custom races).

 

Begin OnHit Player
NPCREF.Say TopicWatchIt 1 ;makes him react if player hits him
NPCREF.setignorefriendlyhits 10	
End

 

Hope this helps. My current problem now is that I can't seem to arrange dialogue topics. >.< They always end up jumbled ingame, no matter how I arrange them in the editor. For example TopicA should appear above TopicB and TopicC, but ingame, it becomes something else (e.g. TopicC, TopicA, TopicB, etc.) for seemingly no reason at all. Makes it very confusing when talking to my NPC.

 

Another bug is that my ESSENTIAL npc seems to die in some cases. :| Grrr. And yet another is that he refuses to switch to appropriate weapons whenever I use different combat styles (e.g. he continues to use a bow when I tell him to switch to magic, despite giving him spells and giving him a modified Battlemage combat style). And yet another is that he gets lost. My next goal is to get teleportation working so if he's following and he gets stuck, he just warps to the player when the distance gets to a certain point.

Link to comment
Share on other sites

Golden saints use the playable races sceleton and act like normal NPC's, in game the vanilla ones can also speak, although their dialogue is more limited and very quest oriented. In that aspect they're pretty much like demora in the CS only another race. I did get mine to speak by the way, on the same page where the invisible NPC advice was given someone mentioned fixing a mute NPC by using the greeting script response for addtopic topicname for all the topics; I did it to mine and she has her list of topics visible :)

 

Thanks for the script with the responsibility by the way :) That looks very useful. I asume my problem with getting this NPC to speak is the same that is a known problem with dremora companions, so a solution for those would work for mine too.

Link to comment
Share on other sites

http://cs.elderscrolls.com/constwiki/index.php/Dialogue_Tutorial

http://www.thenexusforums.com/index.php?/topic/233189-creating-lip-files-for-custom-voice-companion-mod/page__p__2065431__fromsearch__1&do=findComment&comment=2065431 < how to add custom sounds and lip movements

http://cs.elderscrolls.com/constwiki/index.php/Removing_default_dialog_tutorial < prevents everyone from saying your new custom dialogue

 

These might help you then. As for the topics, I had the same problem until I realized that I needed to add the topic for it to show up. It's not said in the preceding tutorials as well. CS also has a bug where you can't use the AddTopic box on the left of the dialogue window, so never use it if you don't want your mod to be in conflict with all other mods that add new dialogue.

 

Use the function AddTopic manually to add new topics to an NPC's dialogue. Until you use it, the only thing an NPC will have is the default GREETING topic. (I could be wrong, but from experience that seems to be the case, again note that I am also very new to this)

 

You need to make sure the conditions match though. So for example, you need to make a quest and make the conditions for the topic match the reference id for the golden saint companion. I assume you'd need to create a special Golden Saint NPC base (since using the default Golden Saint base would probably introduce problems to the rest of the Golden Saints ingame as some scripts can change the base not only the refs) e.g.

GetIsId NPC:GoldenSaintCompanion == 1

 

Then AddTopic whenever you feel like it's necessary. e.g. In the GREETING topic put in the result script:

 

Addtopic TopicName1
Addtopic TopicName2

 

This will add two new topics after the NPC greets the player.

 

Also make use of Quest Stages.

 

This is from a tutorial:

http://www.morrowind-oblivion.com/oblivion/oblivion_quest_tutorial.php

 

This is from a pm exchange with ZombieUK who had a similar problem (his companion is an argonian named Teinvaar, and he wants him to initiate conversation, greet the player and have two options of topics. I think you can infer what you need from it):

 

Here's what you need:On the Quest Stages tab of your Quest, right click on the empty list on the left and create 2 new stages. They must be named in numbers. So make 2 and name them 10 and 20 (they will auto-arrange themselves). Leave both of them blank for now.

 

Back on the Quest Data tab, click on the Scripts box (...) and type this code into it (Note, all capitalized words are variables that you need to name yourself).

 

Scriptname NAMEOFYOURQUESTSCRIPT
Begin GameMode
if player.getincell NAMEOFYOURFORESTEROUTPOSTCELL && NAMEOFYOURQUEST.GetStage < 10         
REFERENCEIDOFYOURARGONIAN.StartConversation Player, Greeting
endif       
end

 

On the right side there is a dropdown list on the script editor for the type of script this is. Choose Quest (this ensures that the script is only usable by the Quest).The first line is the name of your script. Remember this and always name it in an easy to remember way. e.g. if your quest name is named TeinvaarQuest, you should name this TeinvaarQuestScript. Then save it, close the script editor, close the quest window and reopen it. Once it's open again, go to your Quest Data tab again and on the Script dropdown, choose the name of the script you just made.

 

Now go to your Topics tab.Right click on List, Add topic, Right click on the list that appears and select New. This will be the GOODRESPONSE topic. So make the appropriate response on the info, add audio and add these conditions:

GetIsId NPC:BASEIDOFTEINVAAR == 1
GetStage Quest:NAMEOFYOURQUEST == 10

 

Check the Info Refusal option (this ensures that the topic will not be grayed out the next time you talk to him). Optionally, check the Goodbye option as well to end the conversation at this point automatically.

 

Right click again on List, Add topic, Right click on the list that appears and select New. This will be the BADRESPONSE topic. So make the appropriate response on the info, add audio and add these conditions:

GetIsId NPC:BASEIDOFTEINVAAR == 1
GetStage Quest:NAMEOFYOURQUEST == 10

 

Check the Info Refusal and Goodbye option as well. As it's expected that Teinvaar stop talking to the player after he insults him.

 

Right click again on List, Add topic, select GREETING from the list that pops up (don't make a new one, GREETING topics are topics that are said immediately when a player initiates conversation) Create a new info on the list to the right. This is the introduction text. Type what the argonian says on his first encounter with the player with the accompanying audio files. e.g.

 

"Hello, my name is Teinvaar, blah blah blah"

 

On the conditions list, choose these (again, capitalized words are variables that depend on what you actually named your topics/quest/etc.)

 

GetIsId NPC:BASEIDOFTEINVAAR == 1
GetStage Quest:NAMEOFYOURQUEST < 10
GetCellID NAMEOFYOURFORESTEROUTPOSTCELL == 1

 

On the Result Script box, add this bit of code in there:

SetStage NAMEOFYOURQUEST 10

This means that the quest has now progressed (from 0) to the next stage (10).

 

Thus all topics which have a condition that says it needs to be below stage 10 will not show (it means Teinvaar will not introduce himself again to the player).Now right click on the info list again and create a new response (INFO list, not a new topic. This is still part of the GREETING topic which will have two responses in it). Choose an appropriate greeting that implies that they have met before.

 

e.g.:

"Hi again."

or

"Hello there."

,

"So we meet again!"

etc.

 

Now on the conditions, put these:

 

GetIsId NPC:BASEIDOFTEINVAAR == 1
GetStage Quest:NAMEOFYOURQUEST > 10

 

Notice that unlike the first greeting which has a condition of GetStage < 10, this has a GetStage >10. Teinvaar will ONLY say this after he has already met the player.

 

Now go to your Quest Stages tab again. On stage 10, add a log entry if you want. e.g.

"I talked to Teinvaar. He's an argonian in blah blah"

 

This will appear in your quest journal. Now the important thing is this. On the Result Script box to the right, type this:

 

AddTopic GOODRESPONSE
AddTopic BADRESPONSE

(Depends on how you named those two responses of course). But this is important because without these, those topics will never show up on the conversation options. So you need those. Now once the quest is updated to stage 10 when Teinvaar first talks to you, he will now have two new additional dialogue. :DI think that was it, heh. Anyway good luck, hope this helps. You can modify this further (for example, you can lock the door temporarily so that Teinvaar will not go running after the player when he sees him). You can also add more dialogue on more quest stages. Note that you can name any stages numerically (AFAIK 1-100). The reason why they are currently named 10 and 20 is so that you can insert new stages if you forgot something later on.

Link to comment
Share on other sites

Golden saints use the playable races sceleton and act like normal NPC's, in game the vanilla ones can also speak, although their dialogue is more limited and very quest oriented. In that aspect they're pretty much like demora in the CS only another race. I did get mine to speak by the way, on the same page where the invisible NPC advice was given someone mentioned fixing a mute NPC by using the greeting script response for addtopic topicname for all the topics; I did it to mine and she has her list of topics visible :)

 

Thanks for the script with the responsibility by the way :) That looks very useful. I asume my problem with getting this NPC to speak is the same that is a known problem with dremora companions, so a solution for those would work for mine too.

 

Oh wait. You already fixed it. >.< LOL. Sorry, my bad. A bit sleepy today. Yep AddTopic fixes it.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...