View Full Version : Sprm
iano2000
18th January 2005, 14:14
Hi all,
Using Scenarist I have SPRM 7 tracking a feature to highlight the chapter I return to rather than jump from over two chapter pages. This all works fine on the first chapter menu page but I'm having problems with the second page.
I can't seem to get the right chapter highlight when I jump from the fetaure plus if the value of the SPRM is for the second page how do I clear it when I want to link back to the first page with a button cmd?
Setup on 1st page, also acts as the root for the VTS.
Mov GPRM8, SPRM7
if ( GPRM8 <1024 )Mul GPRM8, 1024
if ( GPRM8 !=1024 )Sub GPRM8, 1024
SetHL_BTNN HL_BTNN=GPRM8
The 1st chapter isn't the very start of the featue.
So basically looking for cmd assistance in setting up the second page with the correct chapter highlighting.
Many Thanks,
M7S
19th January 2005, 08:25
Can you do something like
in first page
1 if ( GPRM8!=76) goto line 5 // 76 was just the first number that came up in my head, use whatever you want
2 Mov GPRM8, 1024 //or whatever button you want to highlight when going back from second page
3 Mov GPRM8, 0
4 goto line 12
5 Mov GPRM8, SPRM7
6 if ( GPRM8 <=[number of chapters in first page] ) goto line 6
7 Sub GPRM8, [number of chapters in first page]
8 Mul GPRM8, 1024
9 [jump to whereever your next chapterpage are]
10 if ( GPRM8 <1024 )Mul GPRM8, 1024 //is it necessary with an if here?
11 if ( GPRM8 !=1024 )Sub GPRM8, 1024
12 SetHL_BTNN HL_BTNN=GPRM8
for the go-to-next-chapterpage button use something like
Mov GPRM8, 0 and [jump to whereever your next chapterpage are]
in the second page
1 if ( GPRM8!=0 ) SetHL_BTNN HL_BTNN=GPRM8 //maybe some more error checking should be used here, just in case GPRM8 is something odd
2 if ( gprm8==0 ) SetHL_BTNN HL_BTNN=1024 //or whatever button you want to highlight when coming from first page
for the go-to-previous-chapterpage button use a command like
Mov GPRM8, 76 and [jump to whereever your previous chapterpage are]
Since I'm not used to Scenarist some commands can be written in the wrong way. I'm used to commands as pgcedit writes the (eg. set GPRM8=(mov) 1024 insted of mov GPRM8, 1024). I hope I got things right anyway and gave you the help you needed.
Regards,
M7S
Bish0p
20th January 2005, 14:10
Assuming you have 10 chapters on the first menu how about this:
1st chapter menu:
PRE:
1. If (GPRM8 == 1) Goto 5 // For jumping from Main menu and ChapterMenu2
2. Mov Gprm8, Sprm7
3. if (GPRM8 != 1) Sub GPRM8, 1
4. if (GPRM8 >= 11) LinkPGCN Chapters2menu //link to next chap page if is on the next page
5. Mul GPRM8, 1024
6. SetHL_BTNN HL_BTNN=GPRM8
7. Mov GPRM8, 0 //reset GPRM8. without, if GPRM8 = 1, then it would always be 1
CELL:
1. LinkCN Chapters1menu // link back to self without executing the pre command again
Button:
All chapter links to their respective chapters
The next button: {Mov GPRM8,1 ; LinkPGCN Chapter2menu}
Chapter menu 2
Pre:
1. if (GPRM8 == 1) Goto 3
2. Sub GPRM8, 10
3. Mul GPRM8, 1024
4. SetHL_BTNN HL_BTNN=GPRM8
5. Mov GPRM8, 0
Cell:
Same as above
Buttons
Same as above expect the previous button should link to Chapter1menu
Hope this helps
GM006
24th January 2005, 11:21
Hm... Well, this is how I do it since the client I work with always HAS to have this.
In your root menu pgc have a pre-command that finds out if the main program is playing and then have it jump to a Chapter Selection "decision" dummy pgc within the language domain.
So my code will look like this:
Root Menu
PRE CMD:
If (GPRM1 = 5) Jump To chapter_decision
(all other menu code goes here)
"Decision" PGC
PRE CMD:
Set GPRM2, SPRM7
If (GPRM2 > 5) Goto 5
Mul GPRM2, 1024
JumpToPGC ChapterSelection1
If (GPRM2 > 10) Goto 9
Sub GPRM2, 5
Mul GPRM2, 1024
JumpToPGC ChapterSelection2
If (GPRM2 > 15) Goto 13
Sub GPRM2, 10
Mul GPRM2, 1024
JumpToPGC ChapterSelection3
(code continues)
ALL Chapter Selection PGCs:
PRE CMD:
SetHighlightBTTN: GPRM2
Set GPRM1, 1 (this is so you dont end up in an infinite loop when you try and return to the main menu page).
iano2000
25th January 2005, 09:32
Thanks for the replies. Will work with suggestions.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.