My Simple Creature Companion Tutorial

Download and read about WAC Beta v0.1
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

PLEASE DO NOT POST THIS TUTORIAL ANYWHERE ELSE WITHOUT ASKING ME FIRST.


PLEASE NOTE: If anyone wants to use this tutorial to create a companion for themselves using WAC resources other than for personal use, permission must be obtained from Waalx first.

This tutorial outlines the system I use to create my creature companions. It uses activation to Follow and Wander (stay) so you won't find a menu system here. I don't like menus for creature companions and I find it totally unnecessary.

The scripts are included, but there's also some latitude in what you can do with them. For example you can add or subtract spells, sounds or shaders etc inside the main and magic scripts if you wanted to, but I haven't included it here. My House Cats mod and a couple of others adds sounds like a bell that rings on activation or purring sounds as Idles and/or on activation.

You could also add extra functions to the creature script and it already includes Sneak. This function depends entirely on your own Sneak Skill.
I'm posting this over several topics as it's quite long and detailed. The main part has the script for the original mod it's based on, but the last post includes the updated script with the sneak function as well as having the summon spell added to it rather than an item.

Also located at:
SavageArtistry's forum
http://savageartistry.darkbb.com/

TES Alliance
http://www.tesalliance.org/

My Blog when I get around to posting it.
http://maigretsheadspace.blogspot.com

It has been translated to French by Sita Kaos, but I don't currently have a link.


CREATURE COMPANION TUTORIAL BASED ON MY SHER JA - MOUNTAIN LION COMPANION MOD.

***This tutorial assumes the user knows very little about using the Construction Set so I've tried to be as detailed as possible.***

Click the thumbnails for a better view so you can see what I'm referring to. If you think you've made a mistake in any open form, click Cancel instead of OK, but generally you can go back and make the necessary changes without problems. There is an exception to this. If you move an object unintentionally when placing the creature in the world you can go to Edit/Undo in the File Menu as long as you realize immediately you've done it. Otherwise you'll need to "clean" the mod afterwards. It's no fun if you find you've moved a door or house by accident and don't find out until later.

CREDITS:

Sher Ja - Mountain Lion Companion was my first mod besides some save games and has been updated and experimented with several times until found I was finally happy with it.

The scripts used here for the companion are adapted from the Fenrir the Wolf Companion mod by delphinus with his permission. They were created with OBSE by Jumonji, but have been changed so they no longer require OBSE which mainly dealt with fast healing after battle. This is now dealt with by adding a Healing Ability and making him Essential. Jumonji helped me to do this.
The Add Summon Spell script is by WillieSea. I found it on the Official CS forums where I also find a lot of other helpful information.
Thank You.

Fenrir the Wolf by delphinus and Jumonji
http://www.tesnexus.com/downloads/file.php?id=14192

Sher Ja - Mountain Lion Companion by Maigrets
http://savageartistry.darkbb.com/index.htm

Image

The screen shot of Sher Ja is using themythofstrider's excellent Mythic Animals textures, but I'm now using the WAC Cougar (with whiskers.. :) ) for Sher Ja.

STARTING OUT:

This will create a simple creature companion that can be activated to stay and follow. It will fight anything that is your enemy or that attacks you in Follow mode. It will NOT be aggressive to friends or yourself, and is player owned. Otherwise, if you resist arrest for a crime, it will attack the guards who are chasing you, or if you go on a murder spree then you can rely on it to defend you. I make my companions Essential so they don't die, but become unconscious for a short time. That's up to you. I prefer not to have to reload or deactivate and reactivate the mod if it dies, especially when using overhaul mods like I do, where a non essential companion death is almost guaranteed.

In Wander mode it will patrol the area where you left it and will defend itself if necessary. When you first go to find your companion it will also start to wander as soon as you enter the cell it's placed in, so if it's not where you put it just search around a bit or use the summon spell as described below.

There will be a Summon Spell to call your companion if you've left them somewhere, if they get stuck (rare), or to remove them from battle. If they do happen to get lost, for example, falling from a great height, they will teleport to you or return on entering a new cell. Or, of course, you can summon them back.
This spell can be added to an object and you can create a quest to find it if you like, or you can place the object near the creature. Make sure to mention it in your readme if you plan to release the mod.

