Post by GCN on Nov 7, 2007 15:45:46 GMT -5
This time we're going for a watch item, in the form of a message window. There are many ways to make one, and a few options are treated here. I assume you've already finished step 1 and 2.
Open Database, go to Common Event. Create a new Parallel event, called Watch. Mark Appearance Condition Switch on, and use a new switch called Watch as the Condition Switch.
Inside the parallel event, start a message (use command 'Show Message', clear enough I'd say). Now I prefer my watch centered inside the message window, displaying at once. And that's what we're going to do. Inside this message, start on the second line with '>'. This initiates a line that's shown at once, instead of the 'rolling' display you usually have. If you want the rolling display, simply don't type '>' at the beginning of the line. Now, press spacebar 10 times and type 'Time: '. After 'Time: ', type 'v[' followed by the variable number you used for HOURS. Assuming it was variable 2, you should type '2]', resulting in a total of 'v[2]'. This message command displays the value of variable 2 on that place. After that, type ':', followed by another 'v[ ]' now filled with the variable number you used for MINUTES. Finish the line with '<' if you typed '>' at the start of the line. This line will show instantly in-game.
EXTRA STEP: Add months and years (continued)
Coding level [***--]
Press enter. Start the third line the same as the second: '>' if you want instant display, then 10 spaces. After that, type 'Date: ', followed by 'v[ ]' filled by the variable number of DAY, then another 'v[ ]' with the variable number of MONTH, finally a 'v[ ]' filled with the variable number of YEAR. It may be nice to add between those three 'v[ ]' commands stripes or slashes, but I leave that up to you. Finish the line with '<' if you want instant display.
END OF EXTRA STEP
Done. Well, not completely. You see, if MINUTES holds a value 10 or higher, there's no problem. Like 7:58, 16:45, 23:13. But if MINUTES is lower than 10, you get 23:3, 7:9, 13:6. Indeed, we're missing a zero. The easiest way to solve this, is to create a Fork: Fork MINUTES, smaller than 10 (excluding 10), add Else Case. Copy the Message you made in both the Fork and the Else Case. But in the Fork, add in the message on the second line between ':' and the 'v[ ]' of MINUTES, a zero. Problem solved. Now, on the end of the parallel process, switch Watch OFF.
Go to tab 'Item', create an new item of the type 'Switch' and make it switch ON Watch. Congratulations, you just made a basic watch. You can check in your game if it works. If you chose to insert date in your time system and you want your watch to show the name of the month instead of the month number, continue to the extra step. If you're already satisfied, skip the next extra step.
EXTRA STEP: Add months and years (continued)- month names
Coding level [***--]
On the Hero tab, pick a new hero. This is going to be our month name container. Call him -Month- or something. Go back to Common Event, to your parallel process Watch. In both your messages, change the 'v[ ]' command of MONTH to 'n[ ]' with the hero number of our new month name container between the brackets. I use Hero #2 as my container, which means I use 'n[2]'. Now, before the Fork 'MINUTES smaller than 10', start a new Fork: Fork MONTH, same as 1. Inside this fork, use the command Change Hero Name to change your month container's name to 'Jan' or 'January'. Copy and paste this Fork, and change this Fork 'MONTH' to 'same as 2' and change the Change Hero Name to 'Feb' or 'February'. You guessed it, do the same for all months.
Your watch should now display the month names.
END OF EXTRA STEP
EXTRA STEP: Self-refreshing watch.
Coding level [**---]
To make a good refreshing watch, or a good watch in general, I advise you to start coding seriously and use pictures. This self-refreshing watch will do in the meantime. The downside is that it can only be exited between the refreshes, so the exit key must be held down until the watch refreshes...
At Common Event, go to your watch parallel process. Add the command 'Cycle' (aka loop). This command will continue to repeat everything within itself until it's stopped by the 'Break cycle' command, or the process/event itself is terminated.
Copy the whole parallel process inside this cycle. At the bottom of the cycle, insert the command 'Input Key' (aka Enter Password, odd translation). For this command, pick a new variable and call it [w]Input key. Mark the button you want to use to exit the watch. I used the enter button, but feel free to use others, or multiple. In any case (this is for rm2k3 users only) make sure 'Wait until key it' is unmarked. Right after 'Input Key', start a new Fork: Fork [w]keyinput, other than 0. Cut the Change Watch switch OFF command made earlier and paste it into the Fork. After this command, input the Break Cycle command.
You also need your messages to automatically quit. At the end of line 3, insert the 'wait 1 sec' message command typed like '|' a few times to give the player some time to read the watch. Three or four times '|' should be enough. At the end of the row, insert '^' to make the message auto-shut. Don't forget to apply this to both messages. You may also want to mention in your watch messages that the player needs to hold a certain key to exit the watch.
Your self-refreshing watch is now done
Open Database, go to Common Event. Create a new Parallel event, called Watch. Mark Appearance Condition Switch on, and use a new switch called Watch as the Condition Switch.
Inside the parallel event, start a message (use command 'Show Message', clear enough I'd say). Now I prefer my watch centered inside the message window, displaying at once. And that's what we're going to do. Inside this message, start on the second line with '>'. This initiates a line that's shown at once, instead of the 'rolling' display you usually have. If you want the rolling display, simply don't type '>' at the beginning of the line. Now, press spacebar 10 times and type 'Time: '. After 'Time: ', type 'v[' followed by the variable number you used for HOURS. Assuming it was variable 2, you should type '2]', resulting in a total of 'v[2]'. This message command displays the value of variable 2 on that place. After that, type ':', followed by another 'v[ ]' now filled with the variable number you used for MINUTES. Finish the line with '<' if you typed '>' at the start of the line. This line will show instantly in-game.
EXTRA STEP: Add months and years (continued)
Coding level [***--]
Press enter. Start the third line the same as the second: '>' if you want instant display, then 10 spaces. After that, type 'Date: ', followed by 'v[ ]' filled by the variable number of DAY, then another 'v[ ]' with the variable number of MONTH, finally a 'v[ ]' filled with the variable number of YEAR. It may be nice to add between those three 'v[ ]' commands stripes or slashes, but I leave that up to you. Finish the line with '<' if you want instant display.
END OF EXTRA STEP
Done. Well, not completely. You see, if MINUTES holds a value 10 or higher, there's no problem. Like 7:58, 16:45, 23:13. But if MINUTES is lower than 10, you get 23:3, 7:9, 13:6. Indeed, we're missing a zero. The easiest way to solve this, is to create a Fork: Fork MINUTES, smaller than 10 (excluding 10), add Else Case. Copy the Message you made in both the Fork and the Else Case. But in the Fork, add in the message on the second line between ':' and the 'v[ ]' of MINUTES, a zero. Problem solved. Now, on the end of the parallel process, switch Watch OFF.
Go to tab 'Item', create an new item of the type 'Switch' and make it switch ON Watch. Congratulations, you just made a basic watch. You can check in your game if it works. If you chose to insert date in your time system and you want your watch to show the name of the month instead of the month number, continue to the extra step. If you're already satisfied, skip the next extra step.
EXTRA STEP: Add months and years (continued)- month names
Coding level [***--]
On the Hero tab, pick a new hero. This is going to be our month name container. Call him -Month- or something. Go back to Common Event, to your parallel process Watch. In both your messages, change the 'v[ ]' command of MONTH to 'n[ ]' with the hero number of our new month name container between the brackets. I use Hero #2 as my container, which means I use 'n[2]'. Now, before the Fork 'MINUTES smaller than 10', start a new Fork: Fork MONTH, same as 1. Inside this fork, use the command Change Hero Name to change your month container's name to 'Jan' or 'January'. Copy and paste this Fork, and change this Fork 'MONTH' to 'same as 2' and change the Change Hero Name to 'Feb' or 'February'. You guessed it, do the same for all months.
Your watch should now display the month names.
END OF EXTRA STEP
EXTRA STEP: Self-refreshing watch.
Coding level [**---]
To make a good refreshing watch, or a good watch in general, I advise you to start coding seriously and use pictures. This self-refreshing watch will do in the meantime. The downside is that it can only be exited between the refreshes, so the exit key must be held down until the watch refreshes...
At Common Event, go to your watch parallel process. Add the command 'Cycle' (aka loop). This command will continue to repeat everything within itself until it's stopped by the 'Break cycle' command, or the process/event itself is terminated.
Copy the whole parallel process inside this cycle. At the bottom of the cycle, insert the command 'Input Key' (aka Enter Password, odd translation). For this command, pick a new variable and call it [w]Input key. Mark the button you want to use to exit the watch. I used the enter button, but feel free to use others, or multiple. In any case (this is for rm2k3 users only) make sure 'Wait until key it' is unmarked. Right after 'Input Key', start a new Fork: Fork [w]keyinput, other than 0. Cut the Change Watch switch OFF command made earlier and paste it into the Fork. After this command, input the Break Cycle command.
You also need your messages to automatically quit. At the end of line 3, insert the 'wait 1 sec' message command typed like '|' a few times to give the player some time to read the watch. Three or four times '|' should be enough. At the end of the row, insert '^' to make the message auto-shut. Don't forget to apply this to both messages. You may also want to mention in your watch messages that the player needs to hold a certain key to exit the watch.
Your self-refreshing watch is now done