YesNoOk
avatar

some questions (Read 602 times)

Started by sgn15, July 16, 2011, 07:06:28 am
Share this topic:
some questions
#1  July 16, 2011, 07:06:28 am
  • ***
1. i want my char to blink (between black and white). i have tried using palfx but it doesnt blink for either black or white. i also tried using S in anim trans but i dont know how to make it blink really fast between black and white. is it possible? by black and white, i meant that the whole silhouette of my char is changing between black and white really fast, like every 2 ticks. i want this to last for some time.

2. anyone familiar with DBZ anime? when great explosions happen there, its like the whole screen is slowly turning into white, like a blinding light. then it goes back to the screen the same slow pace. anyone knows how to do that?

3. about helper's size issues. i want to call a helper but i want its entrance to be small to enlarging to its normal size. so how do i do that? should i call the helper's size.xscale and yscale to be lower than 1 then how do i change it back to normal after some time?

sorry for the multiple questions. i just thought its best to put in 1 thread than make individual threads for each
Re: some questions
#2  July 16, 2011, 07:18:40 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Quote
1. i want my char to blink (between black and white). i have tried using palfx but it doesnt blink for either black or white. i also tried using S in anim trans but i dont know how to make it blink really fast between black and white. is it possible? by black and white, i meant that the whole silhouette of my char is changing between black and white really fast, like every 2 ticks. i want this to last for some time.
Make 2 different sprites in your photo editing program, one completely black, the other completely white. You can do this by turning the contrast all the way to 255+ or all the way -255 for black and white respectively. Then make an animation that does the blinking or use ChangeAnim to change the animation every 2 ticks or so ... etc.

Quote
2. anyone familiar with DBZ anime? when great explosions happen there, its like the whole screen is slowly turning into white, like a blinding light. then it goes back to the screen the same slow pace. anyone knows how to do that?
You might be able to pull that off with the BGPalFX sctrl.

