The Compiler doesn't like my attempt to circumvent the singl

Post » Mon Jun 18, 2012 9:16 am

Hi all,
This weekend I have been working on a sort of "Universal Trasmutation" script which would allow to change objects from an array property which are in caster's possession to
other objects within the same list (which acts as a sort of "stair"). For purpose of this script I needed to circumvent the limitation on multiple arrays by making two arrays which
have the same length:
- The first (arObjectMatrix) is a MiscObject array property whose elements are set within the magic effect window.
- The second (arObjMatrixAmount) is the "son" and is a variable. It's designed to contain integers (amounts of items) and should have the same length of arObjectMatrix,
since the numbers in it will be the numbers of arObjectMatrix objects which are in caster's possession.

Now I have a problem with the compiler:

"Starting 1 compile threads for 1 files...
Compiling "refineUniversalContinuum"...
e:\giochi\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\refineUniversalContinuum.psc(23,38): mismatched input 'iSecondaryArrayLength' expecting INTEGER
No output generated for refineUniversalContinuum, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on refineUniversalContinuum
"


The compiler seems to not like where my code is going and I've cut it down to slices to debug it so I am pretty sure that the problem is in this part:

"Scriptname refineUniversalContinuum extends activemagiceffect
{script for spell to allow transmutation of any kind of miscellaneous item}

import game

MiscObject[] Property arObjMatrix Auto
{This matrix variable (array) contains all the objects which could be affected by the transmutation process}
string Property sObjectsNature Auto
{This string defines the nature of the items which will be affected by the transmutation (ores, ingots, etc...)}
bool Property bContinualChange Auto
{This property defines whether the script is allowed to change items which were already changed or not (everything will be changed into the last item of the array)}
Sound Property FailureSFX Auto
float property skillAdvancement = 25.0 auto
{How much to advance the skill? Only works when spell actually transmutes something}
message property failureMSG auto

EVENT OnEffectStart(Actor akTarget, Actor akCaster)
objectReference caster = akCaster
int iCurrentElement = 0
int iChangeableItems = 0
int iMissingObjects = 0
int iSecondaryArrayLength = arObjMatrix.Length as Int
int[] arObjMatrixAmount = new int[iSecondaryArrayLength]
endEVENT
"

Note that at first I've stated "int iSecondaryArrayLength = arObjMatrix.Length" but then, thinking that may be the output of "arObjMatrix.Length" isn't an integer, I've added "as Int"
to convert the variable type to Integer. Well...the compiler still doesn't like it and honestly I've hard time in understanding why, because I don't know any way to have the script give
me an output during the debug process (in VBA if I point with the mouse on the variable during debug, I get its value...but nothing like that seems to be available and honestly I
am too "green" with coding to know more advanced ways...).

Anyone of you guys knows how could I make that "arObjMatrix.Length" output to be more "edible" for the compiler? :(

Thanks,
Jashkar

P.S.: Also...do you have any suggestion on how add "checkpoints" for variable values in a script for debugging purpose? :-?
User avatar
Angus Poole
 
Posts: 3594
Joined: Fri Aug 03, 2007 9:04 pm

Post » Mon Jun 18, 2012 8:56 am

On http://www.creationkit.com/Arrays_(Papyrus)#Creating_Arrays it says that the array must be 1 to 128 in size and cannot be a variable, which is the cause of your specific error here.
User avatar
Scarlet Devil
 
Posts: 3410
Joined: Wed Aug 16, 2006 6:31 pm

Post » Mon Jun 18, 2012 9:30 pm

Ok. Solved by turning the array into a Property which I'll have to hand-input as the spell is created. :(

Thanks,
Jashkar
User avatar
Sarah Knight
 
Posts: 3416
Joined: Mon Jun 19, 2006 5:02 am


Return to V - Skyrim