Okay, when you return from the stats screen, the game reverts to what it was before the most recent page was run, then runs the page again. This means that any *rand commands will be rerolled (in addition to at least one other small bug). There was some talk about fixing it with CoV, but it was decided that it was too small a bug to fix. The way around it is to roll stats up at least one page before you need them.
I’d recommend rolling up as many ‘packs’ as there are in the game at the start, saving each one to a variable (or set of variables), then calling them up when you need them. It would probably look something like what I have below (this would generate three packs of three cards, with each numbered 1 to 5):
*temp random
*create pack1
*create pack2
*create pack3
*set pack1 “”
*set pack2 “”
*set pack3 “”
*create pack_counter
*create current_pack
*set pack_counter 1
*set current_pack “pack”&1
*label add_card
*rand random 1 5
*set {current_pack} &random
*if {current_pack} < 100
-*goto add_card
*if current_pack = “pack3”
-*set current_pack “pack”&1
-*set pack_counter 1
-*goto pack_generation_finished
*set pack_counter + 1
*set current_pack “pack”&pack_counter
*goto add_card
This will roll up the packs, then, once the player opens the packs, you’ll ‘extract’ the cards with this:
*label first_card_extract
*if {current_pack} > 500
-You got the fifth card!
-*set fifth_card_counter + 1
-*set {current_pack} - 500
-*goto second_card_extract
This will be copy/pasted for each card in each ‘slot’, so you’ll do the same thing for the fourth through first card in the series, then do it again in the tens digit, then again with ones, replacing > with =. Then, at the end you’ll run:
*set pack_counter + 1
*set current_pack “pack”&pack_counter
Now, you’ll probably want to tweak the third line of the second portion (“You got the # card!”) so that is displays things in a neater fashion (probably using something akin to the language system in the CoV stats sheet/the inventory system in Zombie Exodus), but, besides cosmetics, that should be a watertight system to pregenerate packs.
It can also be further tweaked to include things such as different styles of pack, or other such things, or to ensure that at least one of each kind of card if able to be found.