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.
Here is a link to that thread for those who care.#nosmileys#nosmileys#nosmileys#nosmileys#nosmileys#nosmileys#nosmileys#nosmileys#nosmileys