Jump to content

Recommended Posts

battlerules3.gif

 

This script allows you to set up "battle rules" for victory or defeat. The default battle rules are

 

Default victory rules: all enemies are dead

Default defeat rules: all actors are dead

 

There are four scopes for battle rules

  • Global battle rules

    These apply to all battles. These are the "default" rules.

  • Map battle rules

    These apply to all battles that occur on the current map

  • Troop battle rules

    These apply to any encounter with this troop.

  • Event battle rules

    These apply to encounters on a per-event basis

There are two ways to specify rules for a battle
  • Set rules. These overwrite any previous rules. So for example, if you defined map rules and troop rules, but then have "set" event rules, thenall of the map rules and troop rules will not apply for this battle.
  • Add rules. These are added on top of any previous rules, so you can add event battle rules to any troop rules or map rules.
battlerules1.gif

 

Download

 

Get it at Hime Works!

 

Further instructions can be found there.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Interesting script good for tactical battles. Is that blue window in the ss actually part of the script or did you just edit that in?

Share this post


Link to post
Share on other sites

Interesting script good for tactical battles. Is that blue window in the ss actually part of the script or did you just edit that in?

Edited. I have descriptions set up but I haven't coded an objectives window yet.

Share this post


Link to post
Share on other sites

I'm having a hard time making a custom global death. I want to make it so instead of it being every active member being dead, the requirement is every member, even in the reserves, must have the death state. But I don't know how to go about that.

 

Then I'd have to also deal with the problem of having it so the game doesn't mess up when all active members are dead but the battle is still continuing so I can event my own dead member switchout system. I also don't know how to go about making the game not mess up with that aspect. The member switch part I can just figure out on my own.

 

It's just, I never understood how it could be considered a Game Over when 4 members are dead when there are 4 perfectly healthy members in the reserves.

 

Also, yes, I am a fan of Pokemon. Lol.

Edited by Audrey

Share this post


Link to post
Share on other sites

Try adding this script then setting the requirement to:

$game_party.all_members_dead?

 

 

class Game_Party < Game_Unit
  def all_members_dead?
    all_alive_members.empty? && ($game_party.in_battle || all_members.size > 0)
  end
  
  def all_alive_members
    all_members.select {|member| member.alive? }
  end
end

 

 

Edited by Gambit.

Share this post


Link to post
Share on other sites

Got an error.

Script 'Tsukihime Battle Rules' line 287: NoMethodError
occurred.

undefined method 'all_members_dead?' for
#<Game_Party:0x7ffbdb8>

 

I got rid of the the "members" part of 'all_members_dead?' and it didn't give me an error, but still, I had reserved members alive but still got a Game Over.

 

Oh, wait, I'm suppossed to add that part. Duh.

 

Where do I add that?

Edited by Audrey

Share this post


Link to post
Share on other sites

It's just, I never understood how it could be considered a Game Over when 4 members are dead when there are 4 perfectly healthy members in the reserves.

"members" in the context of a battle refers to battle_members.

 

You just need to say

$game_party.all_members.all?{|mem| mem.dead?}

Share this post


Link to post
Share on other sites

Above solution is simpler, go with that. You will probably need some way to bring in the reserve members though. Otherwise the battle will keep going while you have no actors involved.

Share this post


Link to post
Share on other sites

What it is, is that I'm going to set the conditions to the original loss rules then I'm going to use Galv's member selector to choose a party member, where you then choose the next party member you want to switch to.

Share this post


Link to post
Share on other sites

Audrey please don't double post within 72 hours. Use the edit link instead (located near the quote button of your post). Thanks.

Share this post


Link to post
Share on other sites

I have implemented a new feature called "Rule Groups"

Basically, rule groups are just groups of rules.

You define a rule, then assign it to a group.

 

The special thing about groups is that you might have multiple rule groups for your victory condition, but you only need to satisfy one of them in order to achieve victory.

 

Here is a quick summary

  • All rules WITHIN a group must be satisfied in order to satisfy the group
  • Only ONE group needs to be satisfied in order to achieve victory (or defeat)
Here is an example of what I mean: Suppose you are in a battle with some slime. The victory conditions are as follows:

 

1: kill all enemies, OR

2: wait 5 turns

 

Previously, you can accomplish it by combining all of those into a single rule

<victory rule: set>
Cond: (the appropriate condition, as a ruby statement. Could be very long)
Desc: kill all slime OR wait five turns
</victory rule>
Which is ok...until you realize that the script does not support very, very long ruby statements, and the rule display does not support very long descriptions either.

 

With the new concept of rule groups, you can create two groups and place a rule in each:

 

<victory rule: set>
Desc: Kill all slime
Group: 1
</victory rule>

<victory rule: set>
Desc: Wait 5 turns
Group: 2
</victory rule>
Now you can allow the player to choose which group of rules they want to complete in order to win the battle.

By default, all rules are assigned to group 1 if you don't specify one.

 

Note that this update breaks compatibility with Mr Bubbles' Battle Rule Display.

I will provide proper documentation once I get around to it, but if anyone wants to test it out it is ready for use.

Share this post


Link to post
Share on other sites

Another gem.

 

I'm already thinking of uses.

 

Again, thanks for your work on scripts and supporting the community, Tsukihime!

 

 

Edit :

 

Okay, added Battle Rules and then Mr. Bubble's display scripts in materials with Battle Rules above Mr. Bubble's display code.

I get an error -

 

MrBubbleline200_zpsf9d480fc.png

 

I have not set up any rules yet, since the battle rules script says there are default 'defeat all enemies/all allies not defeated type rules.

 

When I pull out the Mr. Bubble display script the game runs and no error but I do not see any rules displayed anywhere.

Edited by Wren

Share this post


Link to post
Share on other sites

Another gem.

 

I'm already thinking of uses.

 

Again, thanks for your work on scripts and supporting the community, Tsukihime!

 

 

Edit :

 

Okay, added Battle Rules and then Mr. Bubble's display scripts in materials with Battle Rules above Mr. Bubble's display code.

I get an error -

 

MrBubbleline200_zpsf9d480fc.png

 

I have not set up any rules yet, since the battle rules script says there are default 'defeat all enemies/all allies not defeated type rules.

 

When I pull out the Mr. Bubble display script the game runs and no error but I do not see any rules displayed anywhere.

 

As it says two posts up: the latest update broke the rules display script. You'll have to tell the players some other way in your game.

Share this post


Link to post
Share on other sites

 

-snip-

 

As it says two posts up: the latest update broke the rules display script. You'll have to tell the players some other way in your game.

 

Woah, now that you pointed it out, I see it, but somehow I missed it twice yesterday.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×