Grumpy's Mods
 

Companion Project v1.3
A companion "template" that can be used as is, or to build your own. 
Tribunal required

TRIBUNAL ONLY!!!

New version 1.3 :)

Not much new. :(

-changed her ID in the editor to aa_companion so she shows up at the top of the NPC list (actually, she's the third one down).

-Got rid of the potions section (redundant because Tribunal already does this).

-Added a new topic: Combat. You can now tell her how you want her to conduct herself during combat. There are four choices:

Use melee- Will only use melee weapons (swords, etc.)
Use ranged- Will only use ranged weapons (bows, etc.)
Use what I use- Will use whatever the player uses (mainly for fighter type players)
Use what you like- This allows the game engine to decide

It should be understood that companion will need the appropriate weapons in inventory for these choices to be effective.

-Fixed and moved the Marksman portion of the script out of the main script (now called CompanionCombat). Did this so it would work correctly with the new "Combat" topic. BTW, if you are casting spells, there are a couple of lines added to this (CompanionCombat) script that will cause companion to use whatever the game engine deems appropriate. She will function the same in this mode as she does in the "As you wish" mode if you are casting. I know this sounds redundant, but I'm not entirely sure how the engine would handle a situation like this (telling her to mimic the player's usage of weapons when the player isn't using weapons), so this should prevent any problems.

Summary (for this marksman section):
Use spells, and the game engine (and what's in her inventory) are the determining factors.
Switch from spells to melee, and she'll use melee.
Switch from spells to ranged and she'll use ranged.

-Dumped the leveled spells. Would suggest that if you want her to use spells that you simply add them in her spells tab on her properties sheet during creation. The following is what Emma has to say about this:

"As for making her use the right spells: put them in her spell inventory. Put the spell you want her to use (the most (my edit)) at the very top of the spell list. Then, she will use this spell until she hasn't enough mana and thereby is forced to use a weaker spell."

-Added some things that were included in Emma's new "Laura" companion mod. A couple of new lines to the levitation section based on an original idea by "The Other Felix" that causes her to fall with the player if the player's spell/potion/whatever expires, and also allows her to "break" during combat while levitating. Thank's go to Emma for permission to use this stuff.

-Changed the readme accordingly.


This is something I've been working on for some time now, and thought I would go ahead and release it.

Please take the time to read this document. I hope you will find it informative.

Installation instructions are in the "Other notes" section at the bottom of this document (before the script). Veiled attempt to get you to read this stuff.

I did this "companion" in a very "generic" manner for a couple of reasons. First, I hope the script will intrest a few people. Portions of it Have been seen in Emma's gf/bf mod. Second, I know a lot of people would like to try their hand at creating their own companion, so this is your big chance.

She is playable "as is" (very, as a matter of fact (I use my own version of this all the time)), but I still look on this as a "work in progress".

I'm going to shoot some credits right off the top here. Not in any particular order.

-UlfGeir for his "Slave Warrior Jessica" mod which was my impetus for this one
-Emma of gf/bf fame whose suggestions, continued support, and eventual use of some of this stuff helped tremendously (great gal, too)
-Devlor for his great assistance and great suggestions. Wouldn't have made it this far without him (dogged determination and intelligence)
-Reznod who because of something stupid that I did, pointed me in a direction that started all of this
-Fellow by the name of Shouju over at the main forums who resolved one of my biggest headaches (GetPCSleep function)
-GhanBuriGhan for his excellent tutorial
-The Other Felix as mentioned above

And others who have responded to posts I've made on the forums.

Which brings me to a very important point: If you have suggestions or improvements for the script, Please be kind enough to share them with not only me, but everybody else who downloads this file. If I (and there are others) think that your suggestion is better than what's included, or is a worty addition, then I'ld like to add it to this script, so that it can be seen by all who are intrested. Appropriate credit will be given, and inclusions will be handled per your instructions. As can be seen by the list of those who helped, this has been a community effort, and I'ld like to keep it that way.

Next thing is that I don't want anyone thinking that I know what I'm doing. I AM NOT A SCRIPTER. If I was, this would have been out a long time ago, and I wouldn't have made anywhere near as many mistakes as I did. All I really did here was assemble this stuff, just like you'ld go into the editor and put a house together. It might have been my idea to get companion to warp, but it was Reznod who showed me the way. The leveling scheme is mearly an extension of Ulfgeir's "speed boost" for his Jessica. Bunch of the rest came from much time spent combing through Gahn's Scripting for Dummies, and so on. Wish I had a dime for every screw-up I made on this thing.


What the script does-

Companion "warps" to the player when a certain distance and time have been exceeded. Problem with this was to keep it down to a bare minimum. Looks a little funky if you see her do it. Reason why it's done as it is (both distance and time). All this essentially does is make an assumption that if the specified distance and the alloted amount of time have been exceeded, then she's probably stuck.

Put it this way (using ballpark figures): The original game's AI covered 70% of the companion's following ability. Ulfgeir's speed boost (included in the flee part of the script) added another 20% to that bringing companion's following ability up to 90%. The warping puts it into the middle to high nineties now. There are still a few places that she'll get stuck, but for the most part, you no longer have to turn around every 5 seconds to make sure she's there. Only thing I would recommend is that you check and make sure she is close enough to you to "teleport" when moving from one cell to another (any interior or exterior door). She will not warp between cells.

***IMPORTANT***

***This "warping" "shuts off" during combat. There's a reason for this: I found that during ranged combat that if you don't shut this off in some manner, and companion has only melee weapons, that just using a distance/time script doesn't work very well. What happens is that she doesn't make it to the target (if far enough away) and will continually warp back to the player once the distance/time has been exceeded.

There is one problem with this, and there's nothing I can do about it. There are rare instances in the game when companion will not sheathe her weapon after combat. As long as she has her weapon in the ready position, she will not warp. Solution is to just tell companion to cast a spell. This will start the spell casting animation, and she will sheathe her weapon before she casts. Starts the script running again. I generally use "dispel", but you should be mindful of your situation here. You wouldn't want her to cast dispel if she were water walking, or levitating. In either one of those instances you'ld just tell her to re-cast the appropriate spell. Again, this happens rarely, but if you miss it, you're liable to lose her.****


Flees automatically when a specified % (40) of health has been reached. In other words, if she is hurt to the degree specified in the script, she'll try to get away from her attacker. I have seen attackers run her down and finish her off on occasion, though.

Will rejoin after the encounter is over.


Automatically takes healing potions if in inventory when 30 hp is reached. This is a tribunal function that I just recently found out about. Reason I took out the "potions" section of the script if you downloaded an earlier version.

A note about this: You should be careful about what potions you give to companion. In a game I was playing, I decided to let her carry all of my potions, and before I figured it out, she had sucked down three of my levitation potions. Also, do not give her more than one health potion at a time. If you do, and they get to the point where they have to take them, they'll take ALL they have. This is a Tribunal "bug". If you see them take one (you'll know by the visual effect or a quick check of their inventory via the "share" option), just give them another one (if you've got anymore).


Standard spells included-

Levitate: She now levitates right along with the player. I used a script similar to the warp script to "pin" her to the player's "z" axis. You go up, she goes up. These sections have also been updated to fix a couple of problems as mentioned above.

If your one of those types that likes to set your speed up to 2000 and fly around Morrowind like a 747, you got problems here. If she tries to warp between cells while levitating, she'll loose her spell and fall to the ground. Devlor suggested that for some reason the script seems to "reset" when this happens. Also suggested that her acrobatics be set abnormally high (200) to keep her alive if she does fall. This has been done.

2nd portion of levitation script--If she does not have a spell of levitation cast on herself and you take off (literally), she automatically goes into "wait mode" (AIWander 0 0 0 0). This is done to keep her from warping to the player after the aformentioned distance has be reached. Devlor referred to the results of such a scenario as "companion patty" (like hamburger patty).

3rd portion--You can, once you've levitated, return and tell companion to cast her spell of levitation, at which point she will rejoin you. This one gives the player the option of whether he/she wishes companion to go along or not.

Other spells-

Waterwalking: Fairly straightforward here, but the same thing that applied to levitate and excessive speed holds true here as well. However she does swim "in place" quite well, which means, if you can find her, she'll rejoin.

Dispel: Used to end her levitation or waterwalking session.

Also of note is that thanks to another suggestion by Devlor, she now has a CE waterbreathing "ability". Won't drown anymore. This one is loaded in the spells tab of her properties sheet as opposed to being activated via dialog. Would suggest that if you change the race of your character, that you check the spells tab of the companion's properties window and make sure this spell is still in there. If it's not, just replace it. Spell is called "companion_WB_ability" and can be found in the "Objects" window on the "Spellmaking" page.


Leveling scheme--

This is the extension of Ulgeir's "speed boost" that I mentioned earlier. What this does is check the player's stats every time the player sleeps, and then adjusts the companion's stats to be at whatever level is described in the script for that particular attribute or skill.

Example:

set p_strength to ( ( Player->GetStrength ) * 0.75 )

What this statement does is tell the game to set "p_strength" (a variable) to 75% that of the player's strength.

SetStrength, p_strength

This statement then tells the game to adjust the companion's strength to that defined above (when the player sleeps). 75% I thought suitable for a female companion (Ladies: If you'll look at the script, I did give you just due. Intelligence and willpower for this female companion are higher than the player's (in my particular case, a male)).

This was done for all attributes, basically because I don't know what effect these have on the companion's performance (see, told you I didn't know what I was doing).

These "multipliers" can be adjusted to whatever you think fit for your companion. Make an Orc with 10 times the carrying capacity of the player if you want by changing the "0.75" in the example above to "10.00" (10 x Player's Strength). Kind of a bipedal closet.

The skills are a little different. When I first tried this, I had it set up to mimic ALL of the player's stats. I thought: "Hey, this is great". Until it dawned on me that the player couldn't equip her with spells (at player's discretion). So, lets say a mage class character decides to use companion. Mage class character has 79 destruction skill (whoa). Companion does too. But no spells. Mage class character has 5 longblade. So does companion, and because you can only equip her with weapons and armor via the "Companion Share" (no spells), she becomes absolutely useless. Reason I decided to make her a fighter.

All of her weapons and armor skills have been based off of the player's level #.

set p_longblade to ( ( Player->GetLevel ) + 35 )

(rest is as above)

Problem here is that as a low level character, she will be roughly commensurate with the player, but at higher levels she gets a little "uberish".

A begining player has a longblade skill of 40. Her's is 36. Close. Player gets up to level 70, and she now becomes uber lady with a longblade skill of 105. Best I could come up with. As far as personal experience goes, I think once the player gets above 60 or 70 longblade, it doesn't make that much difference. You're 'gonna take most everthing in the game out with one shot anyway (given that you have a good enough weapon).

The player's level was the only number that would be consistent "across the board" for all classes of players. Meaning that she is now useable by all classes.

The other thing is that she now becomes a viable companion throughout the course of the game. You won't need to leave her someplace once you hit level 20 because she's stuck at a defined (low) level and dying every ten seconds.

This part of the script needs improvement, I won't deny that, but it was the best I could come up with, and it does work reasonably well.


Other notes:

Installation- You need to manually place the companion.esp into the C:\Program Files\Bethesda Softworks\Morrowind\Data Files folder. Do whatever you want with this text file.

She IS NOT ANYWHERE in the game. You can get her in the game by making sure the plug-in is loaded when the game starts, and then once the game has started, pull down the console (~) and type- "PlaceAtPC, aa_companion 1 0 0" (no quotes). This is probably the best way to use her in an existing game. Should prevent any problems that can occur (doubling types of bugs, or have seen instances of companions not showing up at all in an existing saved game because of conflicts with other mods). Know this sounds kind of cheesy, but thought it the best way to do it.

For a new game, you could put her in someplace of her own (created house), or use another house mod and put her in there via the editor.

You can open this plugin up in the editor, and do whatever you want to her/him/it. Make her whatever race/sex/class you want. The id is "aa_companion" and is located in the NPC section of the "Objects Window". When you find it, just doubleclick on the name to open her properties sheet.

She comes using in-game features (head/hair). Used the same head hair as the original Jessica mod. Kind of a tribute to Ulfgeir's "Slave Warrior Jessica" mod. I figure most will want to set her up as they see fit.

Going to make a comment about back-ups here first before I continue. You can either make a copy of this plug-in and store it someplace else other than the data files directory (I always use book art), or when you make the save, you can rename it, thus you'll have the original still intact. You should always make back-ups when modifying, though.

To use alternative head/hair features, you can either use the in-game features, or any one of a number of various mods that add new heads/hair. Just open the editor, and hit file (menu in upper left hand corner). Move down to "Data Files" and click. A window will pop up with a list of all of the .esp files in your c:\program files\morrowind\data files folder. Double click on the companion mod to get the box checked, and then make it the active mod by clicking on the "Set as Active File" button on the bottom of the window. Next look for your head/hair mod and double click that one also (should now have two mods selected with "companion" being the active one). Then hit OK. Give everything a few seconds to load. At this point, you should open any interior or exterior (doubleclick any of them in the "cell view window" so that you can "temporarily" place her in the game world and see what changes you're making (probably do this in the preview pane also, but I've never used that). Once you have a cell open in the "render window", go to the NPC tab of the "objects window" and scroll down until you see "aa_companion" in the lefthand column. Drag and drop her (left click and hold on the word "aa_companion") to the render window and let go. Might have to move around a little to get the proper viewing angle. Might want to hit the "a" key to lighten things up a little, too. Once you've got her where you want her, just doubleclick anywhere on her to bring up the properties sheet. The top portion contains all of her "features". Change as you see fit. You can also rename her, but...

***DO NOT CHANGE HER ID: "aa_companion"***

Hit the save button and then look at the results in the "render window". Once you have it the way you want it, and have saved the properties sheet, delete her (an absolute must) in the render window. Go back up to the "file" menu and save the plug-in.

You'll need to insure that whatever mod that you used to give aa_companion his/her new features is loaded on the splash screen along with the companion mod when you start the game. If you don't, SHE"LL BE HEADLESS! Now go back into the game and use the "PlaceAtPC" command in the console to check your work (and at this point, I hope it did work).


As far as useage: You may use any or all of this as you see fit, personal, or in a released mod.

For released mods:

Just make credit references to the mod itself "Companion Project" and please include this readme. No names.

Send comments/suggetions to anybody but me. (kidding)

dot350@abelink.com

Hope it does some good, and again, I would like to give my most sincere regards to those that have helped.

Dennis

AKA Grumpy


Following is the complete script, and one more note: I've seen a couple of people "cut" this because this script is not "optimized". No, it's not, and it's not going to be either. I have it this way because it's more readily understandable to me, and hopefully others. I've done a little of this "optimization" to my own personal companion, but as far as I can tell, any of the "tricks" that are available (such as a framecounter to keep the script from running every frame) have done little to increase frame rates. Best I can tell, this script will cause a loss of about 2 to 3 fps in the game. If it's optimized you might cut that down to 1 to 2, but, for one thing, as said above (limited scripting ability), most of things I've tried have pooched the script, so basically, the one I use is just about the same as this one.

You want optimized, then get Emma's new "Laura" mod. The Other Felix has done a great job of putting that script together. As of 5/23/03, it hasn't been released, but it should be shortly, and unlike this one, it is a very complete companion mod.


Begin companionScript

short Companion

float myx
float myy
float myz
float timer

short p_speed
short p_athletics
short p_strength
short p_willpower
short p_intelligence
short p_agility
short p_endurance
short p_personality
short p_luck

short p_health
short p_magicka
short p_fatigue
short p_attackbonus
short p_defendbonus
short p_resistmagicka

short p_longblade
short p_bluntweapon
short p_shortblade
short p_spear
short p_axe
short p_handtohand

short p_heavyarmor
short p_mediumarmor
short p_lightarmor
short p_unarmored
short p_block

; ENABLES COMPANION SHARE OPTION
; Used along with "short companion" (above).

Set Companion to 1

set myx to ( Player->GetPos x )
set myy to ( Player->GetPos y )
set myz to ( Player->GetPos z )

if ( menumode == 1 )
if ( GetPCSleep == 0 )
return
endif
endif

; ADDS DIALOG TOPICS.

AddTopic, "-Together"
AddTopic, "-Worth"
AddTopic, "-Spell"
AddTopic, "-Health"
AddTopic, "-Combat"

; SPEED INCREASE AND FLEE MODE
; Sets companion's speed/athletics to higher value to improve "following" ability.
; Also causes companion to flee when specified health level is reached and resets
; speed/atletics/flee when healed.

if ( GetCurrentAiPackage == 3 )
if ( GetHealthGetRatio < .4 )
SetFlee, 1000
SetSpeed, 100
SetAthletics, 100
elseif ( GetHealthGetRatio > .4 )
SetFlee, 30
set p_speed to ( ( Player->GetSpeed ) + 85 )
set p_athletics to ( ( Player->GetAthletics ) + 85 )
SetSpeed, p_speed
SetAthletics, p_athletics
endif
endif
endif

; SPEED DECREASE FOR WANDER MODE
; Returns companion to more realistic speed/athletics values when in wander mode.

if ( GetCurrentAiPackage == 0 )
SetSpeed, 40
SetAthletics, 40
endif

; WARPING TO PLAYER ( Used to improve "following" ability)
; Companion will automatically "warp" to the player when specified
; distance has been exceeded and specified amount of time has elapsed.

if ( GetCurrentAiPackage == 3 )
if ( GetWeaponDrawn == 1 )
elseif ( GetSpellReadied == 1 )
return
elseif ( GetDistance Player > 800 )
set timer to timer + GetSecondsPassed
if ( timer > 8 )
set timer to 0
SetPos x myx
SetPos y myy
SetPos z myz
endif
endif
endif

; LEVITATION
; Sets the "z" axis to that of the player when both player and companion
; are levitating. Game AI for NPC levitation works poorly in the vertical.
; This fixes that.

if ( GetEffect, sEffectLevitate == 1 )
if ( GetWeaponDrawn == 1 )
elseif ( GetSpellReadied == 1 )
return
elseif ( GetEffect, sEffectLevitate == 1 )
SetPos z myz
endif
endif

; Causes companion to go into wait mode if player levitates and companion
; has not been directed by the player to cast her own spell of levitation.
; Needed to keep companion from "warping" to player and falling to her death.

if ( Player->GetEffect, sEffectLevitate == 1 )
if ( GetEffect, sEffectLevitate == 0 )
AIWander 0 0 0 0
endif
endif

; Based on an original idea by "The Other Felix", this section
; gets companion to fall with the player if the player's current
; means of levitation expires.

if ( Player->GetEffect, sEffectLevitate == 0 )
if ( GetEffect, sEffectLevitate == 1 )
SetPos z myz
endif
endif

; Used to allow companion to levitate and rejoin player if companion
; was previously in wait mode.

if ( GetCurrentAiPackage == 0 )
if ( Player->GetEffect, sEffectLevitate == 1 )
if ( GetEffect, sEffectLevitate == 1 )
AIFollow Player 0 0 0 0
SetPos z myz
endif
endif
endif

; LEVELING SCHEME AND CHECK STATS WHEN PLAYER SLEEPS
; This is done to keep the entire script from running all of the time
; (keep the script's impact on game performance to a minimum).
; Stat increases will only be aquired by the companion when the
; player sleeps.

if ( GetCurrentAIPackage == 3 )
if (GetPCSleep == 1 )
set p_strength to ( ( Player->GetStrength ) * 0.75 )
set p_willpower to ( ( Player->GetWillpower ) * 1.10 )
set p_intelligence to ( ( Player->GetIntelligence ) * 1.20 )
set p_agility to ( ( Player->GetAgility ) * 1.10 )
set p_endurance to ( ( Player->GetEndurance ) * 0.80 )
set p_personality to ( ( Player->GetPersonality ) * 1.25 )
set p_luck to ( Player->GetLuck )

set p_health to ( Player->Gethealth )
set p_magicka to ( Player-> Getmagicka )
set p_fatigue to ( Player->Getfatigue )
set p_attackbonus to ( ( Player->GetAttackBonus ) * 1.25 )
set p_defendbonus to ( ( Player->GetDefendBonus ) * 1.50 )
set p_resistmagicka to ( ( Player->GetResistMagicka ) * 1.50 )

set p_longblade to ( ( Player->GetLevel ) + 35 )
set p_bluntweapon to ( ( Player->GetLevel ) + 35 )
set p_shortblade to ( ( Player->GetLevel ) + 35 )
set p_spear to ( ( Player->GetLevel ) + 35 )
set p_axe to ( ( Player->GetLevel ) + 35 )
set p_handtohand to ( ( Player->GetLevel ) + 35 )

set p_heavyarmor to ( ( Player->GetLevel ) + 45 )
set p_mediumarmor to ( ( Player->GetLevel ) + 45 )
set p_lightarmor to ( ( Player->GetLevel ) + 45 )
set p_unarmored to ( ( Player->GetLevel ) + 44 )
set p_block to ( ( Player->GetLevel ) + 45 )

SetStrength, p_strength
SetWillpower, p_willpower
SetIntelligence, p_intelligence
SetAgility, p_agility
SetEndurance, p_endurance
SetPersonality, p_personality
SetLuck, p_luck

SetHealth, p_health
SetMagicka, p_magicka
SetFatigue, p_fatigue
SetAttackBonus, p_attackbonus
SetDefendBonus, p_defendbonus
SetResistMagicka, p_resistmagicka

SetLongblade, p_longblade
SetBluntweapon, p_bluntweapon
SetShortblade, p_shortblade
SetSpear, p_spear
SetAxe, p_axe
SetHandtohand, p_handtohand

SetHeavyarmor, p_heavyarmor
SetMediumarmor, p_mediumarmor
SetLightarmor, p_lightarmor
SetUnarmored, p_unarmored
SetBlock, p_block
endif
endif

end companionScript


CompanionCombat (Short script that gets used when the player sets companion to "mimic" his/her weapon selection via the "Combat" topic (Use what I use).)


begin CompanionCombat

short p_marksman

; MARKSMAN
; Forces companion to use ranged weapon if in inventory and
; player is also using ranged weapon. Uses anything else in 
; inventory if ranged weapon is not present.

if ( Player->GetWeaponType <= 8 )
setmarksman 0
elseif ( Player->GetWeaponType >=9 )
setmarksman 1000
elseif ( Player->GetSpellReadied )
( set p_marksman to ( ( Player->GetLevel ) + 35 )
setmarksman, p_marksman
endif
endif

end CompanionCombat


CompanionCombat2 (Another short script used for the "Combat" topic. Had to use this one to get her to set her marksman skill to an appropriate level when letting the game engine determine her weapons usage (Use what you like).)


begin CompanionCombat2

short p_marksman
set p_marksman to ( ( Player->GetLevel ) + 35 )
setmarksman, p_marksman

end CompanionCombat2


Download Companion Project v 1.3
from Elric Melnibone

Download Companion Project v 1.3
from Emma's Elder Scrolls Site

Download Companion Project v 1.3
from Great House Fliggerty

 

 


Companion Project v3.1
"Companion Project" style companion "template", but newer version.
Tribunal and/or Bloodmoon required



This mod requires at least Tribunal to function. It should work equally well with just Bloodmoon though (or both)...



Please Read this. There is information in this about the mod that you'll probably want to know.


Changes from 3.0-

I have removed the second script text file that was included with the original and added a short tutorial to this readme for those who wish to create companions for release using this mod. The script in the text file was bugged a bit, and a couple of people had problems with it. Hopefully the tutorial in the "Misc." section below will simplify the process a bit.

One guffaw with the "one time move" section has been fixed.


Another modder's resource type of mod as is the earlier Companion Project mod.

Gives you a companion base from which to either create your own companion, or use in part or whole in the creation of your own mods.

Basically a more refined version of the Cally/Gabran (C/G) script that uses a different style of warping, but set up in a similar manner to the original "Companion Project" mod, although this script is not commented as was the one in CP. This one uses a newer "quick-warp" scheme that places the companion roughly 17 virtual feet behind the player when a warp occurs. C/G mods placed the companion less than one virtual foot from the player. Reason for this change is to make warping less noticeable during gameplay.

I also used a "ForceRun" section in the C/G scripts to minimize warping. Worked fine, but made them look terrible if used with other companions (they looked like they were on a pogo-stick). I was able to eliminate that problem with this newer warping system, so this one will behave more like a typical companion when used with other companion mods.

The original "Companion Project" warping system used a delayed warp, meaning that a period of time had to expire before the companion warped (8 seconds). On occasion, if the script had not timed out, it was possible for the player to loose the companion if they were too far from teleport types of devices (doors most notably) when/if the player activated such devices. Problem here was that you needed to turn and insure that companion was close enough every time you used a teleport device.

This mod is similar to the C/G mods in that it uses a "quick-warp" scheme to eliminate any delay during normal wandering. In other words, if a CP companion got stuck, you would have to wait a few seconds for the warp to occur whenever a warp became necessary. This one has no delay during normal wandering, meaning you can play the game without having to constantly check to insure that companion is close enough to accompany you through a door, siltstrider, etc..

Rough guess on the maximum distance that a companion can be from a teleport device for a successful teleport is 1000+ game units (near 50 virtual feet). I've tested it out to 900gu without problems and this companion should never be farther than 700gu from the player with the possible exception being during combat, eliminating this possible loss at doors, etc..

Two possible cases where you can loose this one: If you activate a teleport device during combat and companion is too far away (warping is disabled during combat), or if you should do the same shortly after combat (a six second timer is used here to allow the companion enough time to rejoin after combat is over). I should like to think these two instances would be extremely rare. To save confusion, this mod does employ a timed warp as does CP, but only after combat. During normal wandering the quick-warp system is used, so there are actually two different systems in use here.


Next thing to fix to insure good following ability was a minor problem of them leaving their weapons out after combat was over. "GetWeaponDrawn" is the script function used to disable warping during combat (you don't want them to warp during combat..), so if they leave their weapon out after combat is over, warping is essentially broken. This is a known game bug. Although this doesn't occur often, it does happen, and when it does, you can loose the companion if you don't notice it.

Section of script for "auto-sheathing" of all weapons is used to fix this. This section uses the sounds that weapons make when swung or shot to check and see if combat is over. If no weapon sounds are heard after a 4 second interval, a short section of script runs that equips a silver dagger, and when this happens the companion correctly sheathes their weapon (dagger is immediately removed from inventory after this event). This was used in the C/G mods, but was done for melee and thrown weapons only. Bow and crossbow sounds have been added to this one, meaning that all weapons are now covered by this "auto-sheathe" section.

Slight hitch: If companion has to move a distance that takes longer than the defned 4 seconds to enter combat, the auto-sheathe will fire. In-game, this will look like they have broken stride and that's about it. They will re-draw their weapon and continue pursuit. On a really long run, they can do this a couple of times, but it does not affect their performance during this event, and they will successfully engage the opponent. Like I said, just looks like a missed step if you see it.

I have to shut this auto-sheathe off during levitation as well. Because of this 4 second timer, they will continually reset to the player's "z" axis if they attempt to enter combat. If they should happen to leave their weapon out after combat while levitating, there is a command in the "combat" section of dialog to get them to sheathe.


Upshot here is that this companion should be very near 100% in following ability, but act more like "normal" companions in compairison to the C/G mods. Given this, you can now turn more of your attention to the game instead of having to check on companion all of the time to insure that they are following correctly.


Probably the best thing about this version that will affect modders who would want to use this in their own mods is that I have put everything into two scripts: One main script, and one leveling script. I've heard from some who are not enamored with the leveling script I've used, so I thought this the best way to go about it. Also, the C/G mods used several sub-scripts to accomplish a few things, making it difficult to apply to other companions. This one should be fairly easy to use when compared to those.

If you wish to disable the leveling script, either remove, or comment out (;) the following lines from the main script (in red bold (ONLY these lines)):

near the top-

if ( MenuMode == 1 )
if ( GetPCSleep == 0 )
return
endif
endif

about a third of the way down-

if ( GetCurrentAIPackage == 3 )
if ( GetPCSleep == 1 )
StartScript 1gr_comp2Level
endif

Once this is done in the main, the leveling script itself can be deleted as well.

No references are used in either script, so either a copy/paste of the script(s), or modification of this mod, with appropriate ID change should work fine for released mods. And please use unique IDs for your characters if you do use this script in a released mod to prevent conflicts with other companion mods. It probably wouldn't hurt to rename the scripts themselves, either.

Appropriate changes should also be used in dialog. If two mods have identical topics, then there will also be conflicts, so, for instance, where I have used "-combat", you should change that to something else: "-combat mode" for instance (anything, as long as it is unique).

I would also strongly suggest that the top section of the script be left intact. There are several return lines whose placement is crucial to correct functioning of this mod. There are notes in the script near the bottom that define where additions should be made if so desired. Variables can be added as well.


Guard stuff:

This version is guard enabled. What this means is that the companion will attack creatures on their own without being prompted. When using any other class for companions other than guard, there are only three reasons they (companion) will enter combat (what I term "prompts"): The player is attacked; the player attacks, or they (companion) are attacked (very rare). The guard class uses a different (hard coded) AI that dictates that they will attack creatures that are in the process of attacking the player.

In order to keep the companion from arresting the player if the player breaks the law, a unique greeting has been used in the "0" slot of the "Greetings" category in dialog. When the game engine searches for appropriate greetings, it starts at this "0" section and runs through all of them (9 is the last) until it finds a correct greeting for the current condition. By putting this unique greeting at the very top of the "0" slot, it gets hit first, and the game engine never makes it to the greetings that the guards typically use ("5" slot), thus she will not arrest you if you do wrong...

You will still see some guard type topics appear, but they will not affect the mod. I have used the "NoLore" option to eliminate most of these topics, which also gets rid of any topics that are not specifically assigned to the companion, but there are a still a few that the "NoLore" variable does not affect. It should also be noted that if you take the companion to Solthsteim, they will then have the full assortment of topics. Apparently none of the lore topics used in Bloodmoon are affected by the "NoLore" variable. I could have removed all topics not covered by the "NoLore" variable by using the "NotID" function in dialog, but there are many. I probably would have missed some, and using this type of approach greatly increases the size of the mod.

If you want to use this guard option in a mod, and need to add new greetings, then make sure that you add them to the top of this "0" slot. If you do not want to set them as a guard, then set their class as you please, and use the "5" slot (typical) for your greetings (make sure to remove the greeting I've used in the "0" slot if this is the case).

Note that by using the guard class they will only attack hostile creatures, not NPCs (code dictated).

Many thanks to Emma for this dialog tip.


Standard fare:

-companion share
-auto levitation
-auto water walking
-auto sneak

-CE water breathing ability to insure that they won't drown.
-CE 1 point per second restore fatigue
I did this because I've noticed that these companions run a lot when normally following, and that saps their fatigue. This probably isn't the best solution, but it was a lot easier just creating a simple CE ability than doing a bunch of scripting.
-CE swift swim ability
This one to keep them from warping repeatedly while swimming behind the player.


Auto-Leveling:

This mod makes use of an auto-leveling system that I've used for some time. There is nothing in-game to tell you that the companion is leveling, but it works just the same. Every time the player successfully rests, the leveling script runs and makes compairison checks against the player's stats to see if any changes have occured. If there have been changes, then adjustments are made. Attributes are at or near those of the player's. Both armors and weapons are changed according to the player's level.

Attributes example:

If the player's strength is 60 and it increases to 61 then the leveling script will adjust the companion's strength accordingly:

short p_strength ;declared variable

set p_strength to ( ( Player->GetStrength ) * 0.85 ) ;this statement sets the variable to the defined level (player's strength x 0.85)

setStrength p_strength ;this statement then sets the companion's strength to that defined in the statement above

In this case, the leveling script sets the companion's strength to 85% that of the player's, so if the player's strength was 60, the companion's was 51. If the player's strength is increased to 61, then, on a successful rest, the companion's strength gets increased to 52. Note that strength is the only one of the attributes that is set as a percentage of the player's attribute. The others are equivalent to the player's attributes. This is to show that such a system is easily changed, so if you were to increase the 0.85 to 1.25, then the companion will have 1.25 x the player's strength. This operation can be done for all attributes as well as health, etc.. Also note that there are two different "short variables" used for the attributes, so similar adjustments should be made for both. I did this to insure that the stat only goes up and never down. Reason for this is that if the player gets hit with a damage strength spell in-game, thus loosing a percentage of his/her strength, then rests, the leveling script would tell the companion to adjust their strength down. Not desireable...


Armor and weapon skills are done a bit differently. They add a number to the player's level to get the desired skill level for the companion. The player's level was the only number I could come up with that would be the same across the board for all classes of players. If I had set the weapon and armor sklls according to the player's skills, and the player was a mage class with a 5 skill in weapons, then companion wouldn't have been very effective.

Weapon/Armor example:

short p_longblade

set p_longblade to ( ( Player->GetLevel ) + 35 )

setLongblade p_longblade


...gives the companion 36 for a longblade skill if the player is level 1 (35 + 1) and 45 if the player is level 10 (35 + 10). This works effectively at low and mid levels, but gets just a bit uber at higher levels: Player at level 70 yields 105 longblade (70 + 35).

Armors use the same setup except 45 is added to the player's level.

All weapons use 35 + player level and all armors use 45 + player level. She will be as adept with longblade as she will be with a spear, and will use heavy armor as effectively as she will light.

I've used this system ever since it was introduced in "Companion Project", and it is effective in keeping the companion viable throughout the course of the game.

This system is based on Ulfgeir's speed and athletics boost that was introduced in the "Slave Warrior Jessica v1.3" mod.


Combat:

-Melee only
-Marksman only
-Player match
This one causes the companion to mimic the player's weapon usage during combat. Works for melee and marksman only. Example: I typically start a combat sequence with a ranged weapon and then switch to a melee weapon when the opponent gets close enough. When you use this option, the companion will do the same provided thay have both types of weapons in inventory.
-Use what you want
Allows the AI to control weapon useage.
-Sheathe your weapon
Used in case the auto-sheathe fails (during levitation sequence).


Follow:

-Standard stuff...


Others:

Auto-move
This mod uses an auto-move function if so desired. This can be toggled off or on via dialog. What it does is cause companion to ALWAYS move if too close to the player. If you have this enabled and companion is in your way, mearly bump into her and she will move. There is a caveat here: If the companion is moving, they are not in follow mode, so you can loose them at teleport devices. If you use this option, make sure that companion is stopped before activating these types of devices. Eye candy, mostly...

One-time move
Similar to that used in Dixon's "Hilda" mod. This simply puts the companion in wander mode for 4 seconds and then right back into follow mode again.

Take a healing potion
If her health is below 70% you can command her to take a healing potion, but only the standard in-game potions, and she has to have at least one of these in inventory. If she has no healing potions in inventory, she will tell you so. If her health is above 70% she will tell you that she is fine and doesn't need healing at present.

Tribunal (and Bloodmoon) include a function that dictates that if a NPC (or creatures in some cases) have a healing potion in inventory, that they automatically take it if their health falls below a defined point. My own guesstimate is that this occurs at 30% remaining health. This will also hold true for this companion. One hitch with this: They will continue to consume healing potions, nearly every frame, until their health rises above the 30% mark. This means that if you give them 10 restore health potions and their health falls below that 30% mark, they will probably consume all of them at once. This problem has been delt with via script in some mods ("Partners" I think for one), but not in this one. I would suggest that you only allow companion one healing potion at a time and that potion should be commensurate with their (your) level, so if they are low level with 55hp, then a standard healing potion will work fine, but at higher levels, you should give them one of the stronger potions instead. You will want to give them another healing potion if you use this option and only allow them to carry one at a time (recommended).

If you do allow them to carry several healing potions of varying types, and then tell them to take a healing potion via this option, they will take the best one they have in inventory.

I was a bit reluctant to include this because it involves both dialog and a section in script (a bit complex in relation to the rest of the dialog), but there have been times companion was at low health, I didn't want to rest, and wanted her to take a healing potion. This helps a bit in that respect.

Note that her current health will be reported whenever you open dialog with her (I think Dixon did this too, but this is my own version, and it gets reported as a percentage of max health.).

Late addition: While testing, I noticed that companion's strength was degenerating whenever I would leave her alone and change cells after a rest period. Problem was that she had "Yellow Tick" disease which I was unaware of. It is important to understand this sequence of events (rest/put into wander mode/cell change), because the leveling script will set her strength to where it should be during a successful rest, but once the player and her are in different cells, the disease effects show up again, and you will notice this depleation at that point, and this condition will continue until something is done about it.

I was unaware of the possibility of NPCs contracting these diseases up to this point. What I did (suggestion by Emma) was give her restore and cure capabilities (found in this "-others" section), so you can fix this problem should you happen to notice it. Notice it... There's the rub. I could script for all of these disease and curse spell effects, and have a messagebox display if she were to beome "infected", but this current script is already quite large, and I would hate adding that much to it for something that is going to happen rarely, and there is nothng in dialog that will detect if an NPC is diseased (PC yes. NPC no.), so you're going to have to keep an eye on her strength (companion share shows strength) and see if you notice it going down. If you do, simply run these two commands (restore and cure) to fix her. You should run both, because there are different diseases and curses. Couldn't put them all into one spell because the "restore" spell used up all available slots (attributes). Emma also suggested that I not try having her cast both at the same time (both in one results box). We aren't sure if both will work if used this way. I suppose you could also do this on a regular basis (daily???) as well, and that would insure that they would be up to par.


Installation and useage:

Unzip to your C:\ folder, NOT DATA FILES! "Companion_v3.esp" this readme, and one other .txt file. Make sure the .esp is enabled in the "mods" section of the splash screen. If manual placement is desired, just put the "Companion_v3.esp" in your data files folder.

Note that this companion is NOT in the game. To get her there, make sure the mod is enabled, then pull the console in-game with the tilde key (~), and type the following:

placeatpc 1gr_comp3 1 0 0 0

...then hit the "enter" key.

(PlaceAtPC, ItemID, count, distance, direction)

Make sure the syntax is correct when you do this. Spaces ARE necessary.

She will auto-level on initial encounter.


Performance:

As far as I can tell, this mod costs about 2 to 3 frames per second on my system (P4 2.8gig with ATI 9600pro). For compairison, the original Companion Project cost about 1 to 2 fps and the Cally/Gabran mods were in the 4 to 5 fps range.


Miscellaneous:

If you want to use this mod to create you're own companion, and want to use a unique head, then please visit this site: http://www.gamersroam.com/emma/faq.htm for instructions. Lot of other good things there as well, including Emma's companions and many other great mods (including Emma's heads).


I'm going to try a short tutorial here on creating your own companion for release. If you just want to modify this mod for your own personal use, don't bother with this.

Suggestion is to use the mod as it stands, but you will need to make some changes to keep the mod from conflicting with other companion mods that use this, or similar methods.

This kind of bounces around a bit, but stick with me here and make sure you follow these instructions in the order that they are laid out and hopefully this all goes well. If it doesn't, please feel free to PM or email me. This is off the top of my head, so I may have made a couple of guffaws here or there. If I did and you let me know about them I will make appropriate changes to this section.

Dialog window is accesed from the "dialog bubble" icon.
Script window is accessed from the "pencil" icon.

1- Change the names of the topics:
-Open the mod up in the editor.
-Click on the dialog icon to bring up the dialog window.
-All of the topics used in this mod are at the top of the list... You will need to change them all...
-Take combat for instance: The reason it's at the top is because I used a hyphen in front of the name: "-combat..."
-Notice the three periods at the end of it... This is to insure that the topic is unique if used with other mods...
-You will also need to insure that your topics are unique as well.
-As an example, you could change "-combat..." to "-use of arms".
-In the topics list, click on the original topic once, then click on it a second time (not a double-click).
-An edit box appears, and you can now change it to what you wish.
-Change the rest to something unique also.
-VERY IMPORTANT!!! Once you rename these topics, you will also need to change the appropriate "AddTopic" lines in the main script.
-You will find these near the bottom of the main script.
-Remember that syntax is everything in script.
-These need to be EXACTLY the same as the names of the topics used in the dialog window or they won't show up in the game.
-Click on the script icon.
-A grey script window will open.
-Click on "Script" in the top left corner of the script window.
-Click on "Open"
-Select the "1gr_comp3Script" from the pull down box.
-Make the appropriate changes to the "AddTopic" lines.
-Once you are finished, click on "Script" again and then click "Save".
-If you're syntax on the topic names is incorrect here, the script will not save, and will give you an error message informing you that it cannot find the topic you have specified. Remember that syntax (spelling, etc.) has to be exact...

2- Open the property sheet of the character and make applicable changes:
-Find the character in the NPC tab of the Objects window. 
-Double-click to open the property sheet.
-Change the ID of the charater.
-I use "1gr_" on all of my companions now to insure that the ID is unique.
-"1" to keep the NPC at the top of the NPC list, and "gr_" is simply the first two letters of "Grumpy".
-Change it to whatever you like, but make sure it will be unique.

note: Emma and I have had our differences about this, but from what I've seen if you change the topics BEFORE you change the ID, as has been outlined here, then the filtering for the ID that is used in dialog should automatically reflect the change to the ID name. In other words: Once you change the ID of the character and then save it, the correct ID should appear in the "Speaker Condition / ID" section of the dialog window. But... Check this once you have saved the new ID to insure that this is indeed the case. If it's not, mearly change the "Speaker Condition / ID" to the appropriate ID of the character.

-Change the name of the character to whatever you wish.
-You may change the race to whatever you want.
-You may change the class to whatever you want, but be advised that if you change it from the "Guard" class the character will no longe exhibit the guard characteristics as mentioned above.
-Change head/hair/sex to whatever you wish.
-Finally, check the spells section of the property sheet. There are three abilities that I have added to these guys: 1gr_comp2_swim, 1gr_comp2_wb, and 1gr_comp2_fat. The first insures that they will keep up with you while swimming without warping too much. Second is the companion's water breathing spell which keeps him/her from drowning, and the last one is a restore fatigue spell that keeps the companion from loosing too much fatigue while following. If you change the race of the companion, the editor will remove these spells from the spell-set automatically, so you'll need to add them back in again. Find them in the "Spellmaking" tab of the "Objects" window and just drag/drop them back into the spell-set window.

3-Make applicable changes to the scripts:
-Click on the script icon.
-A grey script window will open.
-Click on "Script" in the top left corner of the script window.
-Click on "Open"
-Select the "1gr_comp3Script" from the pull down box.
-Change the name of the main script: I use "1gr_comp3Script". Change this name to whatever you wish to insure that it is unique.
-Change the name of the leveling script as it is in the main script.
-This needs to be done in two different places.

-About 2/5ths of the way down in the main script you will see the following:

if ( GetCurrentAIPackage == 3 )
if ( GetPCSleep == 1 )
StartScript 1gr_compLevel
endif

-The line in bold above is the one you want to change, and agian, change it to anything as long as it's unique. Example:

if ( GetCurrentAIPackage == 3 )
if ( GetPCSleep == 1 )
StartScript MyCompLevel
endif

-Near the bottom of the script you will see the following:

if ( addOnce == 0 )
AddTopic "-combat"
AddTopic "-follow"
AddTopic "-others"
StartScript 1gr_compLevel
set companion to 1
set addOnce to 1
endif

-Change the line in bold to the exact same thing that you changed the first instance to (example):

if ( addOnce == 0 )
AddTopic "-combat"
AddTopic "-follow"
AddTopic "-others"
StartScript MyCompLevel
set companion to 1
set addOnce to 1
endif

note: At this point it gets a little tricky. If you were to try and save the main script at this point, it would give you an error message stating that it could not find the leveling script whose name you have now changed. What you want to do is open the leveling script in a second script window. Same procedure as above.

-Open a second instance of the script window by clicking on the script icon.
-Select "Script/Open" and then select "1gr_compLevel" from the drop-down list.
-You will need to change this name in two separate places:

At the very top of the script, change:

begin 1gr_compLevel

...to the exact same thing you renamed it to in the main script, so it might look like this (example):

begin MyCompLevel

...and bear in mind that spelling (syntax) have to be exact here...

-Now you need to go to the very bottom of the script and change the second instance of the name:

StopScript 1gr_compLevel

-Change this to (example):

StopScript MyCompLevel

-Now you can save the level script. You will probably need to save it twice. On the first save you will get an error message stating that the script name used in the "StopScript MyCompLevel" line could not be found. Just click on ok, then save it a second time. The new script name (MyCompLevel) is not a valid script name until it is saved the first time, so the name in the "StopScript" line is invalid, and that's the reason for the error. Once saved the first time, it then becomes valid, and a second save compiles the script just fine.

-Once saved, you can close the script window for the leveling script.
-Once this one is saved and closed, you can now also save/close the main script as well.

note: Once you change the name of the main script and save it, you will need to re-assign it to the companion. Open the property sheet again, click on the now blank "Script" window to get the pull down box, and then select your newly named script.

4-Once all of the above is completed, you can go ahead and close up the property sheet and save the mod.

As a final note, I strongly suggest that you open the mod up in TESAME and insure that it is clean. Just make sure that the old topic names have been removed. If they haven't, simply delete them with TESAME, and hopefully at this point you have a useable, clean companion mod.

Best of luck.


Credits and thanks:

-Emma for her continued support, friendship and advice
-Devlor and Reznod for great help on the original Companion Project mod (forebearer of this mod)
-Ulfgeir for the SWJ mod on which much of this mod and my previous mods are based
-Mana User for his understanding of a completely sensless question
-Simpleton for the math solution used in the "warp-behind" section
-Vorwoda the Black for his inspiration during my involvement with GYO and script help with the Cally/Gabran mods
-Ronin for his support and testing
-Sunsi for being Sunsi... (support and testing also...)
-and probably a hundred or so others (mostly from the CS forum) who have contributed to the creation of not only this mod, but many others as well


As with all of my mods, use at your discretion. Permission for useage is not required.

Dennis

aka Grumpy

grumpymods@lovkullen.net

 


Download Companion Project v3.1
from Elric Melnibone

Download Companion Project v3.1
from Emma's Elder Scrolls Site

Download Companion Project v3.1
from Great House Fliggerty

 

 


NPC Schedules (beta2)
Simple scheduling mod.

Morrowind Only required

PLEASE NOTE! This mod has been updated with a 'Fargoth-correction' by TESPIS. In Grumpy's original version, it was almost impossible to catch Fargoth in order to do the initial ring-quest in Seyda Neen. This has now been cured.

This is a fairly simple mod that basically disables NPCs at various times of the day (mostly night).

Ambiance only. Don't confuse this with the "Living Cities of Vardenfall" mod. It is nowhere near as extensive in scope as that mod is. Difference is that LCoV was never completed (about half the towns were done and several of the Vivec cantons) while this mod encompasses all towns and a all Vivec cantons (plazas and waistworks only).

This mod affects 56 cells on the main island of Morrowind. No NPCs are directly affected (no scripting on the NPCs themselves). The scheduling is accomplised via activators placed in the appropriate cells, so this mod should be safe to remove from a save if you don't care for it.

I did add a few extra guards to watch over the tables of the exterior vendors while they are disabled. They are scheduled to appear when the vendors are disabled, and disable when the vendors are enabled.

Mod should schedule all exterior NPCs on the main island in towns and cities, and also interior NPCs in the Vivec cantons only. I didn't do any of the "walkers" around the Daedric shrines, nor any around the (whatever) stronghold places. House strongholds are not affected either. There are also two couples that are mearly disabled after the completion of their associated quests. One couple outside of Ald-ruhn, and another couple south of Ald Velothi. There were a couple of NPCs that I didn't schedule due to quest involvement. Work-arounds seemed too complicated, so you'll just have to suffer through those... :)

This mod uses LOS (Line Of Sight) to disable the NPCs. CellChanged seemed to me to not work well here under certain circumstances, so on occasion you will see NPCs when they should be disabled, but they will then disable as soon as you loose LOS on them.

Did cursory testing only on this due to it's scope. Same script is used throughout the mod though, so if it works in one cell, it should work in all.

Had a fellow by the name of "harborgolfer" who said he probably wouldn't care for something like this if it sapped his frame rate too bad (already had a lot of mods loaded). He did a test on an earlier version and noted no appreciable fps drop. Same thing I've seen.

I strongly recommend that you download and use LDones "Nighttime Door Locks-LD 1.1a" to enhance the effect. Get it here:

http://www.hiredgoons.net/MWFiles/

Useage:

I'll consider this "modders resource" or template material. If you wish to expand on this or completely redo it, feel free... but be very aware this is TOTALLY tedious stuff... Hopefully the "leg work" has been completed here for someone else to expand on.

Would mention that Max_aka_Nobody has created an excellent tool for scheduling that makes it pretty much a no-brainer (no scripting knowledge necessary). You can find that here:

http://lgnpc.sabregirl.com/JUNK/MWScheduler.zip

(requires VB6 runtime files)

See thread here for details:

http://www.elderscrolls.com/forums/index.php?showtopic=93303

Installation:

Unzip to your "C:\Program Files\Bethesda Softworks\Morrowind\Data Files" folder and then enable on the Morrowind launcer splash screen. Hand placement of the single file is acceptable as well.

Beta for a reason...

If you see any glaring, major errors, please contact me at the Bethesda offical forums (PM), or email me at dot350@abelink.com.

Probably won't do any upgrades of this as the sheer boredom this mod has caused in me has... Well... Let's just say there aren't going to be any upgrades unless major errors are reported (then I'll be about as likely to pull it as fix it...).

Most boring mod I've ever done...


Download NPC Schedules (beta)

from Great House Fliggerty

Download NPC Schedules (beta)
from Emma's Elder Scrolls Site