I am including the option of adding the spell to an object to this tutorial. When the object is taken the spell is automatically added to your spellbook. The item doesn't need to be in your inventory afterwards, so you can throw it away or keep it depending on the item used.

The spell can also be added via a quest script which will add it as soon as you load your save, but will not be included in this tutorial. I prefer not to add the Summon Spell by a quest because I like to put my creatures somewhere to find, rather than an easier location like the Waterfront District.

Quest related options will be included in another tutorial which will outline a simple quest to find a companion or object with a small story attached to a note or book. This can be added to your inventory when you load your game with the mod active or you can use the quest to search for it. It will also include how to add spells via a quest and other options like sounds and messages which can be added to the scripts.
NOTE: I haven't gotten around to doing this addition yet.

I used to make it a habit to take screen shots of all my open windows in the Construction Set. For example: scripts, spells, stats etc. I can see at a glance what I've done for future reference, without loading the mod. But that's just me. I sometimes still do it for new mods depending on what I add to them.

Regarding Shivering Isles and companions: I haven't played SI for some time, but I know if you tell the companion to wait before entering the portal and then summon it when you are in the SI world there should be no problems. I've done this with Sher Ja and a couple of others and it was fine. That also relates to Oblivion Gates. Make the companion wait, enter the gate, then summon. Do the reverse BEFORE taking the sigil stone and summon once outside. Unlike other types of companions they obviously have no inventory that can be reset when the cells update.


FIRST STEPS:

This tutorial will create a lion companion, but can be used for any creature. I've never bothered making a companion from a Shivering Isles creature, but I know someone who did using this tutorial and it worked out as far as I'm aware.

It's a good idea to name all References and ID's with a prefix. For example - JJMyLion. Don't use numerals at the beginning of the ID, and have no spaces in the ID field. Using the JJ, or any other prefix makes it easier to find your entries. You can use AA or aa, or your initials as long as it's always the same for consistency.

Load the Construction Set and go to File/Save and create a new esp with the name of your choice. This will automatically make it active.
Click OK and Oblivion ESM will load automatically because you are loading a mod that requires it. Otherwise you can select Oblivion ESM only to load and choose to save your esp when you've started work on your mod.

Go to the Object Window on the left and expand the Actors\Creature\creature tree. Select the CreatureMountainLion and double click to open it's Stats Form.

Image

In the ID field give it a NEW unique ID. If you don't give it a new ID every lion will be a clone of yours. Close the window by clicking OK, and you will prompted to make a new form because you've changed the ID. Click YES to create a new object. In the NAME field give it a name which will appear in game.

Open the lion's Stats Form again.
Here you can change the Essential status and whether he will Check Corpses. I leave it checked for dogs and wolves, but not the lion because it does nothing and can slow the creature down. Canines have animations so it works well and they only do it after combat is over. Check swimming so they can follow in water. Again, canines seem to be better for this since they do actually swim while other creatures sink like a stone or have to find another path, but they will catch up.

Take the tick out of No Low Level processing and Respawns. Leave his Combat Style at Default for the mountain lion.
Tick PC Level Offset to have him level with you. Choose whether you want him to level above or below you by entering a number in the Offset box. For example, 1 to stay at your level or -1 to be one level below you.
In the Calc Min box type 1 and in the Calc Max box type 0. This will adjust his health, speed and fatigue modifiers on the right of the window.

Starting out it's probably best to leave his health and other stats as they are. You can adjust them later if you want. Although, I give my creatures an Intelligence of at least 30 so they can follow up stairs and through doors. They will even open gates. This also relates to successful fast travel so they zone with you instead of getting lost and having to be summoned.

Always leave Personality at 20 or even at the default as anything higher can make him passive, and enemies, depending on their Faction will ignore him when you want him to fight.


From now on I'm referring to the Lion as Leo to make things a bit easier. The abbreviation, CS, will refer to the Construction Set.


Go to the Factions Tab and right click to delete anything in there which is usually Creature Faction.

Next go to the CS Menu at the top of the screen and select Character -- Factions. Scroll down the list until you find Playerfaction. With Leo's page still open drag it to his Factions Tab. You can make a custom Faction, but it's not necessary. Player Faction gives Leo all the rights and privileges as the Player.
Image

