YesNoOk
avatar

Burning/Poisoned Effect (Read 8195 times)

Started by Tyadran, July 03, 2017, 02:18:09 am
Share this topic:
Burning/Poisoned Effect
#1  July 03, 2017, 02:18:09 am
  • *
    • USA
Hi, I'm new at the whole MUGEN thing, and I've spent the past three days or so working on my first character, which is almost complete. I'm only missing one thing, really, and so far I've been unable to turn up useful information for it.

I'm looking to add two special conditions that can be applied to characters: Burning and Poisoned. Both of them should do damage over time (each one doing a different amount) and cause a palette effect while active, and Burning should have the additional effect of lowering the afflicted character's defense/making them take more damage.

Note that this is a fullgame project, so character incompatibility isn't something to worry about. Every character will be designed with these effects in mind.

My initial thought was to use two character variables, one for each condition, and have them checked in [State -2] and managed there, but I can't figure out if and how I can manipulate variables on another character. Ideally I should be able to define different values for each attack that would apply these statuses, to allow for different spans of time, but if that isn't possible it's not the worst thing in the world.

The main reason I haven't tried using custom gethit states for this (aside from the fact I still don't quite understand how to use them) is that I would have to make duplicates of every possible gethit state, and it still doesn't seem like a good way to let me define different effect lengths for each afflicting attack.

I'm open to any suggestions, and I can post any code or such that would seem helpful.

In summary of what I'm looking for:
- Allow an attack to change a variable of the opposing character
- Tick this variable down in [State -2] and manage its effect there
- Cause a persistent palette effect for the duration of the effect
- During the effect, the afflicted character takes damage and may have decreased defense

As a last note, the two statuses shouldn't be able to conflict in normal play, since only one or two characters have poison-causing moves, and neither of them have burning moves of any type.

Thanks in advance for any help and advice you can offer.

~Tya
Re: Burning/Poisoned Effect
#2  July 03, 2017, 03:44:44 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
In a fullgame, there's nothing wrong with using VarSet/VarAdd controllers in a custom state.  Outside of a fullgame, it's definitely not advised as you'll only achieve bugging out the enemy player.

So in the custom state... maybe do something like
type = VarSet
var(5) = GameTime + 500

then in State -2
type = LifeAdd
trigger1 = var(5) >= GameTime
trigger1 = GameTime%10 = 0 ;Adjust "10" to affect frequency of the lifeadd or remove the trigger entirely if you want the life to drain quickly
value = -1

type = VarSet
trigger1 = var(5) < GameTime
var(5) = 0


If you don't want to put the enemy in a custom state at all, read this post.  You could attach a specific value or condition to the HitDef, to be checked & triggered by "GetHitVar(**)"

Last Edit: July 03, 2017, 03:48:43 pm by altoiddealer
Re: Burning/Poisoned Effect
#3  July 03, 2017, 04:48:38 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
I believe this is what you're looking for:

Quote
Additionally, there is a glitch in the Reversaldef controller which causes Player1 to retain Player2's target information even after Player2 returns to an Idle state. This allows Player1 to use target-based state controllers such as TargetState and TargetLifeAdd, as well as the Target redirection trigger, when they would normally not be allowed to. Through specific coding, it is possible to utilize this glitch to replicate a "damage-over-time" effect such as Poison. Please see these threads for more info.

Note that if you plan to have compatibility with IKEMEN, the above trick won't work in IKEMEN.
Re: Burning/Poisoned Effect
#4  July 03, 2017, 05:58:14 pm
  • *
    • USA
Thanks a lot for the help! I really appreciate it.

EDIT: Cleaned up this post to include only the final version of the code, so that anyone else who has the same question can copy it. This includes both a basic Burn and Poison status.

Spoiler, click to toggle visibilty
Last Edit: July 04, 2017, 07:54:49 am by Tyadran
Re: Burning/Poisoned Effect
#5  July 05, 2017, 03:48:01 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Just a quick tip, in case you didn't know - these are both the same:
Code:
trigger1 = GetHitVar(fall.envshake.freq) > 0
trigger1 = GetHitVar(fall.envshake.freq)

As a trigger, any non-zero value is "true"
So in both of the examples, any value returned will be true (except zero)

Inversely, these are also identical
Code:
trigger1 = GetHitVar(fall.envshake.freq) = 0
trigger1 = !GetHitVar(fall.envshake.freq)


You didn't do anything wrong :)  Just a tip