SonOfCronus Posted February 11, 2014 Share Posted February 11, 2014 I keep getting the error: Unknown variable npc[0] for parameter variableScript outline array_var npcs .... MessageBoxEX "Select NPC|%n|%n|%n|Cancel" npcs[0] npcs[1] npcs[2] ... If I use the following MessageBoxEX "Select NPC|%n|%n|%n|Cancel" (ref)npcs[0] (ref)npcs[1] (ref)npcs[2]the error goes away but it does not work. I am trying to tell it the type but I do not know how. Link to comment Share on other sites More sharing options...
QQuix Posted February 12, 2014 Share Posted February 12, 2014 (edited) IIf memory serves, format strings don't always accept array elements as vars. Try loading the references into ref vars ref ref0 ref ref1 ref ref2 . . . let ref0 := npcs[0] let ref1 := npcs[1] let ref2 := npcs[2] MessageBoxEX "Select NPC|%n|%n|%n|Cancel" ref0 ref1 ref2btw, (ref)npcs[2] is not an acceptable syntax for Oblivion scripts Edited February 12, 2014 by QQuix Link to comment Share on other sites More sharing options...
SonOfCronus Posted February 12, 2014 Author Share Posted February 12, 2014 IIf memory serves, format strings don't always accept array elements as vars. Try loading the references into ref vars ref ref0 ref ref1 ref ref2 . . . let ref0 := npcs[0] let ref1 := npcs[1] let ref2 := npcs[2] MessageBoxEX "Select NPC|%n|%n|%n|Cancel" ref0 ref1 ref2btw, (ref)npcs[2] is not an acceptable syntax for Oblivion scripts I changed my whole code to use arrays thinking it would be more efficient and clean and now I have to go back. :sick: Thanks Link to comment Share on other sites More sharing options...
Recommended Posts