YesNoOk
avatar

How to Make Helpers Variable Stay The Same Between Rounds? (Read 3383 times)

Started by MarioManX1983, November 11, 2019, 02:13:53 am
Share this topic:
How to Make Helpers Variable Stay The Same Between Rounds?
#1  November 11, 2019, 02:13:53 am
  • **
  • Expert Noob
  • I am a lover and a fighter!
    • USA
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.
May you always win every round, both in MUGEN and Life. :)
Re: How to Make Helpers Variable Stay The Same Between Rounds?
#2  November 11, 2019, 06:44:38 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
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


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: How to Make Helpers Variable Stay The Same Between Rounds?
#3  November 11, 2019, 09:57:38 am
  • ****
    • crepa.neocities.org
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.
Re: How to Make Helpers Variable Stay The Same Between Rounds?
#4  November 11, 2019, 10:28:23 am
  • ***
  • 하나뿐인 한국인 대표
  • Ambassador of MugenRevival
    • South Korea
    • sites.google.com/view/kolossoni-mugen
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
Re: How to Make Helpers Variable Stay The Same Between Rounds?
#5  November 12, 2019, 01:07:06 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net

  • Online
Helpers are always destroyed between rounds and also if the intro is skipped
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: How to Make Helpers Variable Stay The Same Between Rounds?
#6  November 17, 2019, 06:31:42 am
  • **
  • Expert Noob
  • I am a lover and a fighter!
    • USA
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
May you always win every round, both in MUGEN and Life. :)
Re: How to Make Helpers Variable Stay The Same Between Rounds?
#7  November 17, 2019, 06:47:05 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 What value is the character's IntPersistIndex set to? Also, get rid of any var resets in statedef 5900 just in case.
Re: How to Make Helpers Variable Stay The Same Between Rounds?
#8  November 17, 2019, 11:06:26 pm
  • **
  • Expert Noob
  • I am a lover and a fighter!
    • USA
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.
May you always win every round, both in MUGEN and Life. :)