Jump to content

Need a little experienced modder backup on a simple script


tenth88sphere

Recommended Posts

I am currently using Kiyoshi's Vampire Mod, and wanted to alter an item in game to provide sun protection to my vampire. I haven't decided which yet, and it probably doesn't matter since I believe what will accomplish the change is the script. So I'm just trying to get a working script, then I can apply that to any item I want (ie, a shrine quest armor, or random helmet.)

 

To make the mod I took Jaysus' mod which has a hood that protects from normal sunlight. The script he uses is:

 

------------------

 

scriptname vampsuncover

 

begin OnEquip

 

if (PCVampire > 1)

Player.removespell vampsun50

Player.removespell vampsun75

Player.removespell vampsun100

MessageBox "Dont fear the sun. You are well covered."

endif

 

end

 

begin OnUnequip

 

if (PCVampire == 2)

Player.addspell vampsun50

MessageBox "Look out for the sun."

elseif (PCVampire == 3)

Player.addspell vampsun75

MessageBox "Fear the sun. You are not covered."

elseif (PCVampire == 4)

Player.addspell vampsun100

MessageBox "Dont even think to come near daylight."

endif

 

end

 

----------------------

 

Now, this won't work because I use Kiyoshi's mod. So I looked up in Kiyoshi's mod and it appears his spell for sun damage is called KIVampSunDamage01, KiVampSunDamage02, and KIVampSunDamage03.

 

Also, I don't understand how KI handles his vampire stages, so I figure I'll simplify the script and just have it ignore the stages, give me protection when on, weakness when off. So I write this:

 

-----

 

scriptname vampsuncover

 

begin OnEquip

 

Player.removespell KIVampSunDamage01

Player.removespell KIVampSunDamage02

Player.removespell KIVampSunDamage03

 

end

 

begin OnUnequip

 

Player.addspell KIVampSunDamage03

 

end

 

----

 

But it doesn't work. I'm only moderatly familiar with the modding, so don't assume I'm competent. All I clicked was save, I didn't compile or anything (I thought I wasn't supposed to recompile all). My problem could be at any stage - but as far as I can tell, I thought that script should work.

 

Anyone with know-how would be appreciated to turn me the right way.

 

Thanks!

Link to comment
Share on other sites

Part of the problem is that usually, one .esp cannot reference or change anything which is contained in another .esp. You aren't adding or removing the sun damage effects because as far as the .esp which contains that piece of equipment is concerned, those effects do not exist. This is why it won't save, and why it wouldn't work even if it did.

 

The reason why you might not be getting errors is because you made the horrible mistake of clicking "yes to all" when one error popped up. In the CS, unlike with virtually everything else, most of the errors you get are usually important, and shouldn't be ignored (unless you are closing the CS at the time).

 

The solution to this would be to re-create that item and the scripting within the vampirism mod. While this also means that you won't be able to share that mod, it allows you to achieve the desired functionality.

 

The alternative would likely involve deisolation, which can be rather complicated, or quite a bit of OBSE scripting to track down what ability is causing a sun damage effect, record the ID of that ability, and remove that ability from the player to be added later.

Link to comment
Share on other sites

Vagrant0,

 

Ok, this doesn't sound too bad. I'm not actually trying to use Jaysus' hood, just the script. That should be transferrable between any mods, as long as it doesn't reference absent things, right?

 

So what I'll do is open only Kiyoshi's and add a hood with the properties somewhere I can find it in-game.

 

The script itself, as far as you can tell, should work though?

Link to comment
Share on other sites

All right, at the moment I just applied the script to the Arch-Mage's hood and it appears to work!

 

It's not as big of an issue, but is there a way to keep the blinding light effect? It seems this is tied to the sun damage attribute in magic spells. Is there another spell effect that simply does the blinding light effect for the sun without the damage?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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