Quote
3. about helper's size issues. i want to call a helper but i want its entrance to be small to enlarging to its normal size. so how do i do that? should i call the helper's size.xscale and yscale to be lower than 1 then how do i change it back to normal after some time?
Use a VarSet and VarAdd. Set the var to be something really minute as a value, such as ".1"; Use VarAdd to increase it by a small or large static amount using whatever triggers you wish. Use AngleDraw and set the scale values to be "fvar(#), fvar(#)." Then when fvar(#) has reached a certain amount, reset it back to 1, or scale using VarAdd in the opposite direction.


-[Все слова это только слова.]-
Re: some questions
#3  July 16, 2011, 07:25:07 am
  • ***
Quote
You might be able to pull that off with the BGPalFX sctrl.
so i use it normally like i would a normal palfx? i think not
Re: some questions
#4  July 16, 2011, 09:16:50 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Quote
so i use it normally like i would a normal palfx? i think not
Have you ever tried it? With PalFX you can make your character completely white or black or even transparent shades between. If you can do that with PalFX and BGPalFx is that same, only applied to the background, then I'd think this is quite possible.

-[Все слова это только слова.]-
Re: some questions
#5  July 17, 2011, 02:50:36 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
For the black/white yes you can do it.

trigger1 = var(counter) > 0
trigger1 = gametime%2 = 0
add = 255,255,255
mul = 0,0,0
time = 1
ignorehitpause = 1

trigger1 = var(counter) > 0
trigger1 = gametime%2 = 1
add = 255,255,255
mul = 255,255,255
time = 1
ignorehitpause = 1

That's black and white, in quick succession.

Allpalfx will give the same effect. Use a helper to apply it so it can happen regardless of the state p1 is in.

trigger1 = time > 0
add = 0+time*2,0+time*2, 0+time*2
mul = 255,255,255
time = 1

And reverse that to make it fade back. Preferably in a new state so you can reset the timer.

Last one. Don't use a variable. Create the helper as you normally would. Apply 2 angledraws

scale = 0+time/20, 0+time/20

As soon as time/20 >= 1 you set the scale to 1 for both.

Remember though, clsn's do not change for angledraw.


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: some questions
#6  July 17, 2011, 04:09:49 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Cynaide, do variables have some sort of significant overhead when in use in MUGEN? You seem to be very opposed to using variables for things. I've got no problem with not using variables, it's just that I've become so accustomed to using variables in all the programming I do (not just CNS of course). I tend to suggest using them a lot. Is there a legitimate reason why I should not be or is this a matter of personal preference?

-[Все слова это только слова.]-
Re: some questions
#7  July 17, 2011, 04:30:11 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Mugen has limited variables. Why use one when you can use none. Basically, the player gets 60 integer and 40 float. Although you rarely go that high it's good planning not to use them when you don't need them, just in case you do need them later. Also, requires additional typing where it's not really needed. Even if helpers do get their own set, my method uses 2 controllers, yours takes 4.


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: some questions
#8  July 17, 2011, 05:02:19 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Thanks for the reply. I don't disagree with your method at all. I prefer it now that I see what you can do; how you can simply things. I merely asked to possibly learn something new and I have. To me CNS is the most awkward programming/scripting language I've ever seen, and I've programmed Windows Assembly before. :P I try to apply what I know to be true about programming into CNS and it does't work out all the time. :P Thanks for clearing that up. WON'T make this mistake again (of using vars when they're not needed).

-[Все слова это только слова.]-
Re: some questions
#9  July 17, 2011, 02:00:13 pm
  • ***
cyanide, thanks. i have a few questions though.

For the fading in and fading out problem:
so when the helper changes to a new state to fade back , what do i need to change in the codes of allpalfx? i tried changing the + to - but it faded into black instead. i wanted the screen to fade into white then fade back to the original look of the screen. how do i "reverse" fade?

and allpalfx i used didnt affect the "empty" part of my power bar and also my char's shadow was still there. so those 2 things were not covered by the palfx (when the screen was solid white). both power bar and shadow problem are only for p1

for the black/white blinking problem:
i want to use it for my char for duration of animelem 22 and 23

trigger1 = var(10) > 0
trigger1 = gametime%2 = 0
trigger1 = animelem = 22
add = 255,255,255
mul = 0,0,0
time = 1
ignorehitpause = 1

trigger1 = var(10) > 0
trigger1 = gametime%2 = 1
trigger1 = animelem = 22
add = 255,255,255
mul = 255,255,255
time = 1
ignorehitpause = 1

doesnt work?
and how do i stop it? basically blinking black and white for the duration of the 22nd and 23rd animelem but stop blinking when 24th animelem happens

for the last problem:
i forgot to add another helper as attack. so i changed my decision on which helper will attack and which helpers are only for display. right now i changed the displaying but non-attacking helper as 2 explods (one scaled, one normal size) that are synchronized in timing (one happens after another). but is there a way to make it in 1 explod? or i just should maintain it as helper then?

@kenshinx0
actually i try to avoid using variables myself too. only use it for AI. my reason is same with cyanide but i also have another reason: i suck at coding using variables XD
Re: some questions
#10  July 18, 2011, 09:15:42 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I used the palfx editor in fighter factory to establish what i needed to alter. You should do the same.

For the blinking. Animelem = 22 is true for ONE tick. Seriously, docs have a look. You want

animelemtime(22) >= 0 && animelemtime(24) < 0 OR a time range trigger.

Ugh explod. You need to use a variable AND modifyexplod, yuck. Use a helper thanks. You can easily drop another one in. Mugen takes up to 56 and 4 is no big deal.


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: some questions
#11  July 19, 2011, 07:14:09 am
  • ***
ok. sorry for those, i have fixed the palfx and allpalfx. havent tried the scaling of either explod or helper, but i guess the helper method is easier and makes more sense.

i still do not get why the allpalfx doesnt cover the my lifebar empty's part and also my shadow while everything else on screen is white (including p2's lifebar and shadow). any ideas why it happens? i already tried to use sprpriority = 7 for the helpers doing the allpalfx. i want to fix it because it looks weird when the screen is white but something else isnt. thanks in advance

