The inner loop only increments 'doonce' while it is less than 100, once it hits 100 it stops incrementing and the outer loop goes forever.
Thnx, that's what the midnight edit was about, I noticed eventually, sorry about the dumb question :banghead:
I am trying to make a "dual ref-walk" script, meaning a script that gets a reference and then does a ref-walk that does stuff for that reference. In the next iteration, getNextRef is used to select the next reference and perform another ref-walk for that reference. Problem is, damn thing keeps crashing. I thought it was the nested loop, but I'm leaning towards the multi-getFirstRef/getNextRef syntax. After cutting down on lines to find the problem, I have the following script:
scn 1ntfsQuestScriptshort depthref actorref actorLoop2 ref appleref pencilBegin GameModeif player.isInInterior == 1 set depth to 0else set depth to 2endifset actor to appleset actorLoop2 to pencilset actor to (getFirstRef 200 depth 0)set actorLoop2 to (getFirstRef 200 depth 0) Label 2 if actorLoop2 != 0 set actorLoop2 to pencil set actorLoop2 to getNextRef goto 2 endifif actor != 0 set actor to apple set actor to getNextRefendifEnd
This script crashes on load unless I comment out the
set actor to apple set actor to getNextRef
lines. I can't find a logical error in the script, so I am thinking that I may be using getNextRef in a wrong way, or there is a bug. Any ideas?
Btw, same thing happens if I put a counter in the Label 2 loop to ensure it doesn't run forever :banghead: