Jump to content

Help With Companion Mod


Fang989

Recommended Posts

Not used to posting in these forums, so if this is in the wrong place I am sorry.

 

I am creating a follower for personal use, I may release it at a later date, but I am in need of some assistance with scripting.

I need to create it so that my follower levels up along side me, so that when I level up they level up.

 

After reading about on some tutorials on creating followers it was stated that one could make it so that your custom follower would level up alongside you but would require some scripting.

 

I would be grateful if someone could link me to a tutorial that shows how to do this or if you could tell me how to do it.

Link to comment
Share on other sites

Open your NPC go to the stats tab, set the minimum level your NPC can be as well as the max level they can be and check the box PC Level Mult

Link to comment
Share on other sites

You could try PC leveloffset, and set the difference to 0, that way it will always be the same level.

If you want to try scripting though, one of my doggie mods had some code to do that, sadly the attributes don't affect creatures too much, but here they might help a bit....though I won't lie, its an old dusty code, and it needs some serious tweaking. So I gave it a bit of thought, and heres what I got, the code might need some proof-reading though.

 

First create an ability, this is a leveling ability, and will be the growth of your character, for this example, I'm thinking a Barbarian character.

 

AbLVBonus

-Fortify HP +10

-Fortify Str + 4

-Fortify End + 2

- Fortify Int + 1

-Fortify Wil + 1

-Fortify Spd + 1

-Fortify Agi + 1

 

Scn "SomePrefixSoYoucanFindthecode""Yourpartnersname"'s leveling script

-Have it set to a Magic Effect Script, for it will be an ability, allowing your NPC access to other scripts. :wink:

 

ref Self

short PCLevel

short PCOldLevel

short MyStrength

 

Begin Gamemode

 

Set PCLevel to getlevel Player

 

// Checks to see if the player grew a level, and if he/she has, add the ability.

if PCLevel > PCOldLevel

Set PCOldLevel to PCLevel

AddSpell AbLvBonus

endif

 

endif

 

End

 

Just plug in that script to an ability, and plop it in your character.

 

Now, you can have some fun with this -

Okay, Lets face it just leveling up is boring - you want your character to have some spice - a bit of zest. So, at certain levels, you can add abilities!

 

Let's add a few more variables:

 

short MyLevel

short Skill1Level

short Skill1Owned

 

In the game mode block:

 

Set MyLevel to GetLevel

Set Skill1Level to 5

 

If MyLevel == Skill1Level && Skill1Owned == 0

Addspell "Skill 1 ability"

Set Skill1Owned to 1

// Okay, now the barbarian has the skill, and its been checked off so it won't just keep giving it to him, now lets let the player know. But only if he's hired!

if "he's hired variable, check, etc." == 1

MessageBox "Dennis has marinated in the blood of his enemies for long enough and has gained an extra layer of dried blood for skin granting him a +5% bonus against melee"

End

Edited by scarycave
Link to comment
Share on other sites

Waaaiiiit..... I'm pretty sure the whole "leveling NPCs not leveling with player after meeting player for the first time" was solved in a Beth patch some time ago. In which case, you would only need to use PCleveloffset like Scott and Scary described. Unless I missuderstood something at some point. Which is an ever-present possibility......

 

I love the idea of giving a follower abilities a certain levels, though. I want to try that!

 

But oh man, I also have a custom follower who levels. Now I'm all paranoid that I didn't do it right. ._.

Link to comment
Share on other sites

Open your NPC go to the stats tab, set the minimum level your NPC can be as well as the max level they can be and check the box PC Level Mult

I was meaning more of a dynamic levelling, for instance;

If I and my copanion are level 5 and l level to level 6, then my companion would level to level 6. If I then leveled to level 7 my companion would do so too. If I then unlocked a new ability, when applying skill points, my companion would unlock a new one too.

You could try PC leveloffset, and set the difference to 0, that way it will always be the same level.

If you want to try scripting though, one of my doggie mods had some code to do that, sadly the attributes don't affect creatures too much, but here they might help a bit....though I won't lie, its an old dusty code, and it needs some serious tweaking. So I gave it a bit of thought, and heres what I got, the code might need some proof-reading though.

 

First create an ability, this is a leveling ability, and will be the growth of your character, for this example, I'm thinking a Barbarian character.

 

AbLVBonus

-Fortify HP +10

-Fortify Str + 4

-Fortify End + 2

- Fortify Int + 1

-Fortify Wil + 1

-Fortify Spd + 1

-Fortify Agi + 1

 

Scn "SomePrefixSoYoucanFindthecode""Yourpartnersname"'s leveling script

