Combat System - Multi Stage Enemies, Database editing, & possible scripts needed?

● ARCHIVED · READ-ONLY
Started by Tsukitsune 6 posts View original ↗
  1. So I'm trying to make a combat system that revolves around multi stage enemies and skill attributes.

    I've messed around in the maker for hours, looking at variables, troops, skills, enemies, and common events.  But I'm at a loss as how to implement all of my ideas.  I'm not even sure if some are possible without scripts as I haven't messed with the database a whole lot Overall.

    I'm going to explain my entire system and would like to know how to implement it and what parts aren't possible without scripts.

    I might end up putting this help request up in Classifieds once I know more about what is and what isn't possible with just the database alone.

    __________________

    In my game there are these creatures known as the Faded.  They have 3 different states:  Null, Color, & Shattered.

    Dummy-Absorb_zps31082aa7.jpgDummy-Red_zpsdc23af17.jpgDummy-Shattered_zpsf38985de.jpg

    Null:

    • Faded is immune to elemental damage.  
    • Can still take damage by physical attacks.  
    • While in this state, if an elemental attack is used, the Faded takes on the attribute of that attack and transforms into the "color" state.  
    • They can transform to any of 6 colors depending on what attack was used on them.  Ex; If a fireball was used against the Faded, they'd gain the red attribute and transform into the middle image.

    Color:

    • Faded has 2-3 abilities based on his attribute.  
    • They take 1.5x damage and skip a round if their opposite color was used to attack them.  Ex. If player uses opposite of red on color wheel (green) the faded takes 1.5x damage and lose a turn.
    • However, if the same attribute is used against the faded (ex red attack against red faded) they absorb the attack damage and heals them.
    • If Faded uses one of their elemental spells, they have a 35% chance to lose their color, reverting them back to "null" state.  
    Shattered:  Faded enter this state when their "core" is shattered.

    • Faded takes 25% more damage and does 25% less damage
    How to shatter a Faded:

    Players shatter a Faded's core by using attacks with color attributes opposite to that of a Faded while in they're in the "color" state.  If 30% of the Faded's health is done by using the opposite color, then their core is shattered.  Once shattered, the Faded enter the "shattered" state.  This is the part where I'm especially lost on how to add this.  How do I have the game check for the above?  I tried messing with variables but couldn't figure out how I'd set an elemental skill to +add to a variable based on damage dealt.  Such as a fire spell is used, does damage, that damage is added to a "red damage" variable.  Then I want the game to check the "red damage" variable and determine if total damage dealt of that element is >=30% of the Faded's "total" health.  Then have the faded transform into "shattered" state.  

    ___________________________________

    So what do I change in the database to achieve the above results?  Also are there any that need scripts to be accomplished?

    Any help is appreciated, thanks!
  2. Very interesting concept! I think you would probably be able to do most of this with states and clever use of the damage formula, but you might have to resort to a little scripting (since the damage formula doesn't let you put a whole lot of text, if for no other reason).


    I'll be very interested to see what suggestions are given to help you accomplish this.
  3. I think this would be a good opportunity to use Hime's Tag manager script, I'm no expert on this particular script, however I am pretty sure the functionality you need from it exists, as all objects support tags, including the two you need(Enemies, and skills), and there's a custom tag condition option as well, so I strongly suggest you look at this. It's bound to make your life much easier.

    http://www.himeworks.com/2013/03/07/tag-manager/

    Or I just figured a easier way to do what you want. You'll want to make a common event, one for each element, each common event just turns on a different switch(put the apropiate call common event in each elemental skill), and you make a troop event page condition require  said switch, change the enemy to the proper form, turn off switch.

    If once a elemental form is selected, you don't want it to change elements, you'll want hime's custom page condition script, as that allows for more then 1 page condition per page. In each element common event, you'll want to turn on a 2nd switch(the 2nd switch in every element common event should be the same), then require that switch off as well for each elemental form changing event page.

    Custom Page Condition script: http://www.himeworks.com/2013/03/23/event-page-conditions/
  4. OK... I've been tinkering in my editor and I think I have something that will work. You'll need the following two scripts:


    Tsukihime's Common Event Variables.

    Yanfly's Element Absorb.


    So first things first - you'll need 8 enemies in your database (unless you know of another way to change the enemy graphic other than "enemy transform"). Let's say, FadedNull, FadedRed, FadedGreen, FadedPurple, FadedYellow, FadedBlue, FadedOrange, and FadedShattered. They all have their respective graphics. For the 6 color Fadeds, tag them using Yanfly's Element Absorb script to absorb their corresponding elements - so FadedRed, if he absorbs fire (which is, by default, element number 3), would be "<element absorb: 3>". Then give each of them their respective skills.

    Picture example:

    Spoiler
    GnmDwYa.png
    Next, we'll need some states. We'll have Null, Red, Green, Purple, Yellow, Blue, Orange, and Shattered for this example. Null will reduce all the color damage to 0%. Every other state will simply decrease damage taken by its same element by however much you want to absorb. In Yanfly's state, the less damage it's set to take, the more it will absorb. So, if FadedRed has the Red state, and the Red state has set "Fire*50%", then FadedRed will absorb 150% of all fire damage done to it. You'll also want a stun state that lasts for 2 turns - set it to "cannot move," and "turn end 2~2." This is because the turn it's inflicted counts as 1 turn, so it will effectively lose its ability to act on the next turn. Lastly, you'll want a shattered state, that sets PDR and MDR to 125% and ATK and MAT to 75% (this will increase damage taken by 25% and lower offenses by 25%).


    Here's where the legwork starts to come in - for every skill that does some kind of elemental damage, you'll want to add the following into the damage formula:

    c=(damage formula);if b.state?(x);c*=1.5;b.add_state(y);end;if c>=((b.hp*1.0)*0.3);v[z]=1;end;cThere's a lot of variables in there, so let me break it down for a moment - X is going to be the opposite state to the skill's element. So let's say you're working with a red element skill - x will be the Green state. Y is going to be whatever state your stun is. I'm assuming the damage formula won't be more complicated than about 20 characters or so (maybe something like "a.mat*4-b.mdf*2"). If it is, then we can move this damage formula into a script call as part of the common event. So the first part of that statement is saying, "If the target has the opposite element's state, then multiply the damage by 1.5 and stun him."

    So now we know how much damage the ability is going to do, thanks to calculating c. So now we want to see if c is greater than or equal to 30% of the Faded's remaining HP (if you want it to be 30% of the Faded's MAXIMUM HP, instead of its current HP, just change "b.hp" to "b.mhp"). If it is, we're going to set a variable (Z - whatever variable you happen to have available) equal to 1. Then we close out the end statement and make the ability do damage by putting c.

    So let's say you're writing the damage formula for a red skill, the Green state is 5, the stun state is 10, your ability does a.mat-b.mdf damage, and you're going to store variable 23: Shatter. Then your formula would look like this:

    c=a.mat-b.mdf;if b.state?(5);c*=1.5;b.add_state(10);end;if c>=((b.hp*1.0)*0.3);v[23]=1;end;cBut we're not done yet, so let's call a common event - one for each of the colors. In this example, we'll call common event Red.

    We'll just be doing a script call within it that will look like this:

    b = $game_temp.common_event_targetif b.state?(x); b.remove_state(x)b.add_state(y)else if b.state?(z)if $game_variables[sh]==1b.remove_state(z)b.add_state(s)$game_variables[sh]=0elseend; end; endThe common_event_target bit is from Tsukihime's common event variables script. It will basically store the ID of whoever you targeted the skill with. For this common event, X is going to be your null state, Y is going to be your "affinity" state, Z is going to be your "opposite" state, S is going to be the shattered state, and SH is the number of the variable you assigned in that damage formula earlier.

    So what this is doing is saying, "If the target has the Null state, remove it, and add the state corresponding to the color I just used." If it doesn't have null, it says, "If the target has the opposite state of the color I just used, then is my stored variable equal to 1? If it is (which means you did at least 30% of the target's health with your attack), remove its current color state, add the shattered state, and set my variable back to 0."

    So let's use our earlier example again - let's say you have a Red skill. Let's say the Null state is state 2, the Red state is state 3, Green is state 5, Shattered is state 11, and 23 is the variable you used to store whether or not you did at least 30% of the target's HP. Your call would look like this:

    b = $game_temp.common_event_targetif b.state?(2); b.remove_state(2)b.add_state(3)else if b.state?(5)if $game_variables[23]==1b.remove_state(5)b.add_state(11)$game_variables[23]=0elseend; end; endThen create the other 5 common events for each color in the same way.

    Pictures of the skill and common event for reference:

    Spoiler
    3jLNqjC.pngFAsAvZh.png
    Now we need to figure out how to make the FadedColor randomly lose its color status whenever it uses one of its color skills. So, for each of the FadedColor's abilities, we'll call a common event corresponding to its color.

    Set a variable (let's say variable 2: Random) to a random number between 1 and 100. Then make the following script call:


    a = $game_temp.common_event_userif $game_variables[2]<=35a.remove_state(x)a.add_state(y)endX is the corresponding color's state and Y is the null state. So, let's say we're making a Wind skill for a FadedGreen, where Green is state 5, and Null is state 2. Your "FadedGreen" common event would look like this:

    a = $game_temp.common_event_userif $game_variables[2]<=35a.remove_state(5)a.add_state(2)endPicture example:

    Spoiler
    1bU58gz.png
    There's one last bit, and I will admit, I think my solution here is perhaps not the best one available. If there's a way to make enemies transform via a script call, it would probably be more effective than what I'm about to suggest. So hopefully someone can chime in with that.

    Anyway, on the troop page for your Faded troop, make a page that, at the beginning of the battle, adds the state "Null" to each Faded. So, Turn 0, span Battle, "Change enemy state: Null."

    Now make one more page, set to the condition "When the end of the turn," and span: "Turn." For each Faded enemy, make the following string of conditionals:

    Conditional: Faded is Red inflicted

    Enemy transform: FadedRed

    Else:

    Conditional: Faded is Green inflicted

    Enemy transform: FadedGreen

    Else:

    Conditional: Faded is Blue inflicted

    Enemy transform: FadedBlue

    And so on for each color, as well as one for if the shattered state is inflicted (enemy transform: FadedShattered) and is null inflicted (enemy transform: FadedNull).


    What this will do is, at the end of each turn, change the enemy's graphic to match its corresponding state (as well as give it the corresponding abilities). If you're OK with that, then cool - if you'd like the graphic transformation to be more instantaneous, you'll need it to be part of the script call when you use a damaging ability against them, but alas, I don't know the solution for that one. You could potentially do some troop events using the "moment" span and some additional conditionals using Tsukihime's Custom Page Condition script (that Zoltor linked), too.

    Picture for example:

    Spoiler
    00QbKAQ.png
    Also, I made a video to sample all of the behavior and make sure that this is what you're looking for:
  5. Thanks for the help guys,

    @Zevia, wow, I wasn't expecting to get such an indepth answer.  A video even!  Thanks so much dude!  

    From the looks of it, this seems to be exactly what I'm looking for.

    I'm going to implement it and test it out for a while, if there's anything that messes up I'll post here.
  6. Here's another approach, which is similar to Zevia's except... I guess presented as a script instead of events.


    I would use something like the Tag Manager to tag which skills are of what "Color", which enemies does it apply to, set up the whole color relationships inside a script config, and then basically provide some logic that will perform the color-checking and battler-changing.


    So for example, you tag "Fireball" with "Red" and then you tag Slime with "can fade" or something. Now when you hit a slime with fireball, it will turn into a "red slime" (this is a separate enemy). The red slime has all the properties set up, and tagged with a "red" tag so that you know what color it is. Because you've set up your color relationships, you can use a skill that's set up with blue and it will break the red.


    The only real difference between using such a scripted approach is that all you have to do is tag your skills and enemies properly, and set up the color wheel.