Select the Inventory Tab. You can leave anything there or delete it. If you make him Essential he can't be looted anyway.

Select the Spell Tab. Depending on your choice of creature there may be a Disease listed. If so, delete it. The mountain lion has a Resist Frost ability which you can leave intact. Other creatures may have their own Abilities which can stay as well. This can depend on whether you decide to give him a Defensive spell that includes what he already has or boosts it. In that case remove the default spells.

There's no need to do anything with the other Tabs except if you want to add new meshes and textures for your creature, but this tutorial deals with the default Mountain Lion..
You can preview him moving and attacking by selecting the Animations Tab and clicking each movement to see him in the preview window. Tick the Preview Full box to do this.

**Remember to save often. Make regular backups of the esp so you can revert to a previous file if you make a mistake and have saved it! **


NEXT:

AI Tab:

At the bottom of the stats Form is the AI Tab. Click to change the values at the top of the new window.
Image

Aggression -- I've found 5 or 10 works well. Some companions use zero, but I found it causes the companion to be passive at the most inopportune times. Anything above can cause him to attack indiscriminately, including friends.
Confidence -- the higher the setting the less likely he is to run from a fight. 75 is a good number. If he's Essential and you want him to break off a fight if you decide to run or come back to fight another day, you could try a lower number. I have several Pet Only mods. Their aggression and confidence settings are different so they will flee when danger approaches and return when combat is over. It's not necessary to script this.
Energy Level -- This determines how much he moves around and animates when idle. Actors with low energy levels idle more often. You can leave it at the default for your creature.
Responsibility -- leave this at zero otherwise you will be reported for crimes by Leo and he can also accrue a bounty which applies to you being the owner.

At the bottom is the AI Package List. Right click on any packages in the list and delete all of them.

**Click SAVE and OK at the Stats page. Save the esp.
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

CONTINUED....

THE PACKAGES THAT MAKE LEO FOLLOW AND WANDER:

You will need to create a new Global Value first. Go to the Gameplay menu at the top of the main CS window and choose Globals.
Right click on any one and choose New.
Call it "LionFollow". Click OK. If you're using another name or creature, it still must be **Follow. In my House Cats mod I called them by their individual names..eg CleoFollow, PepperFollow etc. They must all be different otherwise the same value will relate to them all and the Follow and Wander commands for one will be used by them all of them. So, if you make two dog companions or even companion separate mods, they must be named for that creature so problems don't occur if using the mods together in game.

Now you have to make two AI packages.....Follow and Wander.

FOLLOW PACKAGE:

Open your creature entry again and return to the AI Window:

Right click again in the AI Package List and select NEW.
Select at least, Allow Falls, Defensive Combat and Allow Swimming.

At the top right where it says Package type select "Follow" from the drop down list.

In the ID tab give it a name for example (yourprefix)LeoFollow.

You'll then see four tabs:

SCHEDULE, CONDITIONS, LOCATION and TARGET.

Go to the CONDITIONS Tab-

At the very bottom click on the "NEW" button and select "GetGlobalValue" from the list.
The next box "Function Parameters" will say Invalid....click it and select the Global Value you made before. ie LionFollow
Leave the Comparison box as is and change the Value to 1.0000.
Image

Go to the TARGET Tab and select Specific Reference then select PlayerRef in the "ref" tab.
At the bottom right where it says Distance enter a number. This is how far Leo will be behind you when he follows. The number I use is 170 which is the distance the mod I based Sher Ja on uses. I assume it's feet, but we're metric in Australia. Anyway, it's a good distance because the companion is not under your feet or bumping into you all the time. This is also good if you use horses, because he won't be pushing the horse from behind when you are stationary. You can make it smaller or larger if you like.
Image

Click OK . You can go onto the next Package or click SAVE and come back to it. Remember to save and backup your esp.

WANDER PACKAGE:

Do exactly the same again, but this time call the ID "LeoWander". Choose the Package Type as Wander.
Image

Do the same at the Conditions Tab, but leave the Value at 0.0000.

Click the LOCATION Tab and select Near Current Location. Give it a distance. Again mine is 1800. This is how far he will wander around when you activate him to tell him to wait. Some mods use 1200 or less...it's up to you. When you have the summon spell you can call him to you anyway if he's wandered off into dense forest. In fact I have lowered this distance in my more recent mods myself.
Image

