Newbi'ish scripting issue

Post » Sat Jan 29, 2011 6:54 pm

I have been trying to work this out with out much success and I'm surprised that I can't find anything on it...

basically I'm making a small staff/weapon mod, and I wanted to have it cast magic like a staff can and give the holder a constant effect...
making the enchantment to cast at a target part is easy, but as you can only have 1 enchantment on a weapon and that the constant effect enchantments need to go on apparel I thought I'd just whip up a script for it...
I have used the "player.ModActorValue" for changing a few a attributes while holding the staff but I wanted to have thing's like "restore magicka" and "weakness to normal weapons" as constant effects to.

now I notice that "player.addspell" only works for spells (obviously) so is there a script command for adding a full enchantment?
or will I need to add each one directly into the script like "player.ModActorValue" command for the attributes, and if so what is the command for adding an effect?

in total I want to add;
-Restore Magicka
-Resist Disease
-Spell Absorption
-Weakness to Normal Weapons
all as constant effects alongside the staff enchantment that's already on the staff and that works like a normal staff enchantment.

Thanx for any help, I'm sure it's obvious... but I can't see it :)
User avatar
Jerry Cox
 
Posts: 3409
Joined: Wed Oct 10, 2007 1:21 pm

Post » Sat Jan 29, 2011 1:53 pm

Possibly you can add an object script to the staff.

begin onequip player
player.addspellNS staffpowers
end

begin onunequip player
player.removespellNS staffpowers
end

Where staffpowers is an ability. You create the spell with the Restore Magicka, Resist Disease, etc., but select the type as an 'Ability' (top of list).
User avatar
emily grieve
 
Posts: 3408
Joined: Thu Jun 22, 2006 11:55 pm

Post » Sat Jan 29, 2011 9:29 am

Thanx ThumperZ, I did not realise that the ability's spells would function as constant effects, I think that has done the trick, looks like it on first test.
not sure about "addspellNS" I keep getting told by the CS that it's not a recognised function... the normal addspell seems to work fine though.
just need to set it up as a viewable effect now, even though I can see the ability spell is working there is nothing about it in the menu... but thats easy enough to do.

Thanx again.
User avatar
loste juliana
 
Posts: 3417
Joined: Sun Mar 18, 2007 7:37 pm

Post » Sat Jan 29, 2011 11:56 pm

AddSpellNS is an http://cs.elderscrolls.com/constwiki/index.php/AddSpellNS function. You might want to install OBSE - there may be some functions in there that will help with what you're trying to do, as ThumperZ suggested.
User avatar
Lil'.KiiDD
 
Posts: 3566
Joined: Mon Nov 26, 2007 11:41 am

Post » Sat Jan 29, 2011 5:07 pm

Yea, sorry about the '-NS' functions I'm so used to using OBSE I forget about the base functions. Anyway the '-NS' is for NoSpam, so every time you equip/unequip the staff you don't get a message on screen.
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am


Return to IV - Oblivion