[Req] Script: play magiceffect while casting another spell

Post » Thu Jun 21, 2012 6:47 pm

Hey guys,

Im working on a new spell and want to combine 2 magic visual effects. (im really new to this papyrus scripting) I was thinking of something like that:

-----------------------------------
(that should be attached to the first magic effect (which is mainly a beam spell)
Scriptname SCRIPTNAME

Event OnEffectStart(Actor akTarget, Actor akCaster)
player.PlayMagicEffectVisuals WardConcSelf50
endif
endevent
-----------------------------------

CK gives me that error: "no viable alternative at input 'PlayMagicEffectVisuals'" -> Any ideas or suggestions how to solve my problem?

What i want is to combine the visual effects of the beam spell and that Ward spell (the shield) in one spell, -> without merging the .nifs - of course.

Thanks, JoO
User avatar
ONLY ME!!!!
 
Posts: 3479
Joined: Tue Aug 28, 2007 12:16 pm

Post » Thu Jun 21, 2012 10:21 am

First, you can't use player as is in papyrus. you need to define a property (you can call it player if you wish) storing the player reference in the CK or you could use game.getplayer() function directly or after assigning its value to a variable or property.

Second playmagiceffectvisuals is a console command. You can't use it in papirus. You can usually add a visual effect using the addspell function though (with spells it add the spell to the casting list of the character, but in the case of visual effects you will add the visual to the character (usually).
User avatar
Carlos Vazquez
 
Posts: 3407
Joined: Sat Aug 25, 2007 10:19 am

Post » Thu Jun 21, 2012 12:24 pm

thanks for your answer, but that doesnt really help me. Can you make a short samplescript for me please? Maybe one could workaround with the "cast" function to cast two spells simultaneously.
User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Thu Jun 21, 2012 8:05 am

Hi JackoO, the following should work.

Firstly i duplicated the magic effect "FrostDamageConcAimed". I renamed the copy to FrostDamageConcAimedExquisite. This effect has a beam/channelled effect.

Then created a new spell and added the new magic effect to it, ensuring the duration was 0

I then attached the following script to the magic effect
Spoiler
  Scriptname testscript extends activemagiceffect  {Casts a beam spell and casts a ward spell}MagicEffect Property FrostDamageConcAimedExquisite AutoSpell Property WardLesser Auto ; The ward spell i used to test was Lesser WardEvent OnEffectStart (Actor akCaster, Actor akTarget)	WardLesser.Cast(Game.Getplayer(),Game.GetPlayer())EndEvent	;this is needed as the ward spell continues to cast and;will only stop when the caster has run out of magickaEvent OnEffectFinish (Actor akCaster, Actor akTarget)	Game.GetPlayer().DispelSpell(WardLesser)EndEvent		  


If you copy the script and name the magic effect as above, you should be able to auto fill the properties.

When you cast the channelled spell, the ward spell (with animation) is cast.

The result is both animations are played
User avatar
Wayne W
 
Posts: 3482
Joined: Sun Jun 17, 2007 5:49 am

Post » Thu Jun 21, 2012 11:02 am

Hi heilghast, thanks for your reply!
But it didn't work for me. I just copied the magic effect by renaming it, added the new spell and attached the magic effect. I then added the script to the magic effect. (the properties were auto filled) -> But when i cast the spell ingame - only the frost beam appears
User avatar
Josh Lozier
 
Posts: 3490
Joined: Tue Nov 27, 2007 5:20 pm

Post » Thu Jun 21, 2012 3:44 pm

Hi JackoO

I have re-tested this and works for me.
The only thing that i could think of that is not causing the ward to trigger, is if you are not casting it a against a target. The Ward is cast when the Effect starts. If the effect is not applied against a valid target the ward will not cast.
User avatar
Red Sauce
 
Posts: 3431
Joined: Fri Aug 04, 2006 1:35 pm


Return to V - Skyrim