Make sure Defensive Combat, Allow Falls and Allow Swimming are selected here as well. Click OK and SAVE to close the window.

PLACE LEO IN THE WORLD:

NOTE:
He must be placed in the world before you can make the Summon Spell and especially before using the updated script adding the spell and sneak component to the main script posted after this tutorial. This because you need his Editor Reference to add to the spell script.

In the Cell View window where it says World Space and in the selection box, find and select Tamriel.
You can click on any name to select it then type the 1st letter of the area you want to load......For example "I"...then scroll down to the IC Waterfront01.

Double click to load the area in the Render Window on the right. It may take a few seconds to load depending on your system.

Zoom in to the location you want to place your creature. Try to get as close as possible to where you want to place him, then drag the creature (the text) from the Object Window to the world and press F to drop him. Don't drop him from way up high or you might have trouble finding him, especially in an exterior. If that happens you can find him by looking in the left side of the Cell View Window where you are placing him. Find his ID and double click it and the CS will locate him for you.

Press the A key to turn on the lights so you can see what you are doing.
Use a combination of Shift + Mouse Wheel (held) alternately to manipulate the screen to get as close as possible to the desired position. Scroll the mouse wheel to zoom in and out.
Click the creature so it is selected to move it around, and use the Right Mouse Button to rotate it if necessary. Or use the Z, X and Y keys for other movement.

When he's in the world double click him and give him an Editor Reference ID. This can be the same as his stats form ID, but put REF at the end. No spaces. Select Persistent Reference so he won't disappear when cells respawn. You should also select the Ownership Tab and make him Player owned. This will ensure he doesn't attack friendlies and will even defend you from guards if you resist arrest.
Image

Now it's a good idea to open his Stats Form and check Quest Item. Making him a quest item gives him loading priority, so he always gets loaded at game start. Otherwise he can also be forgotten by the game engine when cells respawn.
Don't do it before putting him in the world or the CS will prompt you about Quest items and possibly give an error message.

Save your plugin and test it. At this point we haven't added the Summon Spell, but you should make sure he is where you want him. He can be activated to Stay and Follow without the spell once the script is added.

NOW ADD THE SCRIPT

This is the script I use:
Image

It's a good idea to type or copy the script to a text editor like Notepad first. That way you can make alterations if necessary before adding it to the creature and risking errors when you try to save it.

You'll see where it says LionFollow you must change it to the name of the Global Value you made for your creature. The message as you see can be whatever you like, but should not go to another line.

Give the script a name. It should have SCRIPT at the end no matter what you call it.

The bottom part of this script also tells him not to attack you if you hit him, but is probably not necessary because making him Player Owned does the same thing. However, I was advised to leave it in and it doesn't appear to have any adverse effects. When I get to it I will test without that part of the script, but for the moment it's probably not doing anything anyway.


NOTE: "scn" means script name. You can also use the word ScriptName instead.

Code: Select all

scn AASherJaScript

ref rEnemy

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

begin OnActivate

	if IsActionRef player
		SetIgnoreFriendlyHits 1
		if LionFollow == 1
			set LionFollow to 0
			Message "'Sher Ja, wait for me.'"
		elseif  LionFollow == 0
			set LionFollow to 1
			Message "'Sher Ja, come with me.'"
		endif
		EvaluatePackage
		playGroup Idle 1
	         else
		activate
	        endif
end

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

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

In the creature's Stats Form click on the little box with "......" on it, next to the Script field, beneath the NAME field.
Select New from the Menu. Copy and paste the script into the box. Make sure it is an Object Script. Select this from the Script Type list at the top right of the script window.
Select Save from the Menu or use the disk Icon. You can also just click the cross and if there are no errors it will save.

DO NOT EVER SELECT RECOMPILE ALL WHEN SAVING -- This will compile every script in the game and your plugin will be extremely large not to mention problematic.

You'll have to close the stats form and re-open it to select the script from the drop down list in the Script Field below your creature's name.

Close the Stats Form, SAVE and backup again.
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

CONTINUED.....


CREATE THE ITEM TO HOLD THE SUMMON SPELL

If everything is working correctly we can go ahead and create the object that contains the spell and the spell itself.

