Scripting Problem

Post » Thu Oct 07, 2010 6:21 pm

Hello, I made a topic not long ago in the Mods section about a mod for vampire which makes helmets protect you from the sun. No one answered so i decided to make on myself.


Here's the script, I'm not so good, I need a script which runs for all types of helmets, Even mods

Here it is

scriptname 0VampireProtection
;; Script by Omber

begin OnEquip

if (PCVampire > 1)
Player.removespell vampsundmg50
Player.removespell vampsundmg75
Player.removespell vampsundmg100
Message "You are now protected from the sun"
endif

end

begin OnUnequip

if (PCVampire == 2)
Player.addspell vampsundmg50
Message "Your are exposed to the sun"
elseif (PCVampire == 3)
Player.addspell vampsundmg75
Message "You are exposed to the sun."
elseif (PCVampire == 4)
Player.addspell vampsundmg100
Message "You are exposed to the sun."
endif

end

Could anyone explain what i should do after this point ? This is on of my first scripts and a friend helped me abit,
User avatar
Lakyn Ellery
 
Posts: 3447
Joined: Sat Jan 27, 2007 1:02 pm

Post » Thu Oct 07, 2010 10:21 pm

That script needs to be placed on the helmets/hoods themselves. No way to do that for every mod added item.

What you'll need is a quest script that monitors when the player has something equipped in their head slot, and removes/adds the spells as required.

You'll need to use "GetEquippedObject 0", "GetEquippedObject 1" and "GetEquipmentSlotMask 3" to cover "head" "hair" and "both head and hair" (third is unlikely, but possible).
User avatar
Je suis
 
Posts: 3350
Joined: Sat Mar 17, 2007 7:44 pm

Post » Thu Oct 07, 2010 4:47 pm

I imagine that is with Oblivion Script Extender ?
User avatar
Leanne Molloy
 
Posts: 3342
Joined: Sat Sep 02, 2006 1:09 am

Post » Fri Oct 08, 2010 12:05 am

Yeah. I don't know if there's a way to check for "any" item in the head slot without OBSE.

Maybe someone has come with an answer to that one.
User avatar
Manuel rivera
 
Posts: 3395
Joined: Mon Sep 10, 2007 4:12 pm


Return to IV - Oblivion