Jump to content

Add to Faction help


eleglas

Recommended Posts

Hi, I'm trying to make a new spell that will add NPC's to the Player faction as allies, I call it Confession; yes, I LOVE Legend of the Seeker, if you've ever seen it you'll know what I mean.

 

Now I'm not sure how to script this so I need some help with that, and I would also like to add an AI package that causes the victim to follow me around too, not sure how to script this either, I could really use some help.

 

I have scripted Fallout 3 alot and could do it through GECK easily, but Oblivion Construction Kit is different and needs different code.

 

Thanks guys.

Link to comment
Share on other sites

The spell would, of course, contain a spell-script or a MagicEffectScript

It can be set at the upper right corner in the script-editor, where it usually says: 'Object'. Change that to Magic Effect.

The way to add the script to the spell is to add the effect: 'Script effect' at the spell editor window.

You could mimic some other effects as well, as it will sometimes replace the script effect icon. Which is quite nice to have.

 

The spell should contain AddScriptPackage. That hasn't got anything to do with scripts, just the fact you're forcing a package to an actor inside a script.

The useful thing about spells it is that they don't need a reference. As the one that is effected by the spell will be the reference.

So you could simply add: AddScriptPackage 'yourpackage'.

The package would have to be set to follow at the top, with the player as target. Take a look at similar packages if you need reference. Don't forget to click the 'Must Complete', or the package will be skipped during a reevaluation.

 

Adding the npc to the player faction is as simple as adding an item. Using SetFactionRank, which explains itself quite well.

 

The script would contains something like the following, I haven't got any time to test it though.

It would be useful to rule out anything else you don't want, perhaps creatures or some characters.

To give a small idea, if you didn't read about the BeginBlocks yet. The spellscript can only contain 3 blocks.

ScriptEffect-Start/Update/Finish

The first and the last run once when in time. When you've set the time at 0 at the spell.

It will run them both simultaneously, right after each other. If you have set the spell like 20. You can use scriptEffectUpdate for each second using ScriptEffectElapsedSeconds. Each second can only be run once as well. As does the whole script.

 

Here is what it basically should contain, the addscriptpackage and the factionrank-change when needed :

 

scn myspellscript

Begin ScriptEffectStart
AddScriptPackage myfollowpackage
If GetFactionRank PlayerFaction < 0
	SetFactionRank PlayerFaction 0
endif
End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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