It's about time this site got one of these threads!
Here is the sum of my contributions to this concept at other sites (all for RPGM2):
===============
Put the camera behind the character:
Data:Game Info Load
Script Branch Sort:Variable {85?} [Party Dir]
Apply if=0
Camera Rotate E : Frames=15
Branch : To End
Apply if=1
Camera Rotate SE : Frames=15
Branch : To End
Apply if=2
Camera Rotate S : Frames=15
Branch : To End
Apply if=3
Camera Rotate SW : Frames=15
Branch : To End
Apply if=4
Camera Rotate W : Frames=15
Branch : To End
Apply if=5
Camera Rotate NW : Frames=15
Branch : To End
Apply if=6
Camera Rotate N : Frames=15
Branch : To End
Apply if=7
Camera Rotate NE : Frames=15
Branch End
===========
I was gonna use this as my [] button script and call it "examine" but I'm not sure now... either way it is useful :
Call Script [Camera Behind] *see above*
Apply together
Party:Hide Party
Camera:Viewpoint Angle=1 Degree Frames=15
Camera:Distance =100 Frames=15
Input : User Button : Constant wait
Apply together
Party:Show Party
Camera:Default Frames=15
This zooms in on whatever the character is looking at just at that moment.
I found too many instances where I needed to adjust the height as well so I may not use it for the [] button, but it (or a variation of it) gets a lot of use in other circumstances.
===============
To change the BackGround Music in a Boss Fight (or any other "Event Battle"):
Sound : Temporary Save
Sound : BGM=[moo!] vol=...
Script : Apply Together
Screen Effect : {all squares black with 0% Transparency} : 40 Frames
Effect : Apply Wipe
Other : Wait : 40 Frames
Script : Apply In Order
Other : Event Battle: ("Uncheck" Battle Start Defaults Box)
Sound : Replay Saved
The 40 frame rate set in two lines above is equal to the 40 frames the system takes to transport you to the battle screen.
This script can easily be tweaked and modified to allow for things like using the "other" wipe {the one not set in default settings} for boss battles (first set wipe, then apply).
If you used a character (or object) look-alike for an intro to the Boss Fight you can have them perform a "Ya Got Me, You Racially Impure Lower Life-Form" (A real line from my game) scene, then flash and vanish (or whatever you like) right after this bit of script.
You can even lead right into a second fight with no chance to heal.
=======================
Well, well.
I done solved sumpin.
OK, I had a thread or three running about custom battle endings and such. Here is a summary of the results.
This is a modification to the Default Battle System to allow you to make a custom animation for enemies {in this case a flee motion} and call it smoothly through the default battle system. In the example given, fleeing also ends the battle. The flee will apply to all enemies in a group, but could easily be modified to allow for a chance one or more might not run. But why do that? After all this work I wanna watch my custom enemy fleeings! I made one for darn near every enemy before it occurred to me that I better be able to use them properly. Run, Cowards, Run!! Nyah-Ha-Ha!! Flee before the might of... Umm...
Oh... There you are.
First you will need to have a direct effect that will start this. The only thing it really needs to do is trip two flags. In the scripts these are called the [GO AWAY] Flag and the [NO DAMAGE ACTIN] Flag. Attatch this script however you want to whatever you want. Set your percentage chance of failure there. I can not pretend to fully understand Direct Effects (yet) but with the help of Dungeon Warden's FAQ, and other advice, I got this working nonetheless. If you need help with the Direct Effect refer to that document or just ask. Basically all you need to do is make a system event of the script and put it in the Success slot of the Direct Effect. If you attatch this Direct Effect to an item, you can call it "Picture Of Barbara Streisand" and when you show it to the enemy, they run away. Or do something more to your own taste.
Further I used enemy action 7 in my example because I was already using 5 for experiments and I could not use 6 because I have a Prime Number Fetish. 6 is an unclean number! Read Pythagorus. 7 is nice. The simplest flee to create is simply to have the enemy turn around 180 degrees and move along the Y axis off into the distance, shrinking to nothing in the process. A tip for doing that would be to copy the "wait" action and paste into enemy action 7 first. That way it won't look like a statue sliding off into the distance.
OK that's how to set it up. Now the good part.
Oh yeah, the No Damage Action Flag is to stop the enemy from displaying their "Damage" Enemy Action. That is the default reaction to a successfull targeting. Even if the effect asociated with the targeting does no damage (like the "View Enemy HP" effect on which I am still working). Stupid Default system.
Now to the good part:
Modify Script "Damage Enemy" to read thus:
-------
000-Script Branch:Condition:Flag [NO DAMAGE ACTIN] Off
001- Battle:Enemy Action:[Damage]:Apply
002-Script:Condition End
003-Script Branch:Condition:Flag [GO AWAY] On
004- Battle:Check Who Goes First
005- Script Branch Repeat:Flag [110:Member Check]:Off
006- Script Branch:Condition:Flag [72:Instigator Side] On
007- Battle:Enemy Action [Enemy Action 7]:Apply
008- Script:Condition End
009- Battle:Check Who Goes Next
010- Script Branch End
011-Data:Flag [NO DAMAGE ACTIN] Off
012-Script Control: Force Script End
013-Script Condition End
014-Battle:Default Enemy Action
-----------
Next we do the same thing for the "Critical" Script
----------
Nevermind.
I did not notice until just now typing, but these scripts are identical. Good thing I just cut and pasted and looked for something to change. Originally these scripts read like this:
Script 40: Damage Enemy
000- Battle Enemy Action (Damage) Apply
001- Battle: Default Enemy Action
Script 41: Critical
000- Battle Enemy Action (Damage) Apply
001- Battle: Default Enemy Action
Almost there. Now go to the Script "Attack Success" and modify thusly:
-----------
000-Text: Clear Message
001-Battle: Make active character
002-Script Branch:Condition:Flag [GO AWAY] On
003- Battle:Check Who Goes First
004- Script Branch Repeat:Flag [110:Member Check]:Off
005- Script Branch:Condition:Flag [72:Instigator Side] On
006- Target Data:Action Status Apply:[Flee]
007- Script:Condition End
008- Battle:Check Who Goes Next
009- Script Branch End
010- Data:Flag [NO DAMAGE ACTIN] Off
011- Script Control: Force Script End
012-Script Condition End
013-Script: Call (Reduce HP)
014-Battle: Make active character
015-Script: Call (Target Name)
016-Text: Message 'was hurt for'
017-Text Content: Variable: Display (Damage Total) Digits not fixed
018-Script Branch: Condition Variable (damage total)=+1
019- Text: Message
020- Script Condition End
021- Script Branch: Condition Variable (Damage Total)=/1
022- Text Message
023- Script Condition End
-------------
The "Attack Critical" script gets the same treatment. While not identical to the Attack Success script it is close enough that I should not have to type it here. But, as always, if you need it just ask.
Beacuse of the nature of my game I had to modify the "Attack Start" script to display appropriate text. That is done with a script branch condition.
This little bit of scripting took a while to get running smoothly. Seee the threads related to "Custom Battle Endings" for the Evolution (or Intelligent Design for you Fundamentalists out there) of this concept.
Now let's see more like this posted here! It's supposed to a place we can pool our knowledge and make everybody else's game better (as well as our own). And if you plan on playing other folks games, you do want them to be as good as possible, don't you? Remember : the "Common" in Common Script Database means Communal, not frequently used!
--------------
Post Script: I just noticed I never turned off the Go Away Flag! I was only testing the effect for success. This is obviously not fully debugged. I think the flag should be turned off from the direct effect "Turn End" slot. I will experiment and ammend this post later.
Peace.
-----------------
Post Post Script:
HEY!!! You mean I took the time to indent my scripts so they would look better and the board won't acknowledge my hard work?
No need to answer... I just needed to vent.
Oy.
@#$%&****$#@++=
And Yet Another Edit:
This Time I just don't get it. Remember a few rants ago when I said I had to turn off the GO AWAY flag? And I said I was going to put it in the Turn End slot of the Direct Effect?
Well it did not work. With the command there anybody could perform anything that targeted the enemy successfully and they would flee.
I had to switch the script to "Turn Start."
While I can fully understand why this would work, I am equally at a loss to understand why it does not work in the other position. Sure, if it is turned off at the start of the character's turn it will not carry into that fight, but it seems to me that if it is used during the fight and makes the enemy flee, it would still be on at the start of the next fight. Which is why turning it off then works, but I still think if somebody else acts before that character's turn (the one with the direct effect) starts, the enemy should flee. But they do not. I tested it. Further, why does turning it off at the end fail? That seems to me to be the logical time for resetting the flag (Logic is a reef of pretty flowers... that smell terrible!).
Two things I have said before come to mind: First; I think Backwards. This comes in handy with science and math but is a positive hinderance in the real world. Second; BLOODY FILE SHARING SYSTEMS!! Bleedin', Bloody, Bloomin' File Sharing Systems!! Blimey.
++++++++++++++++++
Final Edit (yeah, right...)
++++++++++++++++++
This issue has been resolved in another thread. I felt it wrong to start a Q&A in the database. I can provide a link to that thread for those who care (it's on another site).
@@@@@@@@@@@@@@@@@
True to life, actually verifiable Final Edit For Real This Time!
@@@@@@@@@@@@@@@@@
Here is a link to a video of a demo of this in action:
http://www.vidilife.com/index.cfm?f=med ... F67-B7DF-1
===================
A little trick to fill a map with tiny scrambling "mice" for effect.
Set this Action Script to the motion slot of an event with a resized (smaller) fish for a model. I named the event MEESES, but you can call it anything you like.
Script Branch: Repeat: Flag [Off Fixed]: Off
Event Control: Duplicate [MEESES]: Coordinates (+1, +1, 0)
Event Move: Bypass Members=Yes
Event Action: Random Move Facing=Movement 4F (Set the E/W and S/N values very high... I used 111 for all 4 slots and kept the height adjust at 0)
Script: Branch End
Place the event at coordinates 0, 0, 0 (or whatever Z coordinate is ground level). There is no content script, so you can set "Start" to anything you like or just ignore it.
This gives a map full of tiny little meeses running every which way. The map I used was relatively flat and that matters as meeses can get caught inside things and not be able to move. You do not want to use Bypass Objects to get around this as it causes them to run through everything.
Just another "little touch" to make dungeons and other areas more interesting.
+=+=+=+=+=+=
EDIT:
+=+=+=+=+=+=
I remembered I originally did have a content script in this!
I made a squeaky sound and set the "start" condition to Equal.
That way when you stepped on them, they made noise.
I did not like the results enough to keep, but it was worth mentioning.
=======================
Here is the script that runs the heart of the puzzles in the "Puzzle Room" of my Clean Underwear Quest demo (another shameless plug!). Basically you are stopping a spinning block with a carefully timed button press. Each side of the block has a different texture. I used three variations; a single block with the candle texture lit on one face and unlit on the other three; a four block puzzle with four "corner textures" that line up only on one of the faces (2 combinations that do not form patterns and one that does, plus one side blank for the "null position"); and a sadistic 9 piece puzzle.
The nifty part is the timing part. You need only a little practice to get it down, so it seems a well constructed script. I found the hard part to be getting a "Deny" sound to play when the button press was mistimed.
There are messages based on conditions surrounding this script excerpt, but they would be different for everybody, so here is the hard part (this script is attached to a "lever" object, so the "single action" command simply "flips the switch"):
Data: Flag: [Puzzle X Solved]: Off
Sound: SFX [Door Squeak]
Event: Effects: Single Action {check the "Disable Motion After" box}
Event Control: Change Target to [Puzzle X Piece X]
Script Branch: Repeat: Variable [User Button] /= {not equal to} 4
Sound [Switch 2]
Script Control: Apply Together
Event Move: Rotate Clockwise 90 degrees: 2 frames
Input: Buttons: Wait 2 frames
Script Branch: Sort: Variable User Button
Script Branch: Apply If: Number is +4
Sound: SFX [Deny]
Script: Branch End
Input: Buttons: Wait 3 Frames
Script: Branch End
Event Control: Event Info Load
Data: Variable [Puzzle Attempts] = [Puzzle Attempts] + 1
Script Branch: Condition: Variable [Event Dir] = +2 {or whatever}
Sound: SFX [Bell]
Text: Message "THAT'S IT!"
Data: Flag: [Puzzle X Piece X] On
Data: Game Info: Save
Script: Condition End
Text Message: "Wasn't Dat Fun?" {uncheck "Close Window" box}
Script Branch: Sort: Variable [User Button]
Script Branch: Apply if: Number is +4
Input: Buttons: Constant Wait
Script Branch: To Top
Script Branch: End
Text: Close Window
Script: Condition End
At the end, after the messages, I call a script to check all the flags for all the pieces of that puzzle. If they are all on I trip another flag for the entire puzzle (which controls the very beginning of the script messages). Of course the One-Piece Puzzle does not need to call a script, but the 4 piece and especially the 9 piece, puzzles need it.
The "Number of tries" variable is there so I could do something nice if they keep trying, and failing. I figure I'd just give it to those who have difficulty with the timing, but keep trying anyhow. If the variable gets big enough, I can slow it down or give them it outright, just as a reward for trying so hard (and because you do not want the player to lose interest or get completely stuck with no way to continue).
Peace.
+++++++
EDIT:
+++++++
The "Wasn't Dat Fun?" question part is essential to the script, even though it seems irrelevant. You need to change the value of the user input or it will confuse the script when it runs the next puzzle piece. The way I have it set up any button other than Triangle will close the window and change the user input variable's value.
If anyone knows a better way to do this, please let me know.
=======================
Here's one that gave me more trouble than it had any right to give, so I'm posting it here in case anyone else is as slow as me about these things.
It is
a way to keep random things more random by preventing repeats. I have found that I can generate the same random number 3 or 4 times in a row and that can really ruin some aspects of gameplay if the randomized bit needs variety.
This is a very useful concept for making random things appear more random. It is set up for ten different possibilities with no repetition for at least 4 turns.
Script Branch: Repeat: [Temp Variable 8] =/= {not equal to} 100
__Data: Variable: [Temp Variable 9] = 0 ? 9
____Script Branch: Condition: [Temp Variable 9] = [Last Try]
________Script Branch: To Top
______Script: Condition End
____Script Branch: Condition: [Temp Variable 9] = [2 Tries Ago]
________Script Branch: To Top
______Script: Condition End
____Script Branch: Condition: [Temp Variable 9] = [3 Tries Ago]
________Script Branch: To Top
______Script: Condition End
__Text: Message "" {No entry; Uncheck "close window" box}
__Text: Content: Variable: Display: [Temp Variable 9]
__Data: Variable: [Temp Variable 8] = [Temp Variable 8] + 1
__Data: Variable: [3 Tries Ago] = [2 Tries Ago] + 0
__Data: Variable: [2 Tries Ago] = [Last Try] + 0
__Data: Variable: [Last Try] = [Temp Variable 9] + 0
Script: Branch End
Text: Message "MOO!" {Check "close window" box}
____Data: Variable: [Temp Variable 8] = 0 + 0 {for repeat uses}
This gave consistent strings with no repeats for at least 4 numbers.
While this is written in the form of a test script (one that displays the results in conversation form and intended to be placed on an NPC) it could be adapted by replacing the text lines with a Sort command and a few (10) "Apply If's" for your chosen actions. And the overlayed repeat loop (the one for temp variable eight) can be removed too. It was just there so I could get a long enough list to detect duplications.
I use this in battle for random abilities on an NPC that I do not want to repeat (he yells insults, and repetition in a case like that detracts from the whole concept... especially when it repeats 4 times!!).
My thanks to Nash for putting me on the right track!
Peace.
==============
Preset Music Modifications:
This may or may not belong in a script database. It falls more in the "Tips" category. But it does consist of lines of script, so is not completely out of place here.
The last few were posted elsewhere, but included here for completeness.
Explore 1
Pitch 2
Tempo 200
Home 4
Pitch 0
Tempo 150
Castle 7
Pitch 3
Tempo 240
Castle 8
Pitch 9
Tempo 175
Battle 1
Pitch -1
Tempo 33
Battle 6
Pitch -3
Tempo 50
Boss 1
Pitch 0
Tempo 200
Boss 2
Pitch -1
Tempo 42
Theme 4
Pitch -1
Tempo 200
Theme 7
Pitch -6
Tempo 200
Theme 10
Pitch -2
Tempo 50
Mellow 4
Pitch -1
Tempo 300
Dungeon 5
Pitch -2
Tempo 200
Dungeon 5
Pitch -2
Tempo 200
This next one is used in the opening animation, and it shows what can happen to familiar music when altered. I think this opens up a lot of possibilities for giving areas "theme songs" and altering them at dramatic moments for effect.
Boss 3
Pitch -2
Tempo 66
And this one is also a variation on all too familiar music (the "Load" music)
Mellow 1
Pitch -2
Tempo 212
Here are the previously posted ones so you don't need to search around for these few lines:
Home 9
Pitch 7
Tempo 240
Town 5
Pitch 9
Tempo 240
Castle 3
Pitch -12
Tempo 125
Mellow 5
Pitch 1
Tempo 300
Theme 6
Pitch -4
Tempo 125
Town 4
Pitch 8
Tempo 250
That's all for now.
Peace.
=====================
This tutorial is duplicated in the VFX Editor Guide, but here it is again anyhow... (that does not excuse you from reading the VFX Editor Guide!!!)
Dang that pavilion. They put out a plea for
a scripting tutorial on making a simple door work and I could not say no.
Well,... if it's good enough for them, it's good enough for here.
I hope somebody benefits from it. I think I recall someone saying it was giving them trouble, but do not recall if it was here.
It works for Chests too.
Here it is:
Here is how to make a fully functioning door (remember, this takes less then 5 minutes to do, but may take markedly longer to explain):
To do this you will need to make 3 scripts and a two page event (don't you dare complain about it being complex... that's why nobody posted it before... and if you think about the number of purely mechanical steps involved in walking through an actual door in the real world, it is truly much simpler).
This door will open and let you pass when you touch it. It will then stay open forever. It is the simplest example. There are many ways to make doors work in a game. You can have them close behind you. You can have them stay open and then be closed when you reenter the map. You can ring doorbells, or require passwords, or even make the player stand on his head in a bucket of treacle going "Squawk! Squawk! Squawk!" before they can use the door. This open-endedness may be why people never posted anything before.
Anyway, first make 2 "Action" scripts. I shall assume you are brand new to RPGM2 and do not know what that means. When creating a new script there is a "box" that defaults to the word "Content" (actually there are two, but you want the one that is labeled "Type" not the one labeled "Note"). Highlight that, press X, and then select "Action" from the drop down menu.
Then make a one line script consisting of the command:
Event: Motion Change=Action A Speed=0
This is created with the following sequence:
Events > Effects > Motion Change
This opens a window with several options. Stare at it in disbelief and confusion, then change the Model from Character to Object. Then change the speed from 100 to 0. Select object 152 (Door Single B) for your model (unless your taste prefers another door).
Name this Script "Door: Closed."
That's one.
Now make a two line action script that reads:
Event: Single Action=Action A Speed=100
Event Move: Bypass Members=Yes
This is created with the following sequences:
First
Events > Effects > Single Action
That opens a similar window to the last one. Once again change the Model from Character to Object, only this time leave the speed at 100. Then find and "Check" the Disable Motion After Action box. And select object 152 (Door Single B) for your model (unless your taste prefers another door) again.
Then:
Events > Movement > Bypass Members
When the window for this command opens, "Just Say 'Yes'" (with apologies to Nancy Reagan).
Now, name this script "Door : Open" and that's Two!
Almost done scripting. Now make a normal "Content" script. It, too, is only one line and should read:
Sound : SFX [Creak] Volume=100 Pitch=0 tempo=100
This is done via the commands:
Sound > SFX
and selecting Sound 035 [Creak]. This is just for effect and so you know where the content script goes for if you want to get fancy later.
Name this script "MOO!" for no good reason.
Now we need an event for these scripts, but first a detour over to :
Game > Game Settings > Custom Tab > Flag
Then select an unused one. I usually start at 989 and work back (the system sometimes uses the "Temporary" flags and variables). So, for those who can't decide, I'll just order you to use flag 989 unless you feel confident selecting your own. Highlight it and press X.
Now rename it to Door 1. This not only makes life easier when you need another flag (you can tell at a glance that you already used this one) but makes it easier to read in the event page conditions... which, conveniently, is our next destination (after another detour).
Exit Game Settings and save your changes (Update and Exit).
I do everything in crazy sequences (I am not at all a well cat) and now have to go back to the content script we created and add a second line which will read:
Data:Flag: [Door 1] On
This is created with the following sequence:
Data > Flags
and selecting "Single Flag," highlighting and entering the list, going to the flag we renamed (989) and choosing it. Then go to the bottom of the window and choose "On" from the Change options.
Now go to Scripts > Events and choose Create New Data.
Give the new event a name if you like (Door 1 is a good idea... it matches the flag).
Events default to page zero. On this page scroll down to the "Display Type" option. Select object from the drop down menu.
Right below that is the "Model" thingy. Select object 152 (Door Single B) (unless your taste preferred another door).
Below that is the Motion slot. Highlight that and choose our "Door : Closed" script.
Below that is the "Start" option. It defaults to Touch. Leave it alone unless you want to get fancy (more on that later... just get the basic version working first).
And the last bit is the Apply slot. For that select the Content script we created and then modified by adding the flag command (remember "MOO!"?).
Next we need a second page for this event. Up top, where the Page 0/0 data appears is an option labeled "New." Highlight that and press X. Select the same model (Display Type = Object / Model = Object 152 {Door Single B}). Now go to the Motion slot and choose our "Door : Open" script.
In the middle of the page is a big list for "Conditions." Pick the first one and make as a condition "Flag: Door 1: On" (if you can't figure this one out after all this, go take some Logic courses (I tutor Logic as well as Chemistry, Physics, Math and just about anything else I can get somebody to pay me for... you're not paying, so do this one on your own)).
Now we get to place it. Go to Event Placement and put it somewhere logical (or not if you think that way). Go into Test Play and walk up to it, bump into it, watch in awe as it opens all by itself, rejoice with great gladness and walk through the door.
To get fancy you could add a wait command to the content script (right after the Single Action command) so the player can't walk through it as it is opening. That is also the script where you would put your password requests, messages, traps, or whatever else your devious mind decides. Although most of those would go before the door opens in the script.
Change the model to a chest and you have the working scripts for a chest! Just remove the Bypass Members and add the rewards and messages as above. You could even create a second content script for page 2 of the event (shows up as page 1/1 because they start at 0) which states that the chest has been emptied already. For Chest events you may wish to change the Start Condition to Examine instead of Touch, but it still works either way.
That's all there is to it. If anything is unclear, let me know and I'll clarify.
Wasn't that simple?
Peace.
=================
That's the total of my contributions to the equivalent threads elsewhere. I hope it helps some folks here!
This calls for the prize winning emoticon from the Magonian Superlatives thingy: