Jump to content

Variable referring to Base Object


grmblf

Recommended Posts

That is my issue, I want to use RemoveAllEffectItems command on a spell that is determined by script, and I want to use that function for some different spells, so I need to specify the spell through a variable and can't give it directly it's editorID. So I made a var on the quest script (ref spell) but on the function it fails to run 'cause this command, when applied on a spell, needs to refer to the base object. So instead of "RemoveAllEffectItems myquest.spell" I type "RemoveAllEffectItems (getBaseObject myquest.spell)" but it stills failling to find the base object.

 

I've searched the wiki for other commands to achieve it, seeking if there was any other way to refer to a base object without knowing it's name but I've been unsuccesful 'til now so that's why I'm here, hoping some of you could throw in some light.

 

If that approach isn't possible perhaps an OBSE command could let me store a string and compile it afterwards so the engine would read it as an ID instead of a string??

 

I'm really willing to deal with this as this will def save me a lot of time/trouble/space as it would allow me using the same funtion for each spell instead of having one per spell, so really any advise you can provide is greatly appreciated.

 

:thanks:

Link to comment
Share on other sites

Hmmm, I really feel like saying that removealleffectitems should work with a variable, but I looked in some of my mods and apparently I always used the spell's ID. One thing you could try is to set a new variable in your script and make it exactly the same as the one in the quest script, like:

ref spell2
ref spell1;variable from quest

set spell2 to quest.spell1
removealleffectitems spell2

Link to comment
Share on other sites

I can't declare new variables, this functions run from the quest stages result scripts. I've tried to make the variable points to the base object before calling the stage, but the engine doesn't care as it's still stored in a reference variable.
Link to comment
Share on other sites

this functions run from the quest stages result scripts

That might be causing this, since the result script box has many limitations. Try running it from a quest script.

 

I've never had problems with base objects stored in reference variables, so I think it should work.

Link to comment
Share on other sites

That might be causing this, since the result script box has many limitations. Try running it from a quest script.

 

I've never had problems with base objects stored in reference variables, so I think it should work.

Yep, it should be a result script limitation, it worked as expected when called from the quest script. Thanks Argomirr!

 

f*cK I was super happy with my quest stage functions... now I'll have to search for another workaround, ... always searching for worarounds.. that's the modder life :D

 

PS: never cast a spell without effects! It will crash your game.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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