YesNoOk
avatar

change background gradually? (Read 3629 times)

Started by supercain, June 29, 2020, 08:23:50 am
Share this topic:
change background gradually?
#1  June 29, 2020, 08:23:50 am
  • avatar
  • **
    • Germany
Hi,

I have tried this one many times but it just doesnt work

Code:
[State 8000, go dark]
type = BGPalFX
trigger1 = numexplod(11011) > 0 && time < 90
time = -1
add = -(time + 9),-(time + 9),-(time + 9)

this is supposed to darken the background (-90,-90,-90 to be exact) as soon as numexplod(11011) appears but gradually and then just stay like that but instead it keeps on flashing. Why is that?

Thank you.
Re: change background gradually?
#2  June 30, 2020, 09:31:18 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I could see turning off. Flashing doesn't make a lot of sense though. Unless you have 2 active.

Quick check is to make the code simpler. Try it at obvious values that you can see. Take out triggers to make it simpler. Figure out which setting makes it flash. Its possible that the time -1 is the issue. Try setting it to 1 instead. You'll need an extra one to maintain the colour if you do that.


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: change background gradually?
#3  June 30, 2020, 11:47:56 pm
  • avatar
  • **
    • Germany
I dont think I can make it any more simple than that. I can take out time but then it wont stop getting dark and I want it to stop at -90 for all 3 values. The problem seems to be that if the player changes into another state before hitting 90 ticks then the time counter resets.
Re: change background gradually?
#4  July 02, 2020, 01:31:50 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Is that in state -2? I thought it was a super. Or use a helper which would give you state independent control.


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: change background gradually?
#5  July 03, 2020, 10:58:40 pm
  • avatar
  • **
    • Germany
Its in state -3 of common1.cns. I dont know if a fatality can qualify as a super but the thing is that whenever a character starts to perform a fatality, the background should go dark gradually.
Re: change background gradually?
#6  July 05, 2020, 03:17:16 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You probably want a helper to manage that then. Time will only work if you stay in 1 state the whole time. Juzt use a helper and 2 bgpalfx. 1 for the fade nd the other for the permanent setting. You can use it for all of the fatalities.


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: change background gradually?
#7  July 11, 2020, 09:30:32 pm
  • avatar
  • **
    • Germany
How about gametime instead of time?
Re: change background gradually?
#8  July 12, 2020, 03:48:26 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
No. Gametime is a constant through the whole match. Its only less than 90 for the first 2 seconds. It will continue counting up until the round ends at whatever time that is. Could be 1200. Could be 3600.


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: change background gradually?
#9  July 13, 2020, 05:55:07 am
  • avatar
  • **
    • Germany
So this code:

stateno = 3000 && gametime = 76

doesnt mean 76 ticks after state no. 3000 began but after the match started??
Re: change background gradually?
#10  July 13, 2020, 09:24:33 am
  • avatar
  • ***
    • https://sites.google.com/site/mgmurrow/
Supercain so you are basically coding a mortal kombat fatality where you defeat p2 and when you input your command for the fatality you want the screen to gradually darken but once it gets to a certain darkness you want that darkness to remain until the round is over right? If this is the case then use a helper like Cyanide said, spawn the helper when p2 is defeated in the -2 state, inside that helper use the first BgPalFx to fade to the darkness you want, then use the second BgPalFx to keep it at the darkness you want, destroy the helper once the round is over.

Hope this helps

MGMURROW
Re: change background gradually?
#11  July 13, 2020, 12:46:47 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
So this code:

stateno = 3000 && gametime = 76

doesnt mean 76 ticks after state no. 3000 began but after the match started??
Basically yes. That would only apply if you were in state 3000 at that precise moment. Which would be unlikely. Do the helper thing. Your life will be easier.


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: change background gradually?
#12  July 13, 2020, 07:03:55 pm
  • avatar
  • **
    • Germany
I think I got it. Thank you everyone.