Jump to content

Scripting problems


exesinxmyxalias

Recommended Posts

I'm writing a script for a set of armor that only has enchantments while the player is in Oblivion.

 

This is what the script looks like

 

scn 0eximagcabootsenchant

Begin ScriptEffectUpdate

if ( GetIsCurrentWeather OblivionDefault || GetIsCurrentWeather OblivionMountainFog || GetIsCurrentWeather OblivionSigil || GetIsCurrentWeather OblivionStormOblivion )


  if ( IsSpellTarget 0eximagcaboots == 0 )
	 AddSpell 0eximagcabootsscript
  endif

  else

  if ( IsSpellTarget 0eximagcaboots )
	 RemoveSpell 0eximagcabootsscript
  endif
  endif

end

Begin ScriptEffectFinish

  RemoveSpell 0eximagcabootsscript

end

 

 

Yes, I'm aware that my spells have 'script' on the end of them instead of 'spell', but that's what happens when I'm up late working on stuff.

 

Anyway, I tried to save the script and I got an error message for line 8 saying that "Magic item '0eximagcaboots' invalid parameter for magic item" or something along those lines.

 

What am I doing wrong here?

Link to comment
Share on other sites

The item '0eximagcaboots' isn't being detected as the spell target.

You would be better running a global script to detect when the player is wearing the armor, and adding the spell when you enter Oblivion. If you add a script to each piece of the armor that affects a custom global value (IsWearingBoots, IsWearingCuirass, IsWearingHelm etc), and a quest script that detects when you're in Oblivion AND wearing the armor by using the custom globals (If IsWearingCuirass == 1).

Link to comment
Share on other sites

I'm writing a script for a set of armor that only has enchantments while the player is in Oblivion.

 

This is what the script looks like

 

scn 0eximagcabootsenchant

Begin ScriptEffectUpdate

if ( GetIsCurrentWeather OblivionDefault || GetIsCurrentWeather OblivionMountainFog || GetIsCurrentWeather OblivionSigil || GetIsCurrentWeather OblivionStormOblivion )


  if ( IsSpellTarget 0eximagcaboots == 0 )
	 AddSpell 0eximagcabootsscript
  endif

  else

  if ( IsSpellTarget 0eximagcaboots )
	 RemoveSpell 0eximagcabootsscript
  endif
  endif

end

Begin ScriptEffectFinish

  RemoveSpell 0eximagcabootsscript

end

 

 

Yes, I'm aware that my spells have 'script' on the end of them instead of 'spell', but that's what happens when I'm up late working on stuff.

 

Anyway, I tried to save the script and I got an error message for line 8 saying that "Magic item '0eximagcaboots' invalid parameter for magic item" or something along those lines.

 

What am I doing wrong here?

Use the form ID instead of the editor ID. Additionally, Editor ID's that begin with numbers are a bad idea since many functions do not recognize them. You should ALWAYS begin a definition with a few letters.

Link to comment
Share on other sites

starting them off with numbers makes them easier to find as they show up at the top of the list and has not caused me a problem so far. so use the form id for the spells and stuff?

 

I'm new to the whole scripting thing. I'm actually lucky I got this far. Does anyone have an example of what it should look like?

Link to comment
Share on other sites

starting them off with numbers makes them easier to find as they show up at the top of the list and has not caused me a problem so far. so use the form id for the spells and stuff?

 

I'm new to the whole scripting thing. I'm actually lucky I got this far. Does anyone have an example of what it should look like?

Yeah, it makes them easier to find, but causes problems like this.

 

But, believe the issue here is that you are using a script on an enchantment. Scripted effects don't work on constant effect enchantments. So azir's advice was also part of solving this problem.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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