Recently I've been trying to write most of my scripts using TSL's useful script parameter system to keep them more organized. I've had a weird occurence in that whenever I use a script parameter greater than 0, my game will crash on the entry spoken where the parameter is 1,2, etc.
Below is the actual script I am using.
void main() {
int nParam1=GetScriptParameter(1);
switch (nParam1) {
case 0:
effect efVisual=EffectVisualEffect(3016);
effect efVisual2=EffectVisualEffect(3010);
vector vKun=Vector(-0.22,301.64,11.20386);
location lKun=Location(vKun, 270.77);
CreateObject(OBJECT_TYPE_CREATURE, "exarkun", lKun);
ApplyEffectAtLocation(0, efVisual, lKun, 0.0);
ApplyEffectAtLocation(0, efVisual2, lKun, 0.0);
break;
case 1:
object oKun=GetObjectByTag("exarkun");
CreatureFlourishWeapon(oKun);
DelayCommand(1.5, ChangeToStandardFaction(oKun, 1));
break;
}
}
And a screenshot of my dialog file.
Clicky (
http://i292.photobucket.com/albums/mm29/Exile007_album/crash.jpg)
I'm not really sure what's going on, so any advice given is grateful. :)