The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => Topic started by: MarioManX1983 on November 11, 2019, 02:13:53 AM

Title: How to Make Helpers Variable Stay The Same Between Rounds?
Post by: MarioManX1983 on November 11, 2019, 02:13:53 AM
I have been trying to teach myself how to make characters off and on and have run into a problem. No matter what I try, (I have looked all over the Development Help and Mugen Class Boards.) I cannot get a Variable I set up inside a Helper to keep its value from one round to the next. (I'm trying to use this Variable to keep the Helper turned a different way after the first round.)

This is the Variable Code I am currently using.
Spoiler, click to toggle visibilty

I saw in my characters Constants.cns File that, "If you want your variables to persist between matches, you need to override state 5900 from common1.cns." Is this really what I need to do? And if so, then how? Thank you to anyone who can help.
Title: Re: How to Make Helpers Variable Stay The Same Between Rounds?
Post by: Cyanide on November 11, 2019, 06:44:38 AM
Thats a character only thing. Helpers are destroyed between rounds and have thier own variable stack. However you can pass your variable to the player and reference it in later rounds when yoh spawn the helper again

Type = parentvarset
Trigger1 =
Var(58) = var(58)

Then i n a later round. Varset var(58) = parent, var(58)

You shouldn't have used all 60 yet so that ought to be reasonable. If
Title: Re: How to Make Helpers Variable Stay The Same Between Rounds?
Post by: DeathScythe on November 11, 2019, 09:57:38 AM
Additionally, overriding state 5900 is just to keep variables for the next match, not the next round. You said you want to keep it between rounds, so no need to do that. The method that Cyanide mentioned works well.
Title: Re: How to Make Helpers Variable Stay The Same Between Rounds?
Post by: Kolossoni on November 11, 2019, 10:28:23 AM
That's some hard accomplishment you're trying to achieve here.

I would suggest adding/changing the values for the parent (the main character) like how Cyanide proposed and testing it from there.
Maybe you would need to destroy the helper and make it summon again in the next round and read the parent's values from there. Dunno about this, never tried it :P
Title: Re: How to Make Helpers Variable Stay The Same Between Rounds?
Post by: XGargoyle on November 12, 2019, 01:07:06 AM
Helpers are always destroyed between rounds and also if the intro is skipped
Title: Re: How to Make Helpers Variable Stay The Same Between Rounds?
Post by: MarioManX1983 on November 17, 2019, 06:31:42 AM
I've tried what Cyanide suggested but the Variable is still not staying the same between rounds. It keeps resetting to Zero.

The ParentVarSet Code that I am currently using.

Code:
[State 1914, ParentVarSet]
type = ParentVarSet
trigger1 = 1
var(13) = 10
ignorehitpause = 1
persistent = 1
Title: Re: How to Make Helpers Variable Stay The Same Between Rounds?
Post by: Nep Heart on November 17, 2019, 06:47:05 AM
 What value is the character's IntPersistIndex set to? Also, get rid of any var resets in statedef 5900 just in case.
Title: Re: How to Make Helpers Variable Stay The Same Between Rounds?
Post by: MarioManX1983 on November 17, 2019, 11:06:26 PM
Nep Heart asked:
Quote
What value is the character's IntPersistIndex set to?

Setting that to Zero, (along with tweaking a few other things), seams to have finally worked. All of the Variables are staying the same between rounds and the helper is acting, (basically), the way I want it.

Thank you very much to Nep Heart and everyone else for there help.

All the code used and explanations on what they do;

Spoiler, click to toggle visibilty

The end result of all that code is a Helper that only appears if the intro was skipped, (Thereby giving the illusion that it never left.), stays on screen and in the proper state between rounds and, if hit by either the player or the opponent by a crouching attack during any round, will fall over to the left if hit from the right and vice-versa and stay knocked over between rounds.