Jump to content

Switching out items?


DaveSpins

Recommended Posts

Hey all, I'm back again, with another problem you most likely consider so easy a caveman could do it. However, it is a problem. I have one necklace with the ID TMsoulChainP and another as TMsoulChain; both of which have the in-game name Soul Chain. TMsoulChainP has a custom enchantment that paralyzes whomever wears it. I haven't found a way for this to only last five seconds, so I figured I would set up another Soul Chain object and make a script which switches the two. I wrote the script, and it seems okay to me. However, when I run the game the player simply goes kaput when the Soul Chain is equipped, and stays like that. I was wondering, are the objects even switching? And if they are, is the enchantment on TMsoulChainP staying attached to the player, and how do I remove it? Here's the script (The script is attached to the TMsoulChainP and the properties are attached to their respectively named objects):

 

Scriptname _SwitchChain_ extends ObjectReference  
{Switches between SoulChainP and SoulChain}

Armor Property SoulChainP  Auto  
{Enchanted Chain}

Armor Property SoulChain  Auto  
{Normal Chain}

Enchantment Property Paralysis  Auto  

Event OnEquipped(Actor akActor)
if akActor == Game.GetPlayer()
	Utility.Wait(5.00)
		Game.GetPlayer().AddItem(SoulChain, 1, true)
		Game.GetPlayer().UnequipItem(SoulChainP, true)
		Game.GetPlayer().EquipItem(SoulChain, true, true)
		Game.GetPlayer().RemoveItem(SoulChainP, 1, true)
		
endIf
endEvent

 

 

Oh, and I had the Enchantment property set up from when I was trying to find a way to remove the effect. No luck in my searches, though :wallbash:

Edited by DaveSpins
Link to comment
Share on other sites

You can script better than me but I thought the process for something like that would be remove TMsoulChainP from inventory, and add TMsoulChain to inventory and equip it. rather than swap them while they are equipped or both in inventory. Edited by jet4571
Link to comment
Share on other sites

Just tried switching the order, still to no avail. It isn't switching at all. I know now it isn't the enchantment staying in effect though, I set the TMSoulChainP as able to be unequipped, and once I did he stood up! Also, the Soul Chain is added and equipped and part of a script that transports the player to another location, could that be part of my problem?
Link to comment
Share on other sites

Does Dispel() work on enchantments? Maybe you could simply dispel the effect after 5 seconds, rather than playing switcheroo with different necklaces. Alternatively, you can usually specify an effect's duration in the Ability/Spell/(enchantment?) form. Otherwise, it shouldn't be too hard to create a new paralysis spell with a 5 second duration, rather than use a script, I would think.
Link to comment
Share on other sites

Does Dispel() work on enchantments? Maybe you could simply dispel the effect after 5 seconds, rather than playing switcheroo with different necklaces. Alternatively, you can usually specify an effect's duration in the Ability/Spell/(enchantment?) form. Otherwise, it shouldn't be too hard to create a new paralysis spell with a 5 second duration, rather than use a script, I would think.

 

I'll try the Dispel() a little later (I'm in school, and suddenly booting up Skyrim is kind of a no no, even if it is for as grand a purpose as mod-testing). However, I did try to set the duration for 5 seconds in the beginnning. And the enchantment SAYS it only lasts five seconds, and in the game the effect on the necklace literally reads as "Special paralyze 5 seconds" (more or less). However, it keeps going. And going. And going. Btw, I enjoyed the disease tutorial you wrote for the "Vampire/Werewolf Hybrid Disease" guy. It's sitting on my desktop now :thumbsup:

Link to comment
Share on other sites

Change the enchantment's magic effect to a script archetype. Attach this script to it:

 

Scriptname ExampleMEScript extends ActiveMagicEffect

Spell Property Paralyze5SecsOnSelf Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
Paralyze5SecsOnSelf.Cast(akTarget)
EndEvent

Link to comment
Share on other sites

Sire, when I first saw this I felt like an idiot. It makes perfect sense to do that instead of messing with enchantments and constant effects. Thank you, and sorry it took so long to reply, I've been working on another project the past week.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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