Making a variable without a varset

Started by Amidweiz, April 22, 2019, 06:54:27 AM

Previous topic - Next topic

Amidweiz

I was curious if there is any way to make a variable without using a varset. I'm mainly asking this because I was thinking upon trying to make an AI (or in least a base for an AI) that could be dropped into any character without the need to use up a variable with said character. I'm suspecting a helper or an explod might need to be used for this.

Nep Heart

 I know the most common way to achieve that is through the null state controller.

In fact, my most recently released character uses it for her command grab routes, which looks something like this.

Quote[State 1230, Varset]
type = Null
trigger1 = command = "QCF_x"
trigger1 = var(3) := 1 || 1
trigger2 = command = "QCF_y"
trigger2 = var(3) := 2 || 1

Trigger1 sets var(3) to a value of 1 if command "QCF_x" is input.

Trigger2 sets var(3) to a value of 2 if command "QCF_y" is input.

Now, if you're talking about not wanting to spend a single var, go for a explod or projectile stcrl if you want to fake those kind of vars based in "on and off" option select or a helper for more complicated fake variables.

Amidweiz

Quote from: Nep Heart on April 22, 2019, 07:05:49 AM
I know the most common way to achieve that is through the null state controller.

In fact, my most recently released character uses it for her command grab routes, which looks something like this.

Quote[State 1230, Varset]
type = Null
trigger1 = command = "QCF_x"
trigger1 = var(3) := 1 || 1
trigger2 = command = "QCF_y"
trigger2 = var(3) := 2 || 1

Trigger1 sets var(3) to a value of 1 if command "QCF_x" is input.

Trigger2 sets var(3) to a value of 2 if command "QCF_y" is input.

Now, if you're talking about not wanting to spend a single var, go for a explod or projectile stcrl if you want to fake those kind of vars based in "on and off" option select or a helper for more complicated fake variables.

I was sort of aiming for not using variables at all this, so you could "drop" the AI into the character without needing to use a variable. I doubt there would be a situation where there would be a character with all it's variables filled up but I do like the idea anyways.

Nep Heart

 Might be a little complex, but you could could probably set a helper that spawns at the beginning of each round and remains there for the entire match and use explods or projectile state controllers as yes/no signals inside that helper. Said helper will only spawn if the character is AI control, so, it should not exist when the character is in player control. Then again, you can use as many variables as you can inside the helper since every helper has its own variables and is not shared by the player themselves, which is how Vans' buffer system works.

Cyanide

Are you using 1.0 or 1.1? They have ailevel. You can just use that. Not that its possible to make an AI you can put into anything because all states and attacks are different.


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.

Amidweiz

Quote from: Cyanide on April 22, 2019, 08:24:46 AM
Are you using 1.0 or 1.1? They have ailevel. You can just use that. Not that its possible to make an AI you can put into anything because all states and attacks are different.

I was mainly thinking about the AI activator variable, but I do see what you mean with just using the ailevel as the activator (which I was gonna use anyways) and I'm not really too keen on setting up helpers as variables. (I guess a code example would be nice) Though it would be handy if I ever need a variable in the AI.

Cyanide

That part at least is easy. Ignoring the triggers to spawn it you just make a state for it and give the state and helper id really improbable values that n9body is likely to use.

748291047461

For example. However you need to remember that helpers are wiped out every round and are despawned if you skip an intro and they were spawned in that. Variables can be set up so they persist between rounds which is why people used them. Ailevel is 100% reliable as an ai set off though.


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.

altoiddealer

It would use less resources to instead spawn an Explod with an ID, and use "NumExplod(**)" trigger.

As Cyanide said above w/ a helper, I think an Explod would have to be respawned each round as well.


Cyanide

You will have to spawn the explod off screen though. Otherwise you have to add an animation for it or deal with debug flood by using an incorrect one.


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.

altoiddealer

Ah, right!

So, if you're willing to also add a blank anim (assign sprite -1,0), then the Explod method I mentioned will work.  Otherwise stick with the original answer (helper method)


Amidweiz

This all sounds great, though I would appreciate a code example for this so I can work off of something. Not to heavily keen on mugen code unfortunately. (I know a bit but not enough to translate what's described to code)

Cyanide

Would like to know why you don't want to use ailevel? You somewhat have to use it as a trigger to spawn things as the other methods rely on adding either tons of commands or using the xor method which false positives a lot in 1.0+ and still needs a lot of cmd modification to work.

With ailevel all your code is contained and you do not need to worry about animations or states or anything except your ai.


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.

Amidweiz

Quote from: Cyanide on April 27, 2019, 10:30:05 AM
Would like to know why you don't want to use ailevel? You somewhat have to use it as a trigger to spawn things as the other methods rely on adding either tons of commands or using the xor method which false positives a lot in 1.0+ and still needs a lot of cmd modification to work.

With ailevel all your code is contained and you do not need to worry about animations or states or anything except your ai.

I mean I'll use AIlevel when I can, I'm just mainly asking for an example of code for setting up a "variable" using said methods described above with the helpers and explods. So if I do need a variable than I have it available for me to use.

altoiddealer

Make an anim... let's sayyyyy anim 9999
Anim is just a 1 frame blank sprite (-1,0) with time -1

Spawn an Explod w/ anim 9999 and give it an ID # and boom, you have your var replacement.

So if you give it ID 9900, you can have a trigger look for your "var" like so
triiger1 = numexplod(9900)

If you want to clear this var, just use the RemoveExplod controller and kill id 9900.

You can use as many of these as you want just give them unique ID numbers