YesNoOk
avatar

Making a variable without a varset  (Read 589 times)

Started by Amidweiz, April 22, 2019, 06:54:27 am
Share this topic:
Making a variable without a varset
#1  April 22, 2019, 06:54:27 am
  • ***
    • Canada
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.
Last Edit: April 22, 2019, 06:58:23 am by Amidweiz
Re: Making a variable without a varset
#2  April 22, 2019, 07:05:49 am
  • ***
  • CPU Purple Heart
    • USA
    • www.dailymotion.com/2a8130871d2742d2f4da3b069

  • Online
 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.
Re: Making a variable without a varset
#3  April 22, 2019, 07:32:17 am
  • ***
    • Canada
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.
Re: Making a variable without a varset
#4  April 22, 2019, 07:36:14 am
  • ***
  • CPU Purple Heart
    • USA
    • www.dailymotion.com/2a8130871d2742d2f4da3b069

  • Online
 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.
Re: Making a variable without a varset
#5  April 22, 2019, 08:24:46 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/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.
Re: Making a variable without a varset
#6  April 22, 2019, 08:50:07 am
  • ***
    • Canada
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.
Re: Making a variable without a varset
#7  April 22, 2019, 09:14:44 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/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.
Re: Making a variable without a varset
#8  April 22, 2019, 06:52:56 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
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.

Re: Making a variable without a varset
#9  April 22, 2019, 09:06:37 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/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.
Re: Making a variable without a varset
#10  April 22, 2019, 10:59:48 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
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)

Re: Making a variable without a varset
#11  April 27, 2019, 12:07:41 am
  • ***
    • Canada
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)
Re: Making a variable without a varset
#12  April 27, 2019, 10:30:05 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/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.
Re: Making a variable without a varset
#13  April 28, 2019, 05:20:51 am
  • ***
    • Canada
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.
Re: Making a variable without a varset
#14  April 28, 2019, 05:35:42 am
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
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