**If you have Shivering Isles installed be careful about using items from the expansion unless you plan to use a creature and object from SI. Items, objects and spells etc from SI are usually prefixed with SE. If you plan to release the mod using SI items make sure to add that to the readme.

From the OBJECT LIST choose an item from the ITEMS list which will hold the Summon Spell script. It can be virtually anything, for example a gemstone or a bone which I used for Sher Ja or a shoe which I used for a dog companion. As long as a script can be added, it will work.

***Be careful about using Quest Objects as you must be sure to remove the tick from Quest Item first otherwise it will interfere with the related quest.

Once you've decided what you will use, double click to open the item's Form. As described above for Leo, give the item a unique ID and a name that will be displayed in the game. When prompted to create a new item, click YES. Leave the item for now. We have to create the Summon Spell before we can add the script to it.
Image

CREATE THE ACTUAL SUMMON SPELL

In the OBJECT Window got to Magic/Spell. I usually make a Summon Spell a Lesser Power because it's easier to find if you have a lot of spells like I do. Otherwise it can be a basic spell.

Right click on any spell and select NEW.

Give your spell a unique ID and a name which will appear in your spell book. Select the type of spell eg Lesser power. Select Script Effect Always Applies.
Remove the tick from Auto Calculate. This negates the Magicka cost of casting the spell unless you want it to have one. Close the Spell Form and reopen it. This saves your changes.

Right Click in the text field on the right and select NEW. From the Effect List select Script Effect. The Range is on SELF because we are casting the spell on ourselves. There is no need for a duration for this spell.
Leave the Script and Effect names for now. Choose the school of magic, eg Conjuration and a visual effect if you want one. I sometimes choose Command Creature for my companions, but this is better for Summoned Creatures only rather than constant companions. It's up to you though.

Remove the tick from Effect is Hostile. Again, close the Form and reopen it.

Now we add the script. In the text field it will say Script: NONE. Right click and select EDIT.

Click on the "..." next to the Script drop down box and a Script Editor window will open the same way as when we created the companion.
Select NEW from the menu and copy and paste this script into the blank box. Make sure to choose MAGIC from the drop down box on the right.

Code: Select all

scn SummonSherJaScript
Begin ScriptEffectStart
AALionref.moveto player, 100, 0, 0
End
Begin ScriptEffectFinish
End
Give your script a unique name. It should have Script at the end as shown. Change AALionref to the Editor Reference you made when you placed your creature in the world.
Save your script and close the Script Editor. Click OK to close the Effect Item Box and OK again to close the Spell Form. This saves the information.

The distance in the script is sufficient so that it won't land on top of you but a few feet away.

Once again open your spell and the Effect Item Box. Select the script you just made from the drop down list. Give the effect a name in the Effect Name field, eg Summon Creature or Summon "It's name."
Now the script will show in the text field of the Spell Form. You can click OK to close it now.
Image

ADD THE SUMMON SPELL TO YOUR ITEM

Find your item in the ITEM list and open it's Form. Add this script to it the same way as we added the previous scripts. This one must be an OBJECT script.

Code: Select all

scn AASummonSpellScript

short doOnce

begin OnActivate
if doOnce == 0
Message "Friendship will be your reward"
Player.addspell AASherJaSpell
set doOnce to 1
endif
activate
end 
Once again give it a unique name and add it to your item the same way as the previous scripts.
You can add a message as shown, which will show in game at the top left of the screen when you take the object. You will also receive a message to say the spell has been added to your spell book. If you prefer not to have the message in the script you can delete that line, but make sure not to leave the line blank. Move the next line up.
Click OK to close and save the information.

Place the item in the world the same way as you placed your creature. Drag the name of the item into the Render Window and place it wherever you like.

***Save your esp and now test it to make sure everything works as intended.


EXTRA NOTES

Your companion will start to wander as soon as you enter the cell where you placed him. If he has wandered off, just pick up your item containing the Summon Spell to bring him to you.
Activate him to make him Follow and again to make him Stay. He will take care of the rest.

I usually create a Healing Ability Spell even though my companions are Essential. Even Essential companions can very often become unconscious when you really don't want them to, and some of the WAC enemies are pretty hard.

