I think this is easy enough, but I'm really inexperienced with coding. I'm just using the standard battle system.
Basically I want to set it up so, after all the commands have been chosen and the active phase of a round of battle begins (phase_4 in Scene_Battle i think?) but BEFORE any actions are made, all actors and enemies who are using the attack command (basic action 0 i think)? lose an amount of SP equal to their weapon attack power (atk).
Thanks for your help!
EDIT: I also want to try something I expect will be more complicated: making it so that, IF any actors are attacking in a given round, enemies can only use the attack command on actors who are also using the attack command that round. Any help with that would be appreciated, but it's not my top priority. thanks dudes
I won't be able to do this, but I think that it helps the people who can if they know things like these. Why exactly do you want that last one?
I thought the same thing. The first one I could understand if it was used as a state that a battler could be affected with occiasionally, but the second request there just sounds like a building block to a highly annoying CBS. What would happen if an enemy only had the basic attack in its skills, and no one attacked it normally?
Dudes.
oh whoops I'll edit that first post: only if at least one actor is attacking, the enemies can only attack actors who are doing that basic action. Good point. No need to be facetious, chuck norris sig guy, but I appreciate your help.
The first involves using SP as a kind of easily-replenished stamina that affects characters' chances to block/dodge; it's calculated a little differently for actors and enemies, but the idea is that there's a major advantage in teaming up on a single target (with, let's say, the faster character using a skill that prevents the enemy from dodging or drains a lot of SP, and then the slower character hitting them with a heavy weapon). Originally I had the SP loss for wielding a weapon and for blocking it both calculated in attack_effect, but I realized that this gave a disadvantage to whomever acted first.
Due to plain inexperience I can't figure out exactly how the Scene_Battle code is structured though, so if enemies aren't picking their action UNTIL their turn comes up in a round, I'll have to find a different solution.
The second is basically akin to the front row / back row system in a lot of old RPGs but it changes dynamically based on the round. You could have a heavily armored actor with magical protection act as a "tank" by attacking, so he or she would be protecting weak or injured characters by proxy.
Quote from: swamp on December 27, 2010, 07:38:48 pm
Due to plain inexperience I can't figure out exactly how the Scene_Battle code is structured though, so if enemies aren't picking their action UNTIL their turn comes up in a round, I'll have to find a different solution.
Try typing out the entire script.
Sorry, I'm not sure what you mean. I'm just using the normal, default scripts, except for a couple of my own modifications to Game_Battler.
I know this stuff must seem really basic to you guys but I genuinely don't understand it. Any help would be appreciated.
No, like if you want to understand a script, the best way to do it is to just type it out. Into xp's script editor, preferably since the color changes are good for self esteem.
I'm not gonna script such a system, but I will point you in the right direction. I'm unsure as to the extent you know how to script, I'm going to assume you know the basics since you mentioned making a few mods. If you need more explanation, feel free to ask.
1. To make enemies attack only characters who are also attacking, you will need to likely make adjustments to the "make_action" method in Game_Enemy to re-select targets unless their "current_action.kind == 0". This is going to cause a miriad of issues, since you cannot determine the action order of every battle and possible scenario, and when an enemy makes it's orders before the actor actually inputs their command.
2. For the "stamina" idea, I would first check out the "start_phase4" method in Scene_Battle. Use something similiar to this:
($game_party.actors + $game_troop.enemies).each {|battler|
if battler.exists?
battler.sp -= battler.atk
battler.damage(battler.atk, false)
battler.damage_pop = true
end
}
You will need to add methods for making action results later to ensure that the battler has enough SP to make the attack in the "make_basic_action_result" method. You can likely do it very similiar to how it is done in the "make_skill_action_result" method where it checks for SP. Just compare it to the @active_battlers.atk instead of the skill's SP cost.
This is system is likely going to buggy. You are probably going to find that you are going to have to make some larger modifications in order to get these small ones working properly.
3. Niche meant that it might help you to write each line of Scene_Battle (copying it line for line) just to help you get a better understanding of how it works and follow it a better. Some people use that when trying to get a start into scripting to help themselves understand how it all works.
Thanks for your help. Yeah I don't doubt that there are going to be issues down the line; so far my modifications are REALLY simple & don't introduce any new methods or classes, and even then I've had to go back & fix things. I know there are some very basic gaps in my knowledge.
A couple questions about what you said, under what kind of circumstances would the enemy determine its orders before the player gives orders to the actors? Why would the action order make a difference; do current_action_kind or current_action_basic change when the character makes an action?
There is a method, I forget the exact name, something like "make_action_orders". Here is where the order is determined for this entire turn.
It will cause issues. Believe it or not, I know what I'm doing when it comes to scripting. Here's an example, lets say with 2 enemies and 3 party members.
1. Method is called to create order that battlers choose their commands.
2. The order is: [Enemy1, Party2, Party3, Enemy2, Party1]
3. Oh, look! A bug already! How does Enemy1 know if there will be a party member whose going to use a basic attack?
4. He can't.
5. So we have two options to have him take. Lets follow the first option:
Option 1
1. Enemy1 chooses to use a basic attack anyway, he assumes somebody will use a basic attack.
2. Here we have two possibilities:
a. A party member chooses to attack and the turn executes flawlessly.
b. Nobody attacks and he is stuck with nothing to do, since his attack is based off a party member attacking.
This can be exploited by the player to practically be invincible.
This is assuming we have modified how he targets and the game hasn't crashed already.
I can think of numerous other things that would pop-up, but I'm too lazy to type them all out. :P
Option 2
1. He does not use his attack command.
2. We have to set up some type of alternate move for every enemy in the game.
3. This can be exploited by the player.
4. This is assuming we have correctly modified the "make_action" method in Game_Enemy to correct for this.
5. Once again, I can think of about 10 other bufs that would arise, but I'm still too lazy.
Needless to say, you ARE going to have bugs by making these "simple" mods. The problem is, although your mods may seem "simple", their actual implementation into the default CBS is not. They can all be done, but are going to require more than a line or two of code.
BTW: Not introducing new methods does not make a script simpler.
I think you must have missed the correction I made above, in the original post & the one after it: if no actors are attacking, the enemies can attack any actor. Does that resolve the other issues that you thought of? Would it be easier to implement?
I know that a game has to be balanced around modifications like this; the thing is, I can't test, balance, or experiment with it until i've implemented it.
I'm not trying to insult you personally by persisting in wanting to do something you think is a bad idea. Again, I know that I'm inexperienced at this and I'll defer to the expertise of those who take time to help me. Thanks.
i think i will lurk more in this, plus the first one CAN be done, but for the second you should ask god blizzard :3.anyway i will work on this.
correct me if i am wrong.
you want that character A (player) , everytime that he uses ATTACK ( basic command 0 ) he MUST lose MP = to weapon attack damage. and each turn the battlers recover a amount of "stamina" mmm
-this will need merging of 2 o 3 scripts to work, ok i will try-
Quote from: Lanzer on December 30, 2010, 05:46:42 pm
i think i will lurk more in this, plus the first one CAN be done, but for the second you should ask god blizzard :3.
Blizz is retired. You'll probably need to find someone else.
He does do comission work. Though I doubt he's interested enough to pay.
Well i`m happy cuz this is my first intermediate difficult level script :3 cheers
but the problem is that my format is quite "WEIRD" but still works (It`s a "usable demo")
i`m a bit busy to convert it into a script so just follow the instructions in the Script section of the demo
PD: I will make the script version only if truly needed ( i think that only 2 o 3 users will need the system and with the usable demo is enough and is kindda easy to set up to work)
DEMO: http://www.mediafire.com/?b8ds09jjubk3fsc
here some screenshots :
(http://i1127.photobucket.com/albums/l622/Neolanzer/Dibujo1.jpg?t=1293917169)
(http://i1127.photobucket.com/albums/l622/Neolanzer/Dibujo2.jpg?t=1293917169)
Feedback needed plz =I
where :3???