Letter Minigame
Authors: Zeriab
Version: 1.2
Type: Logical Minigame
Key Term: Minigame
IntroductionThe Letter Minigame has been made by Zeriab.
Thanks goes to RMXP for making this possible and Near Fantastica for the Anti Event Lag Script.
Credits should be given.
The purpose in the Letter Minigame is to get a good score by collecting as many letters in the maze as possible within the time limit.
Different letters give different amount of points.
You can see how much each letter gives by looking at the letters on this island.
The more points the rarer the letter.
A yellow letter = 10 points
A green letter = 15 points
A azure letter = 20 points
A red letter = 25 points
A purple letter = 30 points
A black letter = 100 points
Version HistoryVersion 1.2:Fixed an issue which might cause immense amounts of memory to be used.
Version 1.1:Adds $letter_minigame.score - works also after $letter_minigame.dispose.
Gives a solution to the F12 issue present in the earlier demo.
Screenshots
DemoYou download my demo from:
http://www.mediafire.com/?mjqe21okk4c
ScriptThe script is too big to put it in here so I have place it in a text file which can be downloaded here:
http://www.mediafire.com/?ynqbzmmjjmd
InstructionsHere I will try to explain how the scripts is used.
I have split this section in two.
One for the Maze Generator. This generates the maze and places the events.
This is not linked with the Letter Minigame.
One for the Letter Minigame. This controls the letters collected and the visual effects.
This is not linked with the Maze Generator. A normally made level could be used.
You can look at the scripts in the end of the scripts editor.
I have also edited some of the normal scripts in the demo. These has been marked by having a * in front of its name in the script chooser.
This is the Maze_Generator module.
To call it use this syntax:
Maze_Generator::Maze.new(x, y, max_chance, array_of_events, value=0, layer=1)
x : x-coordinate for starting point
y : y-coordinate for starting point
max_chance : The total chance used for choosing among the events
array_of_events : Numbers on events paired with their chance value
value : value of the tileset assigned to the maze (default=0)
layer : the layer that will be crawled (default=1)
An example could be:
Maze_Generator::Maze.new(49,49,300,[[2,22],[3,19],[5,17],
[6,14],[7,10],[9,2]],0,1)
Notice the how you should write the array_of_events.
The first number is the number on the event you want.
In this example the script will start in 49,49 and spread out from there.
It will change the tiles on layer 1 to 0 if it's not already 0.
You can encapsulate the maze by making a border of tiles with 0 as value.
Otherwise it will be restricted by the map borders.
In dead ends it might place an event.
The second value you see in each pair shows the change that the corresponding event is spawn. It is compared to the total probability.
There is a 22/300 chance of event number 2 being spawned in a dead-end.
There is a 19/300 chance of event number 3 being spawned in a dead-end and so on.
The originally placed events WILL be deleted.
Don't let the user save the game in a map where you have used the Maze_Generator as the changes will not be saved.
This is the letter minigame itself.
Managing how many of which letters are collect and showing the stats.
To call it use this syntax:
$letter_minigame = Letter_Minigame.new(array_of_events, array_of_points)
array_of_events : Numbers on the events used.
array_of_points : The amount of points for the corresponding event in
array_of_events. Linked by placement.
$letter_minigame is the reference used by the results screen.
An example could be:
$letter_minigame = Letter_Minigame.new([2,3,5,6,7,9],[10,15,20,25,30,100])
This will take and use the graphics from event number 2,3,5,6,7 and 9
The latter shows the amount of points each element is worth.
The first element will have the graphic from event number 2 and be worth 10.
The second element will have the graphic from event number 3 and be worth 15 and so on.
The events you should collect must contain this line as a script:
$letter_minigame.add(position)
position : Position of the element in the array. First position = 0
For example the syntax
$letter_minigame.add(0)
Should be put in the events which has the graphic of event number 2 and are 10 points worth.
$letter_minigame.add(1)
Should be put in the events which has the graphic of event number 3 and are 15 points worth and so on.
Now when the minigame is finished used this syntax to call the results screen.
$scene = Letter_Result_Menu.new
This will gather information from $letter_minigame
You might have an interest in changed the results screen accordingly to your needs. Feel free to do so
The command $letter_minigame.score returns the score.
This works even after the $letter_minigame.dispose command is used.
That is because .dispose leaves the little information needed for calculation the score.
You can for example use this for giving prizes afterwards.
FAQHow could I make a maze that has no timer on it with this script? Cause I wanna make a maze, and put a boss in it, but I want the maze to be randomized, and I don't want the timer either. The other thing is, how can I set this up so that I can have just the 1 boss event in it in a specific spot, and not have to worry about that spot being in a wall, or unreachable because the maze wasn't made right.Quote from: long answerThe timer part is easily solved because the event in the top-left corner is controlling the timer.
For what you want you don't need the Letter Minigame, just the Maze_Generator module.
You don't need the $letter_minigame = Letter_Minigame.new([2,3,5,6,7,9],[10,15,20,25,30,100])
You would only need something like this: Maze_Generator::Maze.new(49,49,0,[],0)
This will create a maze where no events are spawned.
Now can you find a plaze where there with certainty is no wall?
Yes. The starting point you give.
Considering the above example the square at 49, 49 will be empty.
There might be more certain squares, but I'm not sure.
I do however know that there is a pattern linked with the probability of a square being a wall.
If S is the starting point then the pattern will look like this:
Quote
X0X0X0X
0P0P0P0
X0X0X0X
0P0S0P0
X0X0X0X
0P0P0P0
X0X0X0X
It will continue to spread outwards like that.
Symbol Explination:
S: Starting point
P: Very high possibility of being a passable square (non-wall), above 90% I'd say. Probability decreases near edges.
O: Might be a wall, might not. No significant difference is probability.
X: Is most certainly a wall.
So you can put your boss on the starting point for certainty or on one of the P's for a very good chance of not being in a wall. (Don't put the boss near an edge in this case)
There might also be another solution you can use.
You see the X's are most certainly a wall.
What now if the wall was passable and the other wasn't?
That way the script would create the wall.
As the script create an acyclic graph (you don't have to understand this term) you be certain that there is a way from outside into any, yes... ANY of the X-squares.
If you do not have a rim around the maze you can however not be sure of a way from one X to another.
Something like this might do the trick:
Maze_Generator::Maze.new(49,49,0,[],48)
The 48 tells the script to use the tile graphic with id 48. Before 0 was used.
48 is generally water.
I don't know the system for this. I just found out with trial and error.
If you are creating a wall rather than a path you can also encase an area or the maze itself by putting the title with id-48 on the P's.
There will be a walkable path around the P.
You have to something like because I haven't scripting in the possibility to have just one and no more than one of a certain event places somewhere in the maze.
I or you could try to simply put the event on the last square touched by the crawler. (Script edit)
I hope you will find my answer satisfying.
How do I set up item prizes?
For example, if I had 250 points, I win a potion or something like that.Using this command will return the score:
$letter_minigame.scoreFor non-scripters you can use the
Call Script command with
$game_variables[10] = $letter_minigame.score, where the 10 is the variable number. Just set it to the number of the variable you want to use.
Now that you have the score in a variable I assume that you can do the rest.
CompatibilityIs not compatible with saving and loading. The map will reset if loaded.
Might be SDK compliant.
Credits and ThanksI would like to thank RMXP - Underground personal for creating a scripting contest which inspired me to create this work.
I would like to thank everyone using their time to try this and finally I would like to thank everyone reading this topic.
Thanks.
Author's NotesI suggest using
Near Fantastica's anti event lag script due to the often high amount events.
This script can create more than 1000 events. I suggest however that you refrain from designing level where this is an eminent possibility.
Using the event command
Erase Event will not entirely delete the event.
The event still exists in the $game_
map.events and lags about as much as a blank events.
And finally: ENJOY!
- Zeriab