i will try either the helper or explod method later and ask again if i have issues. thanks
Re: some questions
#12  July 19, 2011, 08:34:44 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Lifebars empty part may be related to a sub transparency. If those give you issues

assertspecial
flag = globalnoshadow
flag = nolifebars


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: some questions
#13  July 19, 2011, 03:13:46 pm
  • ***
ok thanks.

going back to the black and white blinking palfx

Spoiler, click to toggle visibilty

it only blinks black and white once? i already used persistent = 1
i wanted the blinking to happen for the whole duration of 22nd animelem and stop when the 23rd animelem happens.

and about the angledraw problem:

the sprite is too big, so my "normal size" would be 0.5,0.5

Spoiler, click to toggle visibilty

so it shrinks instead when time/20 >=1
can you explain why the scale is time/20 ?
i wanted the angledraw to work this way: so i call the helper, helper is something like 0.2,0.2 or 0.3,0.3 at time=0 then slowly and visibly increases in size up to when its already 0.5,0.5
thats what i was trying to do.
Last Edit: July 19, 2011, 03:40:00 pm by sgn15
Re: some questions
#14  July 20, 2011, 08:32:53 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I told you, use a RANGE. Animelem = 22 is only true for ONE TICK. Please read my posts.

As for the other one. Math please. time/20 should give you a really small value for the first frame, and increase with time

The way time/20 works in ticks is 0, 0.05, 0.1, 0.15, 0.2 and so on. Tell it to STOP when the value is > 0.5 in the trigger.

We're getting silly here if you're not going to actually work out what you're doing while you do it.


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: some questions
#15  August 11, 2011, 08:13:49 am
  • ***
sorry for kind of bumping this thread, but i only worked on this now

; start appearing at 22nd animelem small enlarging until animelemtime(22) >= 50
; then it stays at 1,1 scale until animelemtime(22) >= 90
; then it decreases until it disappears (destroyself)

[State 0, AngleDraw]
type = AngleDraw
trigger1 = animelemtime(22) >= 0
;value =  (winmugen only)
scale = 0+time/30, 0+time/30
persistent = 1

[State 0, AngleDraw]
type = AngleDraw
trigger1 = animelemtime(22) >= 50
;value =  (winmugen only)
scale = 1,1
persistent = 0

[State 0, AngleDraw]
type = AngleDraw
trigger1 = animelemtime(22) >= 90
;value =  (winmugen only)
scale = time-time/30, time-time/30
persistent = 1

please help on the scale values, i tried many things already. are my math correct for the increasing and decreasing?

