Jump to content

[LE] Script wont compile


GSGlobe

Recommended Posts

I dont understand this error, what am I doing wrong here?

 

D:\Steam\steamapps\common\Skyrim Special Edition\Data\Scripts\Source\temp\Auto_Release_Combination_Script.psc(16,64): mismatched input ',' expecting RPAREN

D:\Steam\steamapps\common\Skyrim Special Edition\Data\Scripts\Source\temp\Auto_Release_Combination_Script.psc(16,67): required (...)+ loop did not match anything at input ')'

 

Not understanding this error, mismatched input . and +loop did not match anything at input

 

How to fix? LOL.. *crying* logic hurts my brain too much, I dont see it

 

Spoiler

Scriptname Auto_Release_Combination_Script extends activemagiceffect

 

Spell Property Auto_Store_Combination_Spell Auto

FormList Property Auto_Combination_FormList Auto

Spell Property AF_ReleaseBlastSPELL Auto

 

Event OnEffectStart(Actor akTarget, Actor akCaster)

 

Int nSize = Auto_Combination_FormList.GetSize()

If nSize != 0

int index = 0

While index < nSize

Spell TempSpell = Auto_Combination_FormList.GetAt(Index) as spell

If index == nSize - 1

(Auto_Combination_FormList.GetAt(0) as spell, 0).Cast(akTarget)

AF_ReleaseBlastSPELL.cast(akTarget)

else

(Auto_Combination_FormList.GetAt(Index + 1) as spell, 0).Cast(akTarget)

AF_ReleaseBlastSPELL.cast(akTarget)

EndIf

index +=1

EndWhile

EndIf

EndEvent

Link to comment
Share on other sites

Your problems are these lines:

 

(Auto_Combination_FormList.GetAt(0) as spell, 0).Cast(akTarget)

(Auto_Combination_FormList.GetAt(Index + 1) as spell, 0).Cast(akTarget)

 

The ", 0" shouldn't be there. You want:

 

(Auto_Combination_FormList.GetAt(0) as spell).Cast(akTarget)

(Auto_Combination_FormList.GetAt(Index + 1) as spell).Cast(akTarget)

 

When you see a 'mismatched input' compiler error, it means you've messed up your punctuation, basically. The three common ones (for me, anyway) are:

 

1. Using a single equals sign instead of a double equals sign in If statements;

2. Forgetting to close a parenthesis or string;

3. Forgetting to open a parenthesis or string.

Edited by foamyesque
Link to comment
Share on other sites

  On 10/22/2017 at 10:58 AM, GSGlobe said:

Mhm, I actually tried that but when casting spell, IT didnt cast second spell in formlist second time script was called

 

That means you've got a logic error somewhere. Compiler errors are mostly syntax things -- the equivalent of spelling. Scripts not doing what you want even though they compile is more like arguing with a drunk :v

 

Without knowing exactly what you want to do, diagnosing those is harder, but you're doing some funny things with that loop that could be causing your problem. The loop's logic structure, say for a 3-element formlist, will go:

 

Element 1

Element 2

Element 0

 

Is that the intended idea? If it is, and the spells aren't being cast, try some trace statements to make sure the branches are working. Maybe you don't have the spell in the formlist, or maybe the spell isn't set up correctly, or you're providing the wrong caster or target to the .Cast calls.

Link to comment
Share on other sites

I appreciate your help.
I have 5 spells in the formlist, I would like to call one at a time, one after the other, once at the last spell Go back to (0).

Im either getting all spells casted at once or just the first one, essentially i want 0, then 1, then 2 up to five or however many spells stored in list.

 

This script is casting every spell in the formlist

 

  Reveal hidden contents

 

 

Casted every spell in the formlist aswell.

 

  Reveal hidden contents

 

 

I'm not understanding this at all, haha.

Best regards

Edited by GSGlobe
Link to comment
Share on other sites

GSGlobe try to make your script sources more easier. Unfortunately you made it to complicated unnecessary. (KISS - Keep It Short and Simple)

from Max downto Zero

  Reveal hidden contents



from Zero to Max

  Reveal hidden contents

 

Edited by ReDragon2013
Link to comment
Share on other sites

Thank you both for your reply, but I think I messed up explaining what Im trying to do here.

 

I dont want the spells in formlist to be cast all at the same time one after another, rather getat(0) first time script is called, When script is called again getat(1) etc

 

This is the original script, works great as is, except IT equips the spell in left hand each time script is called.

I would also like to offer a solution to this, to cast the spell directly instead of equipping in those cases I would run around with a two handed weapon or dont want to equip a spell.

 

 

  Reveal hidden contents

 

 

Perhaps My problem is more clear now, a while might not be the solution?

 

Edit: Should I compare lefthand = index?

Im either getting stuck at getat(0) or IT cast every spell in form, im missing something I cant get to..

Edited by GSGlobe
Link to comment
Share on other sites

Each time the spell is cast, cast a different spell from the list. Got it.

 

You want to increment an index number with each cast and use that to get the spell from your formlist. Unfortunately, magic effects get a new instance of the script each time their respective spell is cast. Therefore you have to do some script work on a maintenance quest script. Set up a quest that is start game enabled or be sure to start it whenever you start the rest of your mod. The point is that the quest has to be running and remain running for the entire duration that the player has this spell.

 

Example script for the quest:

 

  Reveal hidden contents

 

Example script for the magic effect

 

  Reveal hidden contents

 

 

Be sure to set up the quest script and compile it first. Otherwise the magic effect script will fail to compile.

Link to comment
Share on other sites

Ah! Yes, now this make sense, thanks a bundle for this. I didnt think for a moment about using a quest nor did I think about magiceffect getting a new instance, tunnelsight is that a saying?

 

Thanks alot for your help! I suppose performance wise its good?

 

Best regards

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...