-Have it set to a Magic Effect Script, for it will be an ability, allowing your NPC access to other scripts. :wink:

 

ref Self

short PCLevel

short PCOldLevel

short MyStrength

 

Begin Gamemode

 

Set PCLevel to getlevel Player

 

// Checks to see if the player grew a level, and if he/she has, add the ability.

if PCLevel > PCOldLevel

Set PCOldLevel to PCLevel

AddSpell AbLvBonus

endif

 

endif

 

End

 

Just plug in that script to an ability, and plop it in your character.

 

Now, you can have some fun with this -

Okay, Lets face it just leveling up is boring - you want your character to have some spice - a bit of zest. So, at certain levels, you can add abilities!

 

Let's add a few more variables:

 

short MyLevel

short Skill1Level

short Skill1Owned

 

In the game mode block:

 

Set MyLevel to GetLevel

Set Skill1Level to 5

 

If MyLevel == Skill1Level && Skill1Owned == 0

Addspell "Skill 1 ability"

Set Skill1Owned to 1

// Okay, now the barbarian has the skill, and its been checked off so it won't just keep giving it to him, now lets let the player know. But only if he's hired!

if "he's hired variable, check, etc." == 1

MessageBox "Dennis has marinated in the blood of his enemies for long enough and has gained an extra layer of dried blood for skin granting him a +5% bonus against melee"

End

Thank you, this really helps, I will see how this goes and let you know. ^.^

 

Also I would like to use Serana's ai package, from Dawnguard, but I am unsure of which one it is as there are multiple files;

- DLC1SeranaSandboxInHQ

- DLC1SeranaSandboxInCastle

- DLC1SeranaStartInCoffin

 

Which one of those packages do I use for my companion?

Link to comment
Share on other sites

I wouldn't know about packaging for Skyrim since I only have Oblivion - I actually thought this was an Oblivion topic. XD

The code should still work fine though.

 

If your using a package though, it would be better to create your own - if she's a quest npc, I'm certain you may run into trouble with two entities trying to use the same furniture, bed, or other things.

You should open up her packages and take a look. It's like a personal life schedule. When she wakes up, goes to bed, etc. and at what time.

 

So, I don't know if you've done this before but to be safe - I know some things that should be very similar if not exact.

There are several package types, a package can only have one.

You'll definitly need a follow, wait(or guard), sandbox package.

 

You'll also need to make a way to check the npc should do. A simple way is to create a "faction", instead of checking love/hate relationships, the faction will be sort of like a global variable but for personal use to the npc(s).

 

Faction - FollowerComFaction

0 - (a dummy slot if you want the npc to do stuff before being hired or after like quest only packages)

1- Follow

2 -Wait

3-Sandbox

 

You can change the faction during dialouge by adding some code in your quest. You'll need to make the follower a ref, and name it something that your absolutely sure you won't change. (You can rename it - but its a total pain in the butt)

Also be aware deleting your character will delete the refrence. You need to plan ahead where its going to be.

 

Now for a package, create one, put it to follow, and set it up.

This is pretty simple, just make sure the target refrence is you, the player, and make sure you don't let her get to close by adjusting her distance, you can always create another package to make a follow_close, and follow_far package with

a little tweaking of your own.

 

Now for a package, create one, put it to guard, and set it up.

Now, add a condition such as if "Follower".getfactionrank FollowerComFaction == 2

Now, I'm still abit fuzzy with how guard works out, since my Fallout 3 Companions will run back to their start position. In general though, you'll want the follower to wait around the current spot. For personal taste, I'll give them a bit of a radius - standing still gets boring right? You'll want to make your follower stick out. If your going for a rebellious teen-ager follower or a hyperactive one, give them a fairly sized radius so you may have to look for them but they shouldn't be far. If its a soldier or something strict, have them wait on the spot to show their loyalty. It's a minor thing, but there's so many companion mods out there (for Oblivion anyways) little things like that can help them stand out - and I have no idea why I haven't done this before myself.

 

Now for a package, create one, put it to sandbox, and set it up. Check what you want her to do, how far she can walk around. Most importantly, where she should be doing all this.

Now, add a condition such as if "Follower".getfactionrank FollowerComFaction == 3

 

If you've done everything right, just plop them in and she should work though you should do some serious testing to ensure this.

 

If you don't want to worry about factions and refs, simply create a global variable for the follower (since its only one follower, one global couldn't hurt, I would still recommend the faction set up if your making multiple companions):

That way, you can delete, and place her as much as you'd like (though you should only leave one in game of course).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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