and this helper is on the ground (p1's feet level) so i need a persistent = 1 posadd (or bind to parent ?) also, i used the same triggers of angledraw?

please help in more detail. thanks


edit:

[State 0, Trans]
type = Trans
trigger1 = time = 0
trans = add
persistent = 1

this trans doesnt work. i dont know why
Re: some questions
#16  August 11, 2011, 09:04:04 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
It's trying to do 2 scales at the same time. Tell it to stop.

Time = 0 is only true for one tick. Change your trigger.

Aside from hitdefs attackmulset and defencemulset ALL bloody sctrls are only true for one tick. Please don't ask one of these again. Your first step to "blah doesn't work" is to make it trigger1 = 1. If it doesn't work from THERE you have something else wrong.


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: some questions
#17  August 11, 2011, 04:07:10 pm
  • ***
ok. is my formula for the decreasing angledraw correct?

I tweaked and tested for several times already, and after some time, I think I got the increasing and 1,1 scale angledraw correct already. i just cant make the last angledraw (decreasing) work.

edit:
actually
scale = time-time/20, time-time/20
is indeed wrong for decreasing value. its actually increasing still.
any tips for the decreasing?
Re: some questions
#18  August 11, 2011, 04:41:35 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
For decreasing I'd use cos() if I were you. If you visualize the curve, it seems perfect for what you need, doesn't it? The formula you'd use would be:

Quote
1+cos(time*A)*B
A is a floating point value that controls the speed of the decrease.
B is also a floating point value that controls the speed.
Fool around with these values until you get the desired effect
Start with A=.9, B=1

Implementing it is easy, just make your scale values equal to the cos formula above.
scale = cos(...), cos(...)

You will have to the adjust the trigger so it's active for the right amount of time. Using trigger=1 here will continue the cosine curve forever and you'll get a decreasing and increasing effect.

-[Все слова это только слова.]-
Re: some questions
#19  August 14, 2011, 06:29:06 am
  • ***
kenshinx0, did you meant it like this?

[State 0, AngleDraw]
type = AngleDraw
trigger1 = parent,time = [106,145]
;animelemtime(22) >= 0
;value = 0
scale = time/30, time/30
persistent = 1

[State 0, AngleDraw]
type = AngleDraw
trigger1 = parent,time = [146,195]
;animelemtime(22) >= 50
;value = 0
scale = 1,1
persistent = 1

[State 0, AngleDraw]
type = AngleDraw
trigger1 = parent,time = [196,245]
;animelemtime(22) >= 90
;value = 0
scale = 1 + cos(time*1.5)*1, 1 + cos(time*1.5)*1
;30/time,30/time
persistent = 1

i tried many values for both a and b, the effect is the same (its like "wobbling or heatbeat effect" by increasing and decreasing continuously until it destroyself)

i think cosine is not for this?

p.s.
i like math but not really these angle stuff in math
so i tried using sine and tangent instead of cosine but same formula
i think tangent is more appropriate for decreasing
but i still havent made it to work perfectly to my choice, im still testing using several values for a and b

and i notice the increasing angledraw doesnt work or is too fast, i might change the scale formula there too
so for increasing angledraw, i just inverse the decreasing formula? by inverse i meant raising to exponent -1 (or 1 over the whole formula)
Last Edit: August 14, 2011, 06:41:18 am by sgn15
Re: some questions
#20  August 14, 2011, 07:06:59 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
We can go back to variables here.

varadd
time = [0,120]
fv = 0.01

varset
time = [121,140]
fv = 1

varadd
time > 14
fv = -0.01

And just have one angledraw always looking at that fvar.


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: some questions
#21  August 14, 2011, 07:42:58 am
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
kenshinx0, did you meant it like this?

[State 0, AngleDraw]
type = AngleDraw
trigger1 = parent,time = [106,145]
;animelemtime(22) >= 0
;value = 0
scale = time/30, time/30
persistent = 1

[State 0, AngleDraw]
type = AngleDraw
trigger1 = parent,time = [146,195]
;animelemtime(22) >= 50
;value = 0
scale = 1,1
persistent = 1

[State 0, AngleDraw]
type = AngleDraw
trigger1 = parent,time = [196,245]
;animelemtime(22) >= 90
;value = 0
scale = 1 + cos(time*1.5)*1, 1 + cos(time*1.5)*1
;30/time,30/time
persistent = 1

i tried many values for both a and b, the effect is the same (its like "wobbling or heatbeat effect" by increasing and decreasing continuously until it destroyself)

i think cosine is not for this?

p.s.
i like math but not really these angle stuff in math
so i tried using sine and tangent instead of cosine but same formula
i think tangent is more appropriate for decreasing
but i still havent made it to work perfectly to my choice, im still testing using several values for a and b

and i notice the increasing angledraw doesnt work or is too fast, i might change the scale formula there too
so for increasing angledraw, i just inverse the decreasing formula? by inverse i meant raising to exponent -1 (or 1 over the whole formula)
Well in order to work with cosine properly, you need to stop triggering right when the curve gets to the bottom or lowest point on the curve. But, since this is confusing for you, let's use Cyanide's variable method.

-[Все слова это только слова.]-