See the screen shot for the Healing Ability I added to Sher Ja. You can make it weaker if desired, but this keeps him going in most heavy battles. I have in fact made changes to this ability in all my companions, but the following screen shot is the original.

They are still essential with this change, but can be knocked out more easily and now their health bar will show. I've added Resist Poison 75% and Resist Magicka 50%. The reason for this is I've been finding certain custom poisons and some enchantments in some mods cause lasting damaging effects to companions and in Essential companions they can become permanent requiring a reboot of the mod. Sometimes you'll see it happen with NPC companions where they will get up and fall down constantly because they've been damaged. Plus other odd effects.

For example My Dog Rosie was hit by a weapon with Damage Speed several times and ended up running as though in a pool of molasses, so I added the resistances which have worked so far. It's only happened once, but that was enough.

Image

Create a spell as described for the Summon Spell, but not a Script effect. Make it an Ability and drag the Spell to the companion's Spell Tab in his Stats form

If there are any problems or something seems unclear, please ask and I'll do my best to clarify. :)
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

UPDATE:

This is the updated script with the sneak function as well as adding the summon spell when activating your companion that I'm now using for all my companions. With this script it's not necessary to make an object to hold the spell. It's directly added to the companion and when activated it will be added to your spell book. It also means you have to find the companion before getting the spell so if it's wandered off you need to look around.

If you choose to use this script for the sneak function, but wish to still have an object for the spell you must remove the part of the script referring to the summon spell.

The sneak function works. If you are sneaking you can get right up to an enemy before the companion will react, and then only when you are detected or you attack first. Then he will enter combat mode. I've tested this extensively before releasing my updates and I know it works. I never noticed whether the sneak eye remains lit when sneaking with the companion, and I don't think there's much I can do about it anyway. I also don't add Chameleon because I don't think it's necessary. However, you can add the Chameleon shader via the script only when sneaking if you wish.

NOTE: This relies entirely on your sneak skill so if it's low and you are detected in a dungeon full of vampires expect havoc.

In the updates to my companions I also altered the Healing Ability as described in the main tutorial. They are detailed in my Readme texts, but it's your choice in that regard.

Code: Select all

scn AASherJaScript

ref rEnemy
short doOnce
ref GetSelf


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

begin OnActivate

	if IsActionRef player
		SetIgnoreFriendlyHits 1
		if doOnce == 0
			Player.addspell AASherJaSpell
		set doOnce to 1
		endif
	if (GetSelf.GetForceSneak == 0) && (player.IsSneaking == 1)
			GetSelf.SetForceSneak 1
  		elseif (GetSelf.GetForceSneak == 1) && (player.IsSneaking == 0)
			GetSelf.SetForceSneak 0
		endif
		if LionFollow == 1
			set LionFollow to 0
			Message "'Sher Ja, wait for me.'"
		elseif  LionFollow == 0
			set LionFollow to 1
			Message "'Sher Ja, come with me.'"
		endif
		EvaluatePackage
		playGroup Idle 1
	         else
		activate
	        endif
end

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

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

Thank you for reading. :)
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
User avatar
MasterAub
The Second
Posts: 377
Joined: July 3rd, 2009
Gender: Male
Born in: 1970
Location: Paris

Thanks Maigret,

This is a net tutorial and very good work. I really appreciate the fact that you are sharing this with us. Being a big fan of your & Waalx's work this tutorial is a huge opportunity to capitalize on the enormous potential of WAC.

Thanks again. thanks



Edit: Just made my own companion this evening using your tutorial, so for everyone out there the tutorial is working just fine.

Special Thanks to you Maigrets
Image
un ami qui cesse de l'être ne la jamais été
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

Thank you. :) I tried to make it so that anyone should be able to understand it even if they never even opened the CS before.

Mind you, occasionally when I'm making a companion I have to check my own tutorial. :grin:
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
urwis123
Fumbling Sworduser
Posts: 4
Joined: April 2nd, 2011
Gender: Male
Born in: 1991

I folloed this tutorial and I think it is great. I made a wolf pet. The only problem that I have found is that when I go with it to the city it attacks the guards. It also attacked Shady Sam. I don't know why, I don't have any infamy points and the guards don't attack me. Can you tell me what is going on.

Thanks
User avatar
MasterAub
The Second
Posts: 377
Joined: July 3rd, 2009
Gender: Male
Born in: 1970
Location: Paris

