Script using SKSE functions doesn't compile

Post » Sat Jul 19, 2014 12:31 am

Hi,

I'm coming back to scripting and man am I rusty. I wrote the following but it doesn't compile:

Scriptname aaWardBurstScript extends activemagiceffect  {Gives ward the ability to reflect certain spells and unleash a staggering shockwave}Actor TargetBool ReadyToBurst Int ChanceEvent OnEffectStart(Actor akTarget, Actor akCaster)	Target = akTargetEndEventEvent OnWardHit(ObjectReference akCaster, Spell akSpell, int aiStatus)		if(aiStatus != 1 || akSpell.GetDeliveryType() != 2)		return	else		if(akSpell.GetCastingType() == 2) 			ReadyToBurst == 1		elseif(akSpell.GetCastingType() == 1)			akSpell.Cast(Target)		endif		endifEndEventEvent onEffectFinish(Actor akTarget, Actor akCaster)	if (ReadyToBurst == 1)		aaWardBurstSpell.Cast(Target)	endifEndEventSpell Property aaWardBurstSpell Auto

The compiler states that the (SKSE) functions GetCastingType and GetDeliveryType don't exist.

1. I seem to remember that to make the CK recognize SKSE functions you had to launch the CK in a special way that involved going to Start > Execute and typing an address that made SKSE launch the CK. Is that true or am I just confused?

2. Am I using GetCastingType and GetDeliveryType incorrectly?

Any help appreciated.

User avatar
lauraa
 
Posts: 3362
Joined: Tue Aug 22, 2006 2:20 pm

Post » Sat Jul 19, 2014 6:14 am

1. No special measures are required. Just make sure that SKSE's script files (.pex and .psc) are installed correctly.

2. GetCastingType and GetDeliveryType are member functions of the MagicEffect script, not Spell. So you would have to first get the Magic Effect(s) of the spell and then call the functions on the Magic Effect(s).

User avatar
DarkGypsy
 
Posts: 3309
Joined: Tue Jan 23, 2007 11:32 am

Post » Fri Jul 18, 2014 9:38 pm

mmm...I get it. Let me do some modifications then. Will edit post in a moment.

OK! This:

	if(aiStatus != 1 || akSpell.GetNthEffectMagicEffect(0).GetDeliveryType() != 2)		return	else		if(akSpell.GetNthEffectMagicEffect(0).GetCastingType() == 2) 			ReadyToBurst == 1		elseif(akSpell.GetNthEffectMagicEffect(0).GetCastingType() == 1)			akSpell.Cast(Target)		endif		endif

Compiles just fine.

Now to test it in game.

User avatar
Amy Siebenhaar
 
Posts: 3426
Joined: Fri Aug 10, 2007 1:51 am


Return to V - Skyrim