Script Effect Spell

Post » Sat May 28, 2011 10:33 am

Is there anyway to make one? I've looked at the spell effects and there is no "ScriptEffect" spell that I can see, like in Oblivion. So how do I make a custom spell?
User avatar
Gemma Flanagan
 
Posts: 3432
Joined: Sun Aug 13, 2006 6:34 pm

Post » Sat May 28, 2011 1:01 am

I'm not familiar with the Oblivion CS, so I might not know exactly what you're asking...

But you make a new spell by simply Right-clicking on the list of spells in the Spellmaking tab. Then select New.
(then add your effects, details, etc) Click OK when done.

You can call any spell in a script, just by using it's ID.
example: Cast "ID of spell" Player
User avatar
Liv Brown
 
Posts: 3358
Joined: Wed Jan 31, 2007 11:44 pm

Post » Fri May 27, 2011 9:42 pm

Well, I think you should check this http://planetelderscrolls.gamespy.com/View.php?view=mods.detail&id=1981.

You need to choose whichever spell efect and then write a script for that.
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Sat May 28, 2011 8:24 am

And if you mean to add a spell with a scripted outcome, that is possible too. You just need to crate a new spell that affects self (anything will do, like a 1 second Feather, etc.) and write something like this, then make it a start script (Tribunal required):

Begin myscriptshort doonceif ( "player"->GetSpellEffects, "myspell" == 1 )	if ( doonce == 0 )		set doonce to 1		;Scripted effects go here	endifelse	set doonce to 0endifEnd


Now of course, the drawback of this is if you make it a start script, it will run indefinitely and drain system resources even if the player doesn't know or use the spell, as long as the mod is loaded. For that reason I generally prefer to make it somehow tied to an inventory item, activator, or actor and attach the script to that object instead. However that way the script will only run if that object is in one of the loaded cells.
User avatar
Dewayne Quattlebaum
 
Posts: 3529
Joined: Thu Aug 30, 2007 12:29 pm

Post » Fri May 27, 2011 11:17 pm

Indeed, there is no "ScriptEffect" method like in the Oblivion CS, the accepted method is to do as Adul stated and create a "dummy" spell. When it is detected that the dummy spell has been cast by the player, you'll want your script to interject and perform whatever effects you were planning. With some careful scripting you can create pretty cool effects, but there are a lot of practical limitations to be aware of. Good luck!
User avatar
Jaki Birch
 
Posts: 3379
Joined: Fri Jan 26, 2007 3:16 am

Post » Fri May 27, 2011 6:49 pm

I'm just trying to toggle an ability through a spell, but it's not working. This is the script I'm using.
Begin CTEnvScriptshort doonceshort effectif ( "player"->GetSpellEffects, "CTEnv" == 1 )	if ( doonce == 0 )		set doonce to 1		if effect == 0			player->addspell, "CTEnvA"			set effect to 1		elseif effect == 1			player->removespell, "CTEnvA"			set effect to 0		endif	endifelse	set doonce to 0endifEnd

Is there something wrong with it? It never adds the ability.
User avatar
Chica Cheve
 
Posts: 3411
Joined: Sun Aug 27, 2006 10:42 pm

Post » Fri May 27, 2011 6:30 pm

I'm not sure whether the if syntax lacking parentheses would cause any issues because I've never used it that way, but it's generally the safest to use the same syntax rules throughout one script. Otherwise, it looks like it should be working. Did you add it as a start script or attached it to an object?



You may also try this, it replaces the effect variable with a simple effect check to detect whether the player has the ability or not:

Begin CTEnvScriptshort doonceif ( MenuMode == 1 )        Returnendifif ( "player"->GetSpellEffects, "CTEnv" == 1 )        if ( doonce == 0 )                set doonce to 1                if ( "player"->GetSpellEffects, "CTEnvA" == 0 )                        "player"->AddSpell, "CTEnvA"                else                        "player"->RemoveSpell, "CTEnvA"                endif        endifelse        set doonce to 0endifEnd

User avatar
victoria johnstone
 
Posts: 3424
Joined: Sat Oct 14, 2006 9:56 am

Post » Sat May 28, 2011 6:07 am

I'm not sure whether the if syntax lacking parentheses would cause any issues because I've never used it that way, but it's generally the safest to use the same syntax rules throughout one script. Otherwise, it looks like it should be working. Did you add it as a start script or attached it to an object?



You may also try this, it replaces the effect variable with a simple effect check to detect whether the player has the ability or not:

Begin CTEnvScriptshort doonceif ( MenuMode == 1 )        Returnendifif ( "player"->GetSpellEffects, "CTEnv" == 1 )        if ( doonce == 0 )                set doonce to 1                if ( "player"->GetSpellEffects, "CTEnvA" == 0 )                        "player"->AddSpell, "CTEnvA"                else                        "player"->RemoveSpell, "CTEnvA"                endif        endifelse        set doonce to 0endifEnd


How do I make it a start script?

Is that when you make a hidden quest with a constantly running script?
User avatar
~Sylvia~
 
Posts: 3474
Joined: Thu Dec 28, 2006 5:19 am

Post » Fri May 27, 2011 7:50 pm

How do I make it a start script?


If you have Tribunal installed, you can find it under Gameplay > Edit Start Scripts. Be aware that using this function does make your mod dependent on Tribunal (not really an issue nowadays as almost everyone has it).
User avatar
Darian Ennels
 
Posts: 3406
Joined: Mon Aug 20, 2007 2:00 pm

Post » Sat May 28, 2011 4:47 am

If you have Tribunal installed, you can find it under Gameplay > Edit Start Scripts. Be aware that using this function does make your mod dependent on Tribunal (not really an issue nowadays as almost everyone has it).

Thanks, it's working now.
User avatar
Avril Churchill
 
Posts: 3455
Joined: Wed Aug 09, 2006 10:00 am

Post » Fri May 27, 2011 11:07 pm

Glad I could help. :)
User avatar
Sandeep Khatkar
 
Posts: 3364
Joined: Wed Jul 18, 2007 11:02 am


Return to III - Morrowind