I'm going to post about the volume control because there's really not much else there to post about and I really like optimizing things:
The volume control (which is going to be a common event later I'll assume) is currently like this:
Code:
<Label 1>
Display sound settings / pick which to change
If it's BGM:
Input BGM Value
if it's 1, set volume of BGMs to 10%
if it's 2, set volume of BGMs to 20%
if it's 3, set volume of BGMs to 30%
if it's 4, set volume of BGMs to 40%
if it's 5, set volume of BGMs to 50%
if it's 6, set volume of BGMs to 60%
if it's 7, set volume of BGMs to 70%
if it's 8, set volume of BGMs to 80%
if it's 9, set volume of BGMs to 90%
if it's 10, set volume of BGMs to 100%
if it's invalid, GOTO 1
If it's SFX:
Input SFX value
if it's 1, set volume of SFXs to 10%
if it's 2, set volume of SFXs to 20%
if it's 3, set volume of SFXs to 30%
if it's 4, set volume of SFXs to 40%
if it's 5, set volume of SFXs to 50%
if it's 6, set volume of SFXs to 60%
if it's 7, set volume of SFXs to 70%
if it's 8, set volume of SFXs to 80%
if it's 9, set volume of SFXs to 90%
if it's 10, set volume of SFXs to 100%
if it's invalid, GOTO 1 |
But you also have seperate routines that change the system SFX/BGM. Why not just call those from this event, once you get the proper variables? No need to repeat yourself. Also, the error check isn't complete - it needs to either reset the variable to its original setting, default it to some number, or force a recheck. This is mainly because I can put in 39 and it still shows up as 39 even though nothing is done with it.
Best way is to do this indirectly - don't change the volume variables until you know that it's a good input.
Also, there's no cancel ability. Though you can still hit ESC, it's good practice to include that if you can indeed cancel with no ill effects.
Code:
<Label 1>
Display sound settings / pick which to change
If it's BGM:
Input tempNumber
If tempNumber < 11 then
{
BGM value = tempNumber
call SetBGMValues
}
else
{
Message "Invalid number"
GOTO 1
}
If it's SFX:
Input tempNumber
If tempNumber < 11 then
{
SFX value = tempNumber
call SetSFXValues
}
else
{
Message "Invalid number"
GOTO 1
}
If it's CANCEL:
<do nothing> |
You can also just use a single digit number for sound levels - 1 would be 20%, 2 would be 30%, etc, all the way to 8 = 90% and 9 = 100%. That way there's no need for an error checking routine at all since you can't input more than 9 anyway. That would make it:
Code:
<Label 1>
Display sound settings / pick which to change
If it's BGM:
Input BGM value
call SetBGMValues
If it's SFX:
Input SFX value
call SetSFXValues
If it's CANCEL:
<do nothing> |
Which is optimal, in my opinion. Who's going to miss that 10%, anyway? If you set it at 10%, you're not really going to hear much. Besides, the common user doesn't (and shouldn't) know that 1 = 20% - from that standpoint, it's just the "lowest" that the program will go before muting it entirely. The only issue would be having to set the setBGMValues and setSFXValues routines to use only 0-9 which might take a bit of time. Still, it'll translate to less work overall since for every new custom sound effect/BGM you throw in there you'll only have to do 10 settings instead of 11.
--------------------------------------------------
Also, if you're still reading this by now, what is the point of map0003? Or is that just a practice throwaway map?