Zovoct Posted June 8, 2018 Share Posted June 8, 2018 (edited) I have taken GBRPlusss main menu randomizer script and tried to expand it so it can randomize more than 6 menus, provided they're named correctly, with OBSE's FileExists function. It's boolean, so you'd think it would be easy to just increment a counter in a loop. This is the first script I've tried to modify, so it could be a glaringly obvious screwup.So why won't it write the values to ini, and why wont it print any messages anywhere?Edit: D'oh! I put the counter/iterator's let statement in the beginning of the loop when it should be outside. :psyduck: scn zzZovoctRNDMenu string_var type string_var file short loopen short filecount short randmen short iterator Begin MenuMode 1044 let loopen :=1 DebugPrint loopen while loopen==1 let iterator := 1 if FileExists "Video\Map loop%g.bik" iterator == 1 let iterator := iterator + 1 else set loopen to 0 break endif loop set loopen to 0 let filecount := iterator set randmen to rand 1 filecount Message "Results of filecount and randmen: %g , %g" filecount randmen 20 set type to sv_construct "SMainMenuMovie:General" set file to sv_construct "Map loop%g.bik" randmen SetStringINISetting "%z|%z" type file set type to sv_construct "SMainMenuMovieIntro:General" set file to sv_construct "Oblivion iv logo%g.bik" randmen SetStringINISetting "%z|%z" type file set type to sv_construct "SMainMenuMusic:General" if FileExists "Special\TES4Title%g.mp3" randmen set file to sv_construct "TES4Title%g.mp3" randmen else set file to sv_construct "TES4Title.mp3" endif SetStringINISetting "%z|%z" type file con_SaveINI End ;<CSEBlock> ;<CSECaretPos> 302 </CSECaretPos> ;</CSEBlock> Edited June 9, 2018 by Zovoct Link to comment Share on other sites More sharing options...
Zovoct Posted June 12, 2018 Author Share Posted June 12, 2018 (edited) Edit: Figured out what I had to do. It involved abstracting the file checks to a function and using the OBSE compiler override to allow format string resolution. Edited June 17, 2018 by Zovoct Link to comment Share on other sites More sharing options...
Recommended Posts