Detecting Intervention

Post » Thu Feb 04, 2010 12:52 pm

I have a global script that I'm trying to use to detect teleportation spells. Here is the relevant section:

	if ( teleporting == 1 )		if ( GetEffect sEffectDivineIntervention == 0 )			if ( GetEffect sEffectAlmsiviIntervention == 0 )				if ( GetEffect sEffectRecall == 0 )					set teleporting to 0					set mwa_stat_teleports to ( mwa_stat_teleports + 1 )				endif			endif		endif	elseif ( GetEffect sEffectDivineIntervention == 1 )		set teleporting to 1	elseif ( GetEffect sEffectAlmsiviIntervention == 1 )		set teleporting to 1	elseif ( GetEffect sEffectRecall == 1 )		set teleporting to 1	endif


The problem is, mwa_stat_teleports is never increased... in other words, it seems the game can't detect Almsivi Intervention, Divine Intervention or Recall.

Does anyone else know if this is the case, or how I can get this working?

Thanks,

- Danjb
User avatar
Chad Holloway
 
Posts: 3388
Joined: Wed Nov 21, 2007 5:21 am

Post » Thu Feb 04, 2010 2:16 pm

The first thing that comes to mind is that the script is global and not on a calling object. Fix the player to the condition and see if that works. If it still doesn't work, then you may be correct that GetEffect or GetSpellEffect will not work on teleportation spells since the effect may be too short for the game to detect. If this is the case the only thing I can think of is to alter the spell files with the addition of a dummy spell with a greater duration than 1, and use GetSpellEffect to detect the dummy effect. Does that make any sense?
User avatar
Guy Pearce
 
Posts: 3499
Joined: Sun May 20, 2007 3:08 pm

Post » Thu Feb 04, 2010 7:25 pm

Thank you!!
Changing it to "Player->GetEffect..." did the trick :)

Argh, I can't believe I forgot that, but I'm glad it was something so simple.
User avatar
Terry
 
Posts: 3368
Joined: Mon Jul 09, 2007 1:21 am


Return to III - Morrowind