ExplodeSpell usage?

Post » Tue Nov 24, 2009 3:37 am

Basic script: Character teleports around, everytime he teleports, the place he was makes has a spell explode at it.
Now, when this happens, the character does teleport fine, but the spell doesn't explode.

Here's the section of the code
	If (GetHealth <= 400)		ExplodeSpell "omicron_astrfl_flames"		PositionCell, 3485.5, 1941.5, 14574.5, 0, "Gateway Chamber"			Endif 	If (GetHealth <= 200)		ExplodeSpell "omicron_astrfl_flames"		PositionCell, 5814.0, 1578.1, 14951.0, 0, "Gateway Chamber"	Endif 



I've never really understood how ExplodeSpell works, are creatures not allowed/able to use it, or what?
User avatar
Hilm Music
 
Posts: 3357
Joined: Wed Jun 06, 2007 9:36 pm

Post » Tue Nov 24, 2009 8:58 am

What I typically do is use PlaceItem or PlaceAtMe to position a tiny, invisible activator at the proper position. That activator has a local script attached telling it to ExplodeSpell in the manner that you're using it, after which the object disables itself and waits an appropriate period to use setdelete 1 and DontSaveObject.

There may be a more "clean" method, but this has served me well. Good luck!
User avatar
Amy Cooper
 
Posts: 3400
Joined: Thu Feb 01, 2007 2:38 am

Post » Tue Nov 24, 2009 6:03 am

What would you recommend for the activator.
User avatar
Guinevere Wood
 
Posts: 3368
Joined: Mon Dec 04, 2006 3:06 pm

Post » Tue Nov 24, 2009 4:50 am

I used NifSkope to make the "editormarker_box_01.nif" file something like 0.01 scale, resaved it as a new filename, and referenced that. Hope it works for you!
User avatar
renee Duhamel
 
Posts: 3371
Joined: Thu Dec 14, 2006 9:12 am

Post » Tue Nov 24, 2009 6:49 am

Not working, not entirely, the spell spawns, but it just sits there and doesn't explode.

short diamondexplosion		If (explosion < 1)			ExplodeSpell "omicron_astrfl_flames"		  	explosion to 1	Endif		If (explosion == 1)					EndifEnd	

User avatar
Jeffrey Lawson
 
Posts: 3485
Joined: Tue Oct 16, 2007 5:36 pm

Post » Tue Nov 24, 2009 5:16 am

Here's a sample script for one of my objects. This local script is attached to the invisible activator, so that upon spawning it will activate, and "NMZ_FrostSpell2_Bomb" is a touch-ranged spell with a few units' area of effect.
Begin NMZ_FrostBlockTriggerScript; -- -- Frost Block Trigger Script Variablesshort state					; Controls disable; -- -- Frost Block Trigger Menumode Blockif ( MenuMode == 1 )	Returnendif; -- -- Frost Block Trigger Disable Blockif ( GetDisabled == 1 )	if ( state <= 200 )		set state to ( state + 1 )		Return	else		setdelete 1		DontSaveObject		Return	endifendif; -- -- Frost Block Trigger Spell Blockif ( state == 0 )		ExplodeSpell "NMZ_FrostSpell2_Bomb"	set state to 1	Returnelseif ( state == 1 )	set state to 2	Disable	ReturnendifEnd

User avatar
Floor Punch
 
Posts: 3568
Joined: Tue May 29, 2007 7:18 am


Return to III - Morrowind