[Findings] Active Effects on Actors

Post » Fri Sep 18, 2009 9:43 am

I did some testing on how temporary active effects are evaluated on actors and figured I'd post my findings here. Here's what I found out :
  • Active effects are processed when the actor's AI is processed
  • Active effects are not nerfed( or removed ) on changing cells. Nor is their duration ( elapsed/remaining ) changed. They stop when the should. The time spent outside the parent cell is deducted from the remaining time on re-entering the cell.
  • Script effects will have their variables reset and "destroyed" however; as in, the value of the variables can't be modified ( at least not with set ). The rest of the script will continue to process normally, with the above changes taken into consideration.
Tested on actors with low level-processing enabled and otherwise. Apparently, it holds true for both. Persistence through a cell reset :
  • If the cell is unloaded from memory, the active effects are removed instantaneously. If the cell is loaded in memory and reset meanwhile ( forced from a script ), the active effects persist and the above results hold good.
  • Any script effects will execute their Finish blocks in the same frame as the full cell reset's.
A quest script's timer was used for checking the durations, that was started with the spell effect. The scripted effect had it's own timer. The scriptEffectFinish block printed both the results. The difference b'ween the two was negligible ( the script effect timer equals to the exact duration of the effect while the quest script timer is slightly off, with a error range of +/- 0.5, and that too only in extreme cases - Attributed to the difference of the values returned by scriptEffectElapsedSeconds and getSecondsPassed ). Tested using potions and spells - Yielded the same effect.

Comments are welcome.
User avatar
Alycia Leann grace
 
Posts: 3539
Joined: Tue Jun 26, 2007 10:07 pm

Post » Fri Sep 18, 2009 8:20 am

I did some testing on how temporary active effects are evaluated on actors and figured I'd post my findings here. Here's what I found out :
  • Active effects are processed when the actor's AI is processed
  • Active effects are not nerfed( or removed ) on changing cells. Nor is their duration ( elapsed/remaining ) changed. They stop when the should. The time spent outside the parent cell is deducted from the remaining time on re-entering the cell.
  • Script effects will have their variables reset and "destroyed" however; as in, the value of the variables can't be modified ( at least not with set ). The rest of the script will continue to process normally, with the above changes taken into consideration.
Tested on actors with low level-processing enabled and otherwise. Apparently, it holds true for both. Persistence through a cell reset :
  • If the cell is unloaded from memory, the active effects are removed instantaneously. If the cell is loaded in memory and reset meanwhile ( forced from a script ), the active effects persist and the above results hold good.
  • Any script effects will execute their Finish blocks in the same frame as the full cell reset's.
A quest script's timer was used for checking the durations, that was started with the spell effect. The scripted effect had it's own timer. The scriptEffectFinish block printed both the results. The difference b'ween the two was negligible ( the script effect timer equals to the exact duration of the effect while the quest script timer is slightly off, with a error range of +/- 0.5, and that too only in extreme cases - Attributed to the difference of the values returned by scriptEffectElapsedSeconds and getSecondsPassed ). Tested using potions and spells - Yielded the same effect.

Comments are welcome.


Nice, thanks ShadeMe for the detailed report.

Few question here: how does an scripted ability acts on cell changing? I've read somewhere on the wiki that script's local variables are reset(and/or even the ability is 'recast') when an actor enters a cell 'occupied' by the player... Does that include changing exteriors cells also?

The wiki also mentioned that same thing can happen to the player when he switches cells(I've never experienced that, although I use abilities quite a lot, I haven't experienced anything like that...). Could you confirm that?

One more thing: when an ability is added to an actor, it is also added to all clones of that actor(all that are spawned after that, right?). If it is a short term ability, then there should be no problem, as the ability should remove itself(or be removed) after it does it's job. The thing that intrigues me is: what will happen if an actor dies before the ability is removed? Of course the scripteffectfinish block will run, but still the base actor will hold the ability...
(The last one is more a statement that a question, but I realised that dependancy when I was writing that sentence ;) )

cheers,
brucevayne
User avatar
Chris Johnston
 
Posts: 3392
Joined: Fri Jul 07, 2006 12:40 pm

Post » Fri Sep 18, 2009 1:57 pm

Good job :tops:
Just some clarifications - for the still confused :
  • The time spent outside the parent cell is deducted from the remaining time on re-entering the cell.
Parent=player cell? Or editor location of actor ? Did you apply the effects via script on persistent actors in a remote cell then moved them in another cell and back ? confused :)

  • Script effects will have their variables reset and "destroyed" however; as in, the value of the variables can't be modified ( at least not with set ).
You mean on cell change ?

The rest of the script will continue to process normally, with the above changes taken into consideration.
Meaning with variables reset - not good

Tested on actors with low level-processing enabled and otherwise. Apparently, it holds true for both.
Strange

  • If the cell is unloaded from memory, the active effects are removed instantaneously. If the cell is loaded in memory and reset meanwhile ( forced from a script ), the active effects persist and the above results hold good.
  • Any script effects will execute their Finish blocks in the same frame as the full cell reset's.