I Shady,

Two things:
1) Make sure your wolf pet has PlayerFaction in is Faction Tab and only this one...
2) Make sure you've set your pet ownership to Player in his ownership Tab

And your problem should be solve

Cheers
un ami qui cesse de l'être ne la jamais été
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

Thanks guys. :)

I'm glad it was easy to follow. Sometimes I have to check my own tutorial when I make a new companion. :grin:

@ urwis123

MasterAub is correct. Make sure to set ownership and the Player faction and you won't have any problems. The only time a companion will attack friendly or neutral NPC's is if you attack first. For example if you resist arrest or attack guards, then they will defend you even if the NPC or guard is normally friendly to you before you attacked them. By using the Player Faction the companion is a friend to all you are friendly with and of course an enemy to all your enemies.

Also, don't forget that the sneak function depends entirely on YOUR sneak skill. If the companion is detected while you are sneaking it's because you were detected. :)
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
urwis123
Fumbling Sworduser
Posts: 4
Joined: April 2nd, 2011
Gender: Male
Born in: 1991

In the faction tab I don't see player, there is a player faction option but I already had that selected in the first place along with only having player faction in the factions tab.





Wait, I found it. It works! Thanks a lot. This is the best companion mod ever. Fantastic for a ranger character. Nice and simple.
urwis123
Fumbling Sworduser
Posts: 4
Joined: April 2nd, 2011
Gender: Male
Born in: 1991

Sorry, I had a small problem with my wolf. It seems that every time he is near a horse he attacks them. I don't do anything and he attacks the horse and kills it. Same thing goes for Shady Sam. Any advice?
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

That's a very odd one with him attacking horses. :shock: I've never heard of anything like it except of course from bandits and other enemies. Is it all horses or just some? In theory if it's all of them I would have thought he would also attack guards and anyone else on horseback.

The only thing I can think of is it's still a Faction issue. Make sure there are no other factions under his Faction Tab except Player and also check he is Player owned. Most horses are in the Prey Faction, but still should not be attacked.

