Post by Emma on Aug 23, 2010 7:16:32 GMT
Companion Project ver 1.3 - by Grumpy
A companion "template" that can be used as is, or to build your own.
Tribunal required
TRIBUNAL ONLY!!!
Download
New version 1.3
Not much new.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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).)
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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).)
--------------------------------------------------------------------------------
A companion "template" that can be used as is, or to build your own.
Tribunal required
TRIBUNAL ONLY!!!
Download
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. - Use melee- Will only use melee weapons (swords, etc.)
--------------------------------------------------------------------------------
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