Spell Scripts

Post » Tue May 10, 2011 10:18 am

When ever I try to create a spell that starts a script effect onto the enemy that it hits, though with my current scripts the script thats suppose to play on the enemy instead starts on the player, so is there any function I can use to make them work? The current script I have been using is UserRef, though would that be ruining it (I'm a complete newb with Scripting)
User avatar
BlackaneseB
 
Posts: 3431
Joined: Sat Sep 23, 2006 1:21 am

Post » Tue May 10, 2011 5:49 pm

When ever I try to create a spell that starts a script effect onto the enemy that it hits, though with my current scripts the script thats suppose to play on the enemy instead starts on the player, so is there any function I can use to make them work? The current script I have been using is UserRef, though would that be ruining it (I'm a complete newb with Scripting)

Could you post the actual scripts that you are using? Just telling us that the script runs on an enemy instead of the player doesn't help at all. And what on earth is UserRef?
User avatar
Nick Jase Mason
 
Posts: 3432
Joined: Sun Jul 29, 2007 1:23 am

Post » Tue May 10, 2011 9:00 pm

I'm starting to think that I might need to use something besides userref for these types of spells, or Find out how to specify.
Though the scripts are simple, im not that good

scn AAAexamplescript

ref userref

begin scripteffectstart
userref. setav paralysis 1
userref. PlayMagicShaderVisuals effectshockdamage
endif
end

begin scripteffectfinish
userref. setav paralysis 0
userref. StopMagicShaderVisuals effectshockdamage
endif
end
User avatar
!beef
 
Posts: 3497
Joined: Wed Aug 16, 2006 4:41 pm

Post » Tue May 10, 2011 8:54 am

Hmm, I don't see userref declared there. In Magic Effect type scripts, if no reference is declared the script will use the actor upon whom the script effect is acting as the target of the scripting. So you can remove userref from your script.

Edit:: And its better if you use ModAV instead of SetAV because
-using SetAV affects ALL actors with the same BaseID. So if you cast this spell on a bandit, and there is an equal bandit nearby (bandits are usually the same guys with different stuff) both bandits will become paralysed. Same if you cast it on a rat and there's another rat nearby. Whereas ModAV only affects the current reference
-If the actor is already paralysed, when the spell ends he will 'unparalyze' regardless of any active paralysis effects on him. Change SetAV paralysis 1 and 0 to ModAv paralysis 1 and -1.
User avatar
Anna Beattie
 
Posts: 3512
Joined: Sat Nov 11, 2006 4:59 am


Return to IV - Oblivion