A few people have noted (and I've seen it myself since) that there are some odd faction relations in WAC between some creatures. Even though my own companions are in the Player Faction which means they should be treated the same as the player and should not attack anything friendly to the player, a few instances have occurred where this doesn't work as it should when playing WAC.

For example the white lions at the shrines. I can be at a shrine for a game hour (example) just standing around doing nothing, and suddenly for no reason my companion will attack the lions. There was no provocation or action on my part either to cause it. It seemed to me to be a timing issue as it happens after a set period each time I tested it, but I have no idea how to fix it as those lions are scripted for a specific purpose.

Another problem one is the pet cats in Leyawiin. It's been said my Toc Toc the Raven attacks them for no reason, but I haven't seen this myself because I haven't been there yet. It wouldn't be specific to Toc Toc though, but any of my companions since they all use the same system.

As far as Shady Sam goes I wouldn't be surprised if it's to do with either his evil disposition or his factions. I'll check him out later, but I have in the past had comments about the Dark Brotherhood Sanctuary and my companions attacking, or being attacked by the members there. It has happened to me as well if I forget and take my companion down there.

I never checked it out to see why, so it's either to do with the skeleton guard, or one or more of the DB members having evil faction issues, which also should not happen with anyone or anything in the Player Faction unless you attack them, of course.

In that case the best thing to do is tell the companion to wait outside the Sanctuary in Cheydinhal if you're a DB member. If you barter with Shady Sam tell your wolf to wait some distance away on the path. I always forget Sam even exists because of where he is, but if I remember I'll go there and see what happens. Been past him dozens of times, but not close enough for a fight to break out I imagine.

It should be noted that these faction issues can happen in the vanilla game between the player and other actors, so it's no surprise other strange things happen with mods added. :)
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
User avatar
MasterAub
The Second
Posts: 377
Joined: July 3rd, 2009
Gender: Male
Born in: 1970
Location: Paris

Hi guys, hi Maigrets,

I made a lot of companions using Maigret's tutorial. By the thanks again...
So as I go along taking pictures of them I'll update this post if you don't mind.

Here is my cougar companion
Image
By masteraub at 2011-06-16

but I also have a lioness watching over me
Image
By masteraub at 2011-06-16

and a big Lion defending me if need be
Image
By masteraub at 2011-06-16
un ami qui cesse de l'être ne la jamais été
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

That's really cool! :-) And you are welcome. :)

I can tell you I prefer my animals more than ever since I've been testing a NPC companion lately for a specific reason. Let's just say the animals don't get lost, don't get in the way, they follow wherever I go without having to find other paths and a myriad of other reasons I'd forgotten about that annoy me with other companions. Tonight I was running all over Cyrodiil, in and out of dungeons and my panther never missed a beat.
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
User avatar
MasterAub
The Second
Posts: 377
Joined: July 3rd, 2009
Gender: Male
Born in: 1970
Location: Paris

Let me tell you Maigret
Your tutorial is close to "pristine". The balance is exquisit. Add the WAC animals and it really becomes a pleasure to have pets around...

Special dedicace to you with this Tiger:
This puppy will tear apart every leaving entity that will attack me
Image
By masteraub at 2011-06-16

and my first feline pet
She is beautiful, loving but deadly
Image
By masteraub at 2011-06-16
un ami qui cesse de l'être ne la jamais été
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

Do you have them all loaded at once? I'd love to see a screen shot of the whole cat clan together and since your character is a feline it all fits well. :)

I have so many companions now I wish I had added them all to one esp, but I think I'll do that for my own future additions.

One question...are you having any of the issues mentioned above by urwis123? I know about the Dark Brotherhood issue, but as far as I can find out it's a vanilla faction anomaly and I've had it happen to me in a vanilla game with no companions where they will attack me for no reason. There's little can be done about it but to leave the companion outside the sanctuary as I said.
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
User avatar
MasterAub
The Second
Posts: 377
Joined: July 3rd, 2009
Gender: Male
Born in: 1970
Location: Paris

Maigrets wrote:Do you have them all loaded at once? I'd love to see a screen shot of the whole cat clan together and since your character is a feline it all fits well. :)

I have so many companions now I wish I had added them all to one esp, but I think I'll do that for my own future additions.

One question...are you having any of the issues mentioned above by urwis123? I know about the Dark Brotherhood issue, but as far as I can find out it's a vanilla faction anomaly and I've had it happen to me in a vanilla game with no companions where they will attack me for no reason. There's little can be done about it but to leave the companion outside the sanctuary as I said.
Hi Maigret,
Yes I have them all on one esp. I am at work right now but will definitely post a picture with all of them. At least the felines companions.
I made two Dogs, two Wolves one Fox, one Venison, one Okapi, one Deer, and one Antilope...as well. I add those as I play along... :D
I just went crazy about your tutorial...

No did not encounter problems as mentioned above...But I did not replayed the Dark Brotherhood Quest...Anyhow my pets generally stay out...
un ami qui cesse de l'être ne la jamais été
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

You have a virtual zoo! :grin: I'm not far behind you.

I thought about making myself a Greenie companion. It wouldn't be able to kill me and I could get my revenge on the little buggers. Would be great for a stealth character especially outdoors as they would be hidden by the grass since they are so small. I might just do that actually.

I just cleared a cave last night that had Greylings in it. They are hard to see in the dark and are just as deadly as their cousins the Greenies, but not so many at once.
spoiler:
Then there's also Sonic the Hedgehog. I usually encounter him near the shrine outside Bravil heading towards the IC. He's not friendly and doesn't have any rings to collect. :-(
:grin:
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
User avatar
MasterAub
The Second
Posts: 377
Joined: July 3rd, 2009
Gender: Male
Born in: 1970
Location: Paris

Greenies companion would be a lot of fun...I am thinking of a Gnoll Archer myself

Here is the felines companion (still missing a white Tiger and my beloved cheetah)

Image
By masteraub at 2011-06-17
un ami qui cesse de l'être ne la jamais été
User avatar
Maigrets
Admin
Posts: 1557
Joined: October 2nd, 2008
Gender: Female
Born in: 1954
Location: Australia
Contact:

Awesome. astar

I notice how the big cats crowd out the little ones marking their territory and dominance.
Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it sayingEnd Of The World Switch PLEASE DO NOT TOUCHthe paint wouldn't even have time to dry. Terry Pratchett
Post Reply