YesNoOk
avatar

Questions about hypers (Read 524 times)

Started by Trinitronity, June 19, 2012, 12:25:54 pm
Share this topic:
Re: Questions about hypers
#21  June 25, 2012, 07:44:09 pm
  • *****
  • Mega Klinklang confirmed
    • USA
    • ricepigeon.webs.com
Wow, I didn't though about that. Thanks. However, I have now new questions:
Code: (mugen)
[State 193001]
type = varrandom
trigger1 = 1
v = 19
range = 0, (((random)^2)^0.5)
If I want to set the variable into a random positive number, does the above code work?
Thanks in advance!

I'm not sure what you're trying to accomplish here. You're using a random within a varrandom range. I'm even sure if Mugen accepts that. But basically the way it works is like this: You specify the range of values you want the var to take and it will randomly choose an interger value within that range. For example:

[mcode]
[State 193001]
type = varrandom
trigger1 = 1
v = 19
range = 100, 200[/mcode]

The above will randomly set var(19) to any value between 100 and 200, inclusively.

Quote
EDIT: Okay, made a new start, and the stars are still going into both directions...
Code: (mugen)
[State 2105]
type = varrandom
trigger1 = 1
v = 19
range = 0, 1000

[State 2105]
type = velset
trigger1 = 1
x = 0.1*var(19)+0.01*var(19)
y = 0.2 * cos((.25+random*.005)*Pi/180)+-vel y*.005;-vel y*(.25+random*.005)+-vel y*.005
Is it, because the X position is something different then I thought?

X pos has nothing to do with it. Rather, it has to do with the way you set up your triggers for your varrandom. You're basically applying a new velocity every tick instead of setting it once and applying acceleration. Also, I take it that the vel x and vel y were copied from the explod's code? Use trigger redirection on those for the parent.

In order to better illustrate what I'm talking about, consider the following:

[mcode]
[State XXX VS]
type = varrandom
trigger1 = 1
v = 10
range = 0,10

[State XXX, VS]
type = velset
trigger1 = 1
x = var(10)
[/mcode]

Mugen goes through each controller in order from top to bottom. Trigger1 = 1 means that it will execute on every tick (time). First it will set the variable to a random value and then apply that value as its x velocity. On the second tick, it'll see that the trigger equates to true, and then will apply a completely new random value to the variable, and apply that as the velocity. This will keep going over and over.

<<-- Updated 09/14/14

You limit yourself so badly when you try to avoid variables. When you get over your fear of the "complexity" of variables, you will find yourself in a better place: A beautiful world where coding is actually fun.
Last Edit: June 25, 2012, 07:58:29 pm by RicePigeon
Re: Questions about hypers
#22  June 25, 2012, 08:54:44 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
In order to better illustrate what I'm talking about, consider the following:

[mcode]
[State XXX VS]
type = varrandom
trigger1 = 1
v = 10
range = 0,10

[State XXX, VS]
type = velset
trigger1 = 1
x = var(10)
[/mcode]

Mugen goes through each controller in order from top to bottom. Trigger1 = 1 means that it will execute on every tick (time). First it will set the variable to a random value and then apply that value as its x velocity. On the second tick, it'll see that the trigger equates to true, and then will apply a completely new random value to the variable, and apply that as the velocity. This will keep going over and over.
Thanks, I only have one question: If the Y value in velset has NOT been set, will MUGEn just use a random Y value, or do I have to put y=random manually?
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns
Re: Questions about hypers
#23  June 26, 2012, 12:01:50 am
  • ******
  • I hang out tough. I'm a real boss.
    • USA
    • litotichues.com/
The omission of any of the two parameters of a velset state controller has no effect on whatsoever parameter is omitted. You can test something as simple as that on your own.

Also, it wouldn't hurt to just indagate random stuff in the docs folder of Mugen. =p
Re: Questions about hypers
#24  June 26, 2012, 09:11:10 pm
  • *****
  • Back to the Beginnings
    • Skype - trinitro.man

  • Online
Thanks for all the help.
Also, in order to NOT ask stupid quetions anymore, I'll look more into the code of example works.
I just did it not enough, because of me fearing, that it would have only "stolen stuff".
This thread is now solved at the moment.
I make characters RP-styled (Current WIP: Marisa):
http://mugenguild.com/forum/topics/marisarp-150600.0.html
Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
you are all small and can't grow manly sideburns