FANDOM


Mini (Random) - Scenes System

Download Link: http://www.mediafire.com/?0pyhv0fga8hjpet

Updated: Description Author
28/09/2012

Simulates an infinite* amount of 'mini-scenes' (in a single scene file) that are randomly selected for display. They are not repeated by default, but may be set to repeat on an individual basis. The number of mini-scenes to show the player is configurable and does not have to match the total amount of mini-scenes.

CJW

This, as is the rest of the wiki, is covered under Creative Commons Attribution-Share Alike License 3.0 (Unported) (CC-BY-SA). To install, copy and paste code below into a blank scene file (or alternatively download the .zip above):

*label start
*comment SETS AMOUNT OF MINI SCENES UTILIZED IN SYSTEM 
*comment(must not EXCEED number of mini scene labels/booleans)
*temp total_scenes
*set total_scenes 9
*temp max_scenes
There are nine potential random scenes in this game, how many do you wish to use? (2-9)
*input_number max_scenes 2 9

*comment THESE SHOULD NOT BE CHANGED
*temp current_check
*temp current_scene

*comment DEFINES THE PREFIX FOR MINI-SCENE LABELS - CAN BE CHANGED
*comment BUT IT IS NOT RECOMMENDED
*temp labelprefix
*set labelprefix "miniscene_"

*comment A BOOLEAN VAR IS REQUIRED FOR EACH SCENE. IT MUST BE INTIALLY SET TO FALSE
*temp seen1
*set seen1 false
*temp seen2
*set seen2 false
*temp seen3
*set seen3 false
*temp seen4
*set seen4 false
*temp seen5
*set seen5 false
*temp seen6
*set seen6 false
*temp seen7
*set seen7 false
*temp seen8
*set seen8 false
*temp seen9
*set seen9 false

*comment SELECTS A RANDOM MINI-SCENE. IF THE MINI-SCENE HAS NOT BEEN READ, MARK IT READ AND GOTO IT;
*comment IF THE MINI-SCENE HAS BEEN READ, RE-RANDOMIZE ANOTHER

*label nextscene
*gosub checkend
*rand current_scene 1 total_scenes
*set current_check "seen"&current_scene
*if ({current_check} = false) 
 *setref current_check true
 *set  current_scene labelprefix&current_scene
 *gotoref current_scene
*goto nextscene

*label miniscene_1
Scene 1
*page_break
*goto nextscene

*label miniscene_2
Scene 2
*page_break
*goto nextscene

*label miniscene_3
Scene 3
*page_break
*goto nextscene

*label miniscene_4
Scene 4
*page_break
*goto nextscene

*label miniscene_5
Scene 5
*page_break
*goto nextscene

*label miniscene_6
Scene 6
*page_break
*goto nextscene

*label miniscene_7
Scene 7
*page_break
*goto nextscene

*label miniscene_8
Scene 8
*page_break
*goto nextscene

*label miniscene_9
Scene 9
*page_break
*goto nextscene

*label miniscene_10
Scene 10
*page_break
*goto nextscene


*comment THIS SUB ROUTINE CHECKS IF ALL MINI-SCENES HAVE BEEN READ, IF YES, THE  MAIN SCENE IS ENDED;
*comment IF NOT, RETURN TO MINI-SCENE RANDOMIZATION

*label checkend
*temp n
*temp current
*temp total_read
*set total_read 0
*set n 0
*label checkend_loop
*set n (n + 1)
*set current "seen"&n
*if ({current} = true)
 *set total_read (total_read + 1)
*if (total_read = max_scenes)
 You're done! ${max_scenes} scenes were shown in a random order!
 *page_break play again
 *goto start
 *comment GOTO IS IN PLACE FOR DEMO PURPOSES, *FINISH WOULD PROBABLY BE MORE PRUDENT
 *finish
*if (n = total_scenes) 
 *return
*goto checkend_loop

Documentation

Configurable Variables

total_scenes This is the number of mini-scenes available for randomization, make sure it does not exceed the number of configured mini-scenes/labels.
max_scenes This is the number of times the system will display/randomize a scene for the player, it should not exceed the number of total_scenes.
labelprefix If you wish to prefix your mini-scene labels with something other than "miniscene_", change this variable. If you wish to merely name them by number, set this to "".


Other Options

Adding/Subtracting Scenes

To add a scene follow you must first create and set its "seen" variable to false, this should also be followed by the next integer (if it's your eleventh scene it should be seen11 etc):

*temp seen11
*set seen11 false

You should then create the scene itself:

*label miniscene_11
This is the mini-scene's content
*page_break
*goto nextscene

Last, but not least, update total_scenes and max_scenes as appropriate (more information on what they govern can be found above).

Repeatable Mini-Scenes

You can make a mini-scene NOT count toward the max_scenes to display by adding *set seen# false to it, like so:

*label miniscene_10
*set seen10 false
Scene 10
*page_break
*goto nextscene

This will also allow the scene to appear more than once. Note that doing this for every mini-scene will result in an endless game.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.