|
Post by Rodak on May 7, 2005 9:42:22 GMT -5
This started as a tool for test play and was not intended for my game, but I like it and changed my mind.
I made a "Conductor's Baton" which is intended to stop and start the BackGround Music. When testing the same bits over and over for debugging I did not want to get sick of the music.
I made it stop the music just fine, but I am having difficulty restarting it.
Does "Sound : Temporary Save" hold after the script ends? If not all I made is a Music Shutter-Upper. Which is still good for test play, but it might be fun to have it as a fully functioning item for the game.
I tried using an indirect effect instead of a direct effect for saving the sound, thinking it would hold longer, but still no luck. Of course, since this is the first indirect effect I actually tried to make I may be missing something.
The script I used is short, so I'll just post all 9 lines of it here:
=========== Script Branch : Condition : Flag [Conductor Baton] On Sound : Replay Saved Data : Flag [Conductor Baton] Off Script : Condition End
Script Branch : Condition : Flag [Conductor Baton] Off Sound : Temporary Save Sound : BGM [None] Data : Flag [Conductor Baton] On Script : Condition End ===========
The Flag On bit first just proves that I think Backwards and the line break is just for ease of reading.
I think I may have to split the script in half making the save sound bit the indirect effect and the start/stop the direct effect. And then there is the old too many trees in the forest problem (despite Dungeon Warden's indispensible FAQ). But since the permutations are many, I'll just post this and get back to making something else. I put the "Scan Enemy HP" (see that thread if you care) project on hold because I need a day of simplicity and am working on VFX and other "easy" stuff. I may even (Gasp) take a day off of this stuff and just rest. I think making all that paint at work (I made 110 Gallons and we painted the building) (who says Chemistry and Art don't overlap?) left me with a status effect!
This one is not important, but I think if I can get it working I'll have a better understanding of the system.
Another Music question relates to Enter Map Scripts. They seem to mute any BGM set in World Organization. Is there a simple way around this without putting the BGM command in the enter map script itself?
|
|
|
Post by The Final Rune on May 7, 2005 9:46:45 GMT -5
I don't have an answer to your problem, but I would personally like to thank you for asking some of the most useful questions I have ever seen anyone ask. Here, have a cookie!
|
|
|
Post by doyleman on May 7, 2005 10:01:32 GMT -5
...I want a cookie.... I can't really help ya there, as I have noooo idea what's wrong.. it all seems like it should work.
|
|
|
Post by Rodak on May 7, 2005 10:27:44 GMT -5
OBOY!! Cookie for my tapeworm! (It's a Three Stooges Joke...probably unfashionable these days but some of the funniest guys ever!). I don't have an answer to your problem, but I would personally like to thank you for asking some of the most useful questions I have ever seen anyone ask. Here, have a cookie! Well, I like to think I can handle my easy questions all by myself. It really helps getting useful answers (and makes for better forum content overall) if you can say what you tried, what happened, and what you wanted to happen when seeking advice. And to Doyleman; Yup. I hate it when a script that seems flawless does not do what you want. Am I the only one who has ever had the system do something like that and when you rewrite the script exactly (no copying and pasting) it works? That happened to me once and I just thought it was my mistake, but now I don't know... IT'S ALIVE!!
|
|
|
Post by Dungeon Warden on May 7, 2005 12:51:36 GMT -5
The way you script is written, you could use the following script and do the same thing.
Sound : Replay Saved Sound : Temporary Save Sound : BGM [None] Data : Flag [Conductor Baton] On
This is because you turn the flag off and back on again so that it is alway on. The conditions don't matter since the flag will always be in the position needed to activate that condition. You need to add Force Script End to avoid this.
Script Branch : Condition : Flag [Conductor Baton] On Sound : Replay Saved Data : Flag [Conductor Baton] Off * Force Script End * Script : Condition End
Script Branch : Condition : Flag [Conductor Baton] Off Sound : Temporary Save Sound : BGM [None] Data : Flag [Conductor Baton] On Script : Condition End
Sound: Temporary save should last past the script. In the battle scripts, the BGM is saved at the begining of battle and restored at the end, going through several scripts in the process. I thing the lack of a Force Script End is the problem.
|
|
|
Post by vespuleth on May 7, 2005 13:38:41 GMT -5
i have had a problem where the script didnt work, and then i rewrote it exactly and it did. also, i think im making the cookie an icon, if tfr will let me (?)
also, i do agree that you are asking some great questions. we are all glad to have you around.
|
|
|
Post by Rodak on May 7, 2005 14:12:12 GMT -5
Amazing.
Dungeon Warden you know this system too well.
I would have sworn that having the condition specifically stating to only apply that bit if the flag was off was enough. Why does it apply that and not just go straight to the Branch End?
Does it do that sort of thing elsewhere? This could solve a lot of my debugging issues!!
And for those who need it spelled out specifically:
=========== Script Branch : Condition : Flag [Conductor Baton] On Sound : Replay Saved Data : Flag [Conductor Baton] Off * Force Script End * Script : Condition End
Script Branch : Condition : Flag [Conductor Baton] Off Sound : Temporary Save Sound : BGM [None] Data : Flag [Conductor Baton] On Script : Condition End ===========
This makes a working Conductors Baton. This is great for test play debugging. I try to make good music choices and tweakings, but sometimes... well I'm sure we all experienced the feelings that made me want to have this on hand while debugging the same bit repeatedly.
Thanks again.
And I gotta point out that I would not bother asking such great questions if it weren't for the even better answers I get. I like having this pace around too.
Peace.
EDIT: Nevermind the bit about wondering how I missed the need for a Force Script End. Looking at it after watching an hour of Bugs Bunny to clear my head I can see where it is essential. It's obvious now. Bugs is Good Medicine for whatever ails you!
|
|
|
Post by Doan the Nado on May 8, 2005 22:04:25 GMT -5
Just to clarify, this happens because RPGM2 (and most all programming languages) steps through the programming code in order. So let's step through with a few cases:
First of all, let's turn the flag off and run the first script: Flag [Conductor Baton] On ? ... no, skip to end of condition Sound : Replay Saved Data : Flag [Conductor Baton] Off Script : Condition End
Flag [Conductor Baton] Off ? ... yes, execute condition block Sound : Temporary Save Sound : BGM [None] Data : Flag [Conductor Baton] On ... the flag is now on Script : Condition End
The script terminates and now does exactly as it is supposed to. Now, let's turn the flag on and test it out: Flag [Conductor Baton] On ? ... yes, execute condition block Sound : Replay Saved Data : Flag [Conductor Baton] Off ... flag is now off Script : Condition End
Flag [Conductor Baton] Off ? ... yes, execute condition block Sound : Temporary Save Sound : BGM [None] Data : Flag [Conductor Baton] On ... flag is now back on Script : Condition End
Hopefully you can see that the way you wrote the script caused it to do both actions when it was only supposed to do one. That's why DW suggested adding the Force Script End command... it will skip the second block. Another alternative that may save some memory (it's always good to save every little bit you can) and avoid the use of the troublesome Force Script End command would be this:
Data: Flag [Conductor Baton] Switch (there should be an option to switch the flag) Script Branch : Condition : Flag [Conductor Baton] On Sound : Replay Saved Script : Condition End Script Branch : Condition : Flag [Conductor Baton] Off Sound : Temporary Save Sound : BGM [None] Script : Condition End
That will cause the button (or however it's activated) to merely switch the flag and then check it to see what should be done. Just a little suggestion... operationally, it will do the exact same thing, but it's slightly more efficient by eliminating two command lines.
|
|
|
Post by Rodak on May 9, 2005 5:08:36 GMT -5
Thanks for the clarification.
I noticed what I was so stupidly missing after I watched some Bugs Bunny to clear my head (see thye edit at end of my last post). I still use RPGM2 with my brain in Play Mode and often am not as efficient as when I switch my brain to "Work Mode".
But I guess it was wise to explain it all in more detail for those who did not notice. And I like the shortened version. I'll give it a try! It is what we old programmers call "Elegant."
Peace.
============= EDIT: =============
I Actually found a glitch with the concept that may make for more work than was anticipated, but makes for a cool solution to the problem.
The glitch is this: If you change the music when the party boards a vehicle, and they use the Baton while on the vehicle, the music they restore when they get on the world map again will be the vehicle music!
The solution, of course, is to create a database (script) of all music settings and make each one set to a unique number in a variable set up for this purpose. Then have it call the music from there rather than using Temporary Save and Replay. Just do not set a value for the vehicle music and they will return to the music from the map.
But what if they like the vehicle music? Then using the item to restore music can open multiple choice window with all sountracks available! Just use the 8th multiple choice for "More Choices" and the rest should be easy, but involved and tedious.
But if Leopold Stokowski or Carl Stalling were here, they would say that more music choices are better than too few!
It's amusing how these things snowball from little distractions to major projects. That is the thing about RPGM2 I like best.
|
|