Talk:Magic effect scripts

From the Oblivion ConstructionSet Wiki
Revision as of 14:35, 8 July 2006 by imported>DragoonWraith (some organization, and a quesion about how variables are stored from Magic Effect Scripts)
Jump to navigation Jump to search

Script Abilities

Is it possible to stick a script-effect spell as an ability on someone? And if so, will the scripteffectupdate spell function more or less as a gamemode block? It seems a handy way of jamming scripts onto people who already have one...Talkie Toaster 14:21, 20 April 2006 (EDT)

Yes, I use this method extensively. It works exactly like a normal spell script. ScriptEffectStart and Update process as soon as you add the ability, and scriptEffectFinish runs when you call removeSpell. It's not just useful for magic effects, but is also probably the closest thing to MW-style targeted scripts that we have. Scruggs 16:04, 29 May 2006 (EDT)

Undocumented blocktypes

"Other block types are invalid (they will compile but the code inside them will never run)." - This is almost true. OnActivate will process in a magic effect script, which can be useful but should be used very carefully. Even after the effect ends, the onActivate block will override normal activation, so it's best to use this for permanent scripted abilities.

I found that OnHit, OnHitWith, OnMagicEffectHit, and onDeath will not process in magic effect scripts. A shame since these would be much more useful than OnActivate.

I'd be careful with using undocumented features as long as Oblivion is still updated - Bethsoft might change them on a whim and your mod will no longer work.--JOG 01:20, 20 June 2006 (EDT)

Script Effect Variables

Dragoon Wraith TALK 15:35, 8 July 2006 (EDT): I was wondering, do variables used in magic scripts become variables on the effected object? They seem to run locally (i.e. if you have the script on multiple actors, each one can record its own values for each variable), but can you access them from another script with ActorID.VarName? If not, how can you access them?

Also, if you have two scripted effects on the same actor, can they share variable data? For instance, if the first applied script had a variable "OriHealth" that was set to the Health of the actor when the script was applied, can a second spell cast on the actor also have a variable called "OriHealth", and will it have the same value as the original variable did? I assume that when a spell wears off, the variables are wiped, but what if the first effect is still working when the second one is applied? If the variables aren't the same, is there any way to set the variable in the second script to the value of the first script?

Basically, what I'm trying to do is split up a script that is too long (currently 10,060 lines, though only 70 or so will ever run at a time). An ability is added, does its part, and adds another ability on top of that that continues the script, but it needs to have the data from the first part of the script. Is there any hope?