Jump to content

OBSE Script to change main menu isn't working - help


Recommended Posts

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 by Zovoct
Link to comment
Share on other sites

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 by Zovoct
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...