States + mechanic questions

gkrit

Villager
Member
Joined
Jul 16, 2013
Messages
11
Reaction score
0
First Language
English
Primarily Uses
1. First of all, I would like to know if you can have more than one condition statement in a damage formula and if so, how to structure such a formula. 

2. How do you add state durations in the damage formula section?

3. How do I add a buff state (eg. ATK UP) to my character when I damage a target?
 

Tai_MT

Veteran
Veteran
Joined
May 1, 2013
Messages
5,472
Reaction score
4,859
First Language
English
Primarily Uses
RMMV
1.  I'm not sure exactly what you're asking here, but let me try to answer what I think you're asking:  It's possible for a skill to add a state simply by selecting the state to add and the rate at which to add that particular state.  If you are trying to do something else while a state is active (like say if you have an "Oiled" state and you want to be able to set the target on fire...  Or you want a burning state to add more damage to a fire spell...) you can simply assign a variable to that particular state.  I'm not for certain at the moment, but I think you can make it a common event to track states as variables.  Once you have those variables, you can include that in the formula to do more damage or what-have-you.  If you hover over the "Formula" field, it tells you what you can use in the formulas.

2.  State durations are handled in the "States" tab and not in the "Skills" tab where you are finding the damage formula sections.  Tab over to this area and you can customize how long states last or even how they can be broken.

3.  I know of no way to add a buff state to yourself for simply hitting "Attack" in the battle screen.  Perhaps there is a script somewhere that allows you to do it?  As for simply adding a buff state for a hit with a skill...  It's all handled right there in the Skills menu.  In the "Effects" box of a Skill, simply right click, go to "Buff" and then select the buff you would get as well as the duration.

I hope all of that helps you out.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
1. First of all, I would like to know if you can have more than one condition statement in a damage formula and if so, how to structure such a formula. 

All damage formulas must return a numerical value in the end. Yes you can add multiple scripted conditions inside the damage formula box. However you are limited to 100 characters, any more would require a script that allows you to pass that 100 limitation.

2. How do you add state durations in the damage formula section?

I don't believe the possible damage formula functions can cover that. The only way to pretty much do that would be within the state settings itself in the database, for that state.

3. How do I add a buff state (eg. ATK UP) to my character when I damage a target?

you can use something like "dmg = a.atk*4 - b,def*2; a.add_buff(atk); dmg"  However i'm not sure if that's the exact lingo for buffs, since states use a.add_state(#)    Basically you assign the returned damage value in a temporary variable, use a semi-colon and then add the buff part, then semi-colon again and return the variable you made.
 
Last edited by a moderator:

gkrit

Villager
Member
Joined
Jul 16, 2013
Messages
11
Reaction score
0
First Language
English
Primarily Uses
Thanks guys. I've been looking into what i need further and there is something a little more specific that I require now. Its going to be a fairly common mechanic in my game.

I need a formula that can do the following:

When a state is removed from the target (or user), something different happens. For example, I have a formula already that does what I would like it to but I don't know how to add the other mechanic to it.

HP Damage

a.state?(39)? r = a.mhp*0.25: r = a.hp*0.25; r - b.def

What I need to add to it now is -- if the user is under this state, it also consumes the state.

EDIT: Also is there a way to formulate -- If target is under 2 specified states, do X effect.?
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
there is no trigger to indicate loosing a state, so you can't have a state follow another in default. However, there are several script that allow you to define "follow-up"-states (states that are triggered when a previous state runs out). You have to search for those scripts in the master script list and add one of them to your game.

The add-state-function in the damage formula is not for general use, but for use under specific conditions - because there is another, much easier way to add states that should be used first, with the function in the damage formula only for those cases where that is impossible.

Each skill has a target, and the feature "add state" applies that state to the target of the skill. If you have a fire sword that adds a burning state to the enemy on attacking then you use that option.

The a.add_state(x) in the damage formula is used in those cases when you want to add a state to the skill user in addition to the target. for example a group heal skill that leaves the healer weakened or an attack skill that adds a defence state to the attacker or something like that.

That said, you can use any ruby function in the damage formula as long as the limited space of that line is enough to contain all commands. that includes chained conditions as well as calling script functions for those parts that are too long for the damage field itsel . but if you increase the complexity of the damage formula you need to know how to program ruby to prevent everything from breaking under the restraints of the damage formula field.
 

gkrit

Villager
Member
Joined
Jul 16, 2013
Messages
11
Reaction score
0
First Language
English
Primarily Uses
well my game design is a little different to that of a normal rpg game.... the combat especially.

although i did find this formula in another thread that I thought couldve been used (but changed to suit my purpose):

3. How do we check if we're removing a state on a target?

.erase_state(n)

This saves us a little work. Basically, it both removes the state and checks if there was a state to remove.

What can we do with this?

We can do anything extra if the state is successfully removed. For example we can do extra healing if we remove poison, or deal extra damage if the target is stunned but remove stun.

Specifically I made a skill that heals HP and cures poison, but takes 3 extra mana if it removes poison.
if b.erase_state(2) ; a.mp -= 3 ; end ; 50
*Link to thread here

The formula (highlighted in bold) is essentially what I would like to do in addition to my formula... I just dunno how to combine the two.

My skills in the game serve very specific purposes and many have several ways in the way a skill can perform depending on certain factors/parameters.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top