How to make the most of custom formulae. Part #1

that is the tricky part... if it's after the skill, he can use events for that, but if he needs it before/during the skill, he'll probably need to use some script that can for example mimic the choice selection event or something...
I'm getting a bit confused here.  What I meant was that it is the turn of picking an action for actor X.  Instead of doing something directly s/he uses a skill to select someone else (actor Y) to attack the enemy.  But maybe it would be better to start a new thread about this, as it seems that it's not do-able using a formula, and I don't want to clutter up this thread with unrelated queries.
it is for that... I was simply saying that it can happen in different times during the skill's usage... like if you go the CE route, then the skill will simply be a dummy and does nothing other than trigger the common event... so in effect, the selection and everything else happens after the skill was used...

and yes, that wouldn't be doable via the formula alone...
I have started a new thread in the Ace support section, as I think it is better there than here.

Thanks for the input so far.
Try:

[(4 - $game_party.alive_members.size) * 2,1].max * formula
I tried this formula and have tried to gain results with one, two and all 3 other party members dead, but no damage is applied regardless
What did you enter for formula?
That was my problem. I had my formula placed but i was missed a space in it for it to work properly. Having seen this self error it does indeed work.
Hello there. I was thrown off by something I just recently tested. I was working on tying holy magic to players health.  I'm probably just going to use a.hp - b.mdf but I'm curious on why when I do something like:

a.mhp + a.hp / 2 I get a result that is slightly higher than the mhp when character hits with full health. Shouldn't it cut it back down to mhp when no damage is taken? I turned off variance and any bonuses applied to health and still I get more than the mhp when striking at full health.

Shouldn't:

a.100 + a.100 / 2 become 100 damage? I'm getting something like 135...

There is no critical, no variance, no bonus to character health for this test. No elemental weakness on the target either. And this is done with no defenses applied to enemy.
Order of operations. The division is done before the addition. (a.mhp + a.hp) / 2 should fix that for you.
Order of operations. The division is done before the addition. (a.mhp + a.hp) / 2 should fix that for you.
Yeah! I picked it up after walking away from my computer XD of course...
Forget it. Got it working now >,>
read threw alot of these. too dyslexic to read over all of em so ill post here.  i need help writing 3 skills

what i mean is a magic system where the caster transfers hp to an ally and steals poison/blind/ect from an ally and take it themselves (if aclipitable).

a reckless attack that damages the attacker but massively damages the foe. 

a magic shield that hurts the attacker if the target is attacked but not a counter attack.
Formula box for the first one should read

(replacing HP_Cost and Amount_Healed with the respective formulae you want)

a.hp-=HP_Cost;a.Custom_HP_Up_Debuff_Steal(a, ;Amount_Healed
Then paste this snippet in your scripts:

class Game_Battler < Game_BattlerBase def Custom_HP_Up_Debuff_Steal(a, if (b.state?(w)) #copy these 3 lines and replace w/x with the state ID you want; a.add_state(w) #you can make it work for any state IDs that you want-- but end #you have to specify which state IDs you want to use. if (b.state?(x)) a.add_state(x) end endend
Second one should read (this is a 25% recoil-- you could do something else, like a flat value or a % of the user's HP (by a.hp -= a.mhp*0.05; for example, is a 5% max HP 'cost')):

c=your_damage_formula;a.hp-=c*0.25;c
Third one requires a script or common event; for a CE version you need a few skills and states:

Skill A for this should just apply a pair of states (W & X) and flip a switch (A)

State W does nothing, unless you want this shield to increase defenses.

State X does nothing, period. Set it to break on taking any damage (I know you can do this, I just forgot how atm)

The Common Event should be set to parallel process on the condition that the switch is ON

The Common Event should have a few branches-- one for each character the shield can be cast on, and a different switch (self-switches work, but only if you have 4 or fewer party members).

The Common Event should enable that second switch when state X is applied. If the state gets removed, then it will unleash that second skill (you can customize which skill gets used by actor, actually); though I'm not sure how to make sure it will hit the previous target; I personally got around this by having the ability hit all enemies.

I'd recommend looking into a script for this one, but this is how my common event looks in the editor

Spoiler
[IMG]http://i254.photobucket.com/albums/hh100/Eilwan/thingforsite.png[/IMG]
ok... first one... gave my dyslexia a run for its money... but working on it  as i type.

second one worked like a charm mega thumbs up 5% worked perfectly... only down side is i get wiered percentages in the hp bar (first one was 14.14135235678 or something like that) but thats acceptable.

third one. i follyou you on everything but 'flip a swihc (a).  how do you make a skill flip a switch?
First one: sorry =c


Second one: hmm.. I think if you replace the "C*0.05" with "[C*0.05].to_i" it'll remove that. I'm really not sure about that, though.


Third one: Turns out you don't need the skill to flip the switch-- you can just have a switch that's 'Always On' as the condition for the common event. Just make sure to turn it on at some point (via an autorun or common event).
Why would you want to have a parallel process common event always running, for something that you only want to do in battle?
Because can't figure out how to make it do otherwise without looking for a script?

[now, if including scripts, then naturally using

Spoiler
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Determine if "in battle"# Author: DiamondandPlatinum3#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# Description:## This script will allow you to set an event switch that will turn on if# you are in battle, and turn off if you are not.# It's useful for changing what an item does if battling compared to if# not battling.#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~class Scene_Battle < Scene_Base #------------------------ # Editable Part #------------------------ # Event Switch to turn on if in battle ITEM_EVENT_SWITCH_ID = 933 #------------------------ #-------------------------------------------------------------------------- # * Start processing #-------------------------------------------------------------------------- alias evntswitchbtlstart_1g5s start def start evntswitchbtlstart_1g5s $game_switches[ITEM_EVENT_SWITCH_ID] = true end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- alias evntswitchbtlterminate_1g5s terminate def terminate evntswitchbtlterminate_1g5s $game_switches[ITEM_EVENT_SWITCH_ID] = false endend
and the associated switch would be far superior; but the thing is that I know plenty of people that hate using scripts (for one reason or another)]
yeah i dont like useing scripts if there is a way to use switches and other clicky. im scared ill put something in i cant undo and break the whole game and have to start over again.

still not following you on the magic shield one. but the others are good to go 😛
So I have no idea how to make a magic shield that only reflects damage to the person that attacked you; but it is possible to make a shield that damages all enemies if the afflicted is hit-- you can even make it only happen if they're hit on the turn cast; by having both states be conditional branches; requiring both states to activate the damage; and have one decay by turns and the other only go away by taking damage.


For a magic shield style effect, scripts that I found:


http://victorscripts.wordpress.com/rpg-maker-vx-ace/gameplay-scripts/retaliation-damage/


http://victorscripts.wordpress.com/rpg-maker-vx-ace/gameplay-scripts/action-counter/


http://victorscripts.wordpress.com/rpg-maker-vx-ace/gameplay-scripts/element-counter/
Then maybe this should go into its own topic at this point, since it's no longer in the realm of the damage formula box and you're needing more specific help.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-the-most-of-custom-formulae-part-1.1143/