Log in

View Full Version : The easiest way to attain a randomizer?


tmifune
20th September 2007, 19:53
I'm building a disc which will have three seperate menu themes that should randomly be generated from first play a la the Star Wars DVDs. Any suggestions on what the easiest way to do this would be?

goonix
21st September 2007, 00:39
There is a random function:

Set gprm(x) ?=(rnd) 3

x is a free gprm.
The result is 1, 2 or 3.
Then jump to the specific menu upon gprm(x).

goonix

tmifune
21st September 2007, 17:35
so... sorry for being a newbie here, our main authoring guy is on vacation and I got thrown into the deep end with this project. Using Scenarist, I would go to the pre flag on first play, go to the Set to GPRM command, choose random value from the pulldown menu and....could you hold my hand through the steps? I'm not seeing the x free gprm from the GPRM pulldown menu...

thanks for the info above, though

goonix
21st September 2007, 22:57
I don't know Scenarist, so I can't hold your hand. ;)

The x stands for 0, 1 ... 15. In other words a GPRM that isn't used otherwise. But in First Play most of the GPRMs should be unused. And after randomly chosen the menu, this GPRM can be used for other purposes.

Direct from First Play:

Set gprm(0) ?=(rnd) 3
Set gprm(1) =(mov) 1
if ( gprm(0) == gprm(1) ) then { (JumpSS) Jump to VMGM PGC 1 } -> here call menu 1
Set gprm(1) =(mov) 2
if ( gprm(0) == gprm(1) ) then { (JumpSS) Jump to VMGM PGC 2 } -> here call menu 2
Set gprm(1) =(mov) 3
if ( gprm(0) == gprm(1) ) then { (JumpSS) Jump to VMGM PGC 3 } -> here call menu 3

Here is an idea how you can accomplish this task as precommands in a VTSM menu. The 3 different menus are in 3 cells of the same menu PGC:

Set gprm(0) ?=(rnd) 3
if ( gprm(0) == 1 ) then { LinkCN Cell 1 }
if ( gprm(0) == 2 ) then { LinkCN Cell 2 }
if ( gprm(0) == 3 ) then { LinkCN Cell 3 }

There are a lot of other opportunities.

Good luck

goonix

tmifune
21st September 2007, 22:58
nevermind, got it...."I'm not seeing the x"....heh, yep, I'm an idiot

tmifune
21st September 2007, 23:19
ahh, didn't see your latest reply before I left that last comment. That helps a lot, thanks goonix!

digitalvideo
26th September 2007, 11:38
Just for info some player return 0,1,2 for a RND3 not 1,2,3

Add test in your code like this

if gprm0=0 then grpm0=3

goonix
26th September 2007, 23:37
Thanks, digitalvideo!

I didn't know this, because all my players return 1,2,3

goonix