Again haven't quite understood - player/actor in same cell - fast travel player (cell unloaded - scripteffectfinish run = active effect removed).
Player/actor in same cell - player goes to neighboring cell via door - original cell still loaded, reset (via script) - active effect duration good script effect variables reset etc ?
User avatar
GEo LIme
 
Posts: 3304
Joined: Wed Oct 03, 2007 7:18 pm

Post » Fri Sep 18, 2009 1:32 pm

Nice, thanks ShadeMe for the detailed report.

Few question here: how does an scripted ability acts on cell changing? I've read somewhere on the wiki that script's local variables are reset(and/or even the ability is 'recast') when an actor enters a cell 'occupied' by the player... Does that include changing exteriors cells also?
No, thank you - A few more months and this thread would have been purged :D

My tests only involved temporary active effects, i.e., those with a valid duration. So I cannot tell for certain how this may reflect on abilities and diseases. Be that as it may, I think point #3 holds good for abilities/diseases too - I vaguely recall experiencing issues caused by the reset. I'm fairly certain that point #2 remains true for exterior cells as well.

The wiki also mentioned that same thing can happen to the player when he switches cells(I've never experienced that, although I use abilities quite a lot, I haven't experienced anything like that...). Could you confirm that?
Would you be talking about the variable reset phenomenon here ? If yes, yes - I believe point #3 tells you just that.

One more thing: when an ability is added to an actor, it is also added to all clones of that actor(all that are spawned after that, right?). If it is a short term ability, then there should be no problem, as the ability should remove itself(or be removed) after it does it's job. The thing that intrigues me is: what will happen if an actor dies before the ability is removed? Of course the scripteffectfinish block will run, but still the base actor will hold the ability...
(The last one is more a statement that a question, but I realised that dependancy when I was writing that sentence ;) )
An addSpell call adds its parameter to the actor's base record - From that point on every instance of that actor gets the spell. Actor death changes nothing. You can still call rDeadActor.removeSpell SpellID.

By the way, where is this wiki article you cite ?
User avatar
James Hate
 
Posts: 3531
Joined: Sun Jun 24, 2007 5:55 am

Post » Fri Sep 18, 2009 2:25 am

Just some clarifications - for the still confused :
Parent=player cell? Or editor location of actor ? Did you apply the effects via script on persistent actors in a remote cell then moved them in another cell and back ? confused :)
Parent cell = The cell our testbed actor is in. Cell transitions were mechanical, meaning I exited and entered the cell manually. Effects were applied when the player was in the same cell as the NPC.

You mean on cell change ?
Yes.

Meaning with variables reset - not good
Yes.

Again haven't quite understood - player/actor in same cell - fast travel player (cell unloaded - scripteffectfinish run = active effect removed).
Player/actor in same cell - player goes to neighboring cell via door - original cell still loaded, reset (via script) - active effect duration good script effect variables reset etc ?
Fast-travel != Source cell unloaded; it remains in memory until the engine's memory manager unloads it ( or a pcb call is processed ).
User avatar
Ebou Suso
 
Posts: 3604
Joined: Thu May 03, 2007 5:28 am

Post » Fri Sep 18, 2009 12:53 am

Charming :)
Fast-travel != Source cell unloaded; it remains in memory until the engine's memory manager unloads it ( or a pcb call is processed ).
Got this from the http://cs.elderscrolls.com/constwiki/index.php/Loaded - a bit unclear syntax - search for fast-travel.

Vielen Dank :foodndrink:

PS then probably one should manipulate quest variables in the script effects script - set MyEffectQUEST.var to...
Good to know.
User avatar
Holli Dillon
 
Posts: 3397
Joined: Wed Jun 21, 2006 4:54 am

Post » Fri Sep 18, 2009 4:17 am

No, thank you - A few more months and this thread would have been purged :D


You're welcome :D

By the way, where is this wiki article you cite ?

1.
http://cs.elderscrolls.com/constwiki/index.php/Programmable_Spell_Effects
in the 'Permanent Spell Effects' section;

2.
http://cs.elderscrolls.com/constwiki/index.php/Unplayable_Items
'Properties of unplayable items' section, point #3

As for changing exterior cells: does the 'variable reset' phenomenon also occurs when an actor is simply walking from one cell to another, (both of them are loaded) in a presence of a player(which remains in one of those cells)?

cheers,
brucevayne
User avatar
Zualett
 
Posts: 3567
Joined: Mon Aug 20, 2007 6:36 pm

Post » Thu Sep 17, 2009 11:35 pm

As for changing exterior cells: does the 'variable reset' phenomenon also occurs when an actor is simply walking from one cell to another, (both of them are loaded) in a presence of a player(which remains in one of those cells)?

cheers,
brucevayne
I don't think I evaluated that contingency. At least not that I recall of.
User avatar
Jack
 
Posts: 3483
Joined: Sat Oct 20, 2007 8:08 am


Return to IV - Oblivion