YesNoOk
avatar

need help iroing out bugs in my "push start to pause" system (Read 6026 times)

Started by Memo, June 23, 2017, 12:01:53 am
Share this topic:
need help iroing out bugs in my "push start to pause" system
#1  June 23, 2017, 12:01:53 am
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com
so im thinking about including a old pause system I did for my daigo hotta a couple years ago.
it works perfectly except for one problem.... if you pause game play and push up or down your
character will jump or crotch down when you un-pause the game.

I don't know whats causing it so ill post the code AND a DL link to the char so you can check
it out yourself also.

if I can get this fixed  I will include pause in my chars with a graphic that shows the movelist
and once its down ill gladly post a topic with all the code so you guys can include this in
your characters as well

daigo hotta
http://www.mediafire.com/file/hbwfblbe7gskr7d/Daigo_MEMO.rar

heres the code
Code:
;-----------------------
;Pause
[StateDef 10001]
Type = S
PHYSICS = N
MOVETYPE = I
Ctrl = 0
Anim = -1

[State 3000]
Type = Pause
Trigger1 = RoundState = 2
Persistent = 2
Time = 0
MoveTime = 0

[State 3000, ChargeSND]
type=PlaySnd
Trigger1 = RoundState = 2
trigger1 =!time
value=S1,3

[State 3000, StopSnd]
type = StopSnd
trigger1 =stateno=10001&&time=0
channel = 10

[State 3000]
Type = ChangeState
Trigger1 = Parent,Alive && RoundState = 2
;Trigger1 = Command = "start" && Parent,Command = "start"
Value = 10002

;---------------------------------------
;Pause
[StateDef 10002]
Type = S
PHYSICS = N
MOVETYPE = I
Ctrl = 0

[State 3001]
Type = PlaySnd
Trigger1 = Time = 0
Value = 0, 17

[State 3001]
Type = AssertSpecial
Trigger1 = 1
Flag = nobardisplay

[State 3001]
Type = AssertSpecial
Trigger1 = 1
Flag = nomusic

;[State 3001]
;Type = AssertSpecial
;Trigger1 = 1
;flag = noFG

;[State 3001]
;Type = AssertSpecial
;Trigger1 = 1
;flag = noBG
;flag = intro
;flag2 = invisible
;flag3 = roundnotover
;ignorehitpause =
;persistent =
;-----------------------
;flag = nobardisplay
;flag = noBG
;flag = noFG
;flag = nostandguard
;flag = nocrouchguard
;flag = noairguard
;flag = noautoturn
;flag = nojugglecheck
;flag = nokosnd
;flag = nokoslow
;flag = noshadow
;flag = globalnoshadow
;flag = nomusic
;flag = nowalk
;flag = timerfreeze
;flag = unguardable


;[State 3001]
;Type = BGPalFX
;Trigger1 = 1
;Time = 10
;Mul = 100,100,100
;Add = 70, 70, 70

[State 3001]
Type = Pause
Trigger1 = 1
Time = 10
MoveTime = 10

[State 3001]
Type = ChangeState
triggerall=var(59)=0
Trigger1 = Time >= 6  ;&& Command = "start"
;trigger1 = command = "a" || command = "b" || command = "c" || command = "x" || command = "y" || command = "z"
trigger1 = command = "s"
Value = 10003
[State 3001]
Type = ChangeState
trigger1=var(59)>0
;Trigger1 = Time >= 6 ;&& Command = "start"
Value = 10003

;---------------------------------------
;Pause
[StateDef 10003]
Type = S
PHYSICS = N
MOVETYPE = I
Ctrl = 0

[State 3002]
Type = Pause
Trigger1 = Time = 0
Time = 0

[State 3002]
Type = BGPalFX
Trigger1 = Time = 0
Time = 1

[State 0, DestroySelf]
type = DestroySelf
triggerall=var(59)=0
trigger1 = time>=0
;trigger1 = command = "a" || command = "b" || command = "c" || command = "x" || command = "y" || command = "z"
Trigger1 = Command = "s"

[State -3, RemoveExplod]
type = RemoveExplod
triggerall=var(59)=0
trigger1 = Numhelper(10001) = 0
;trigger2 = parent, Command = "start"
trigger2 = command = "s"
;trigger2 = command = "a" || command = "b" || command = "c" || command = "x" || command = "y" || command = "z"
id = 10001


[State 0, DestroySelf]
type = DestroySelf
triggerall=var(59)>0
trigger1 = time>=0
;Trigger1 = Command = "start"

[State -3, RemoveExplod]
type = RemoveExplod
triggerall=var(59)>0
trigger1 = Numhelper(10001) = 0
;trigger2 = parent, Command = "start"
id = 10001

[State 3002]
Type = ChangeState
Trigger1 = Time = 1
Value = 10001
Re: need help iroing out bugs in my "push start to pause" system
#2  June 23, 2017, 12:37:58 am
  • *****
    • USA
I haven't looked into it too much, but I can try. Let me ask you something as I was looking to do something like this as well, what will you do about multiplayer? Sure you could say locally in actual games player 1&2 can both pause, but will it be like that? Will player2's pause override player 1? Can both pause unpause at will? This was an issue with fidos stuff as the a.i would always pause the game. Human players could also troll and pause. Suggesting for a way to only pause against the A.I. & of course not allow them to use it.
Re: need help iroing out bugs in my "push start to pause" system
#3  June 23, 2017, 12:55:48 am
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com
I haven't looked into it too much, but I can try. Let me ask you something as I was looking to do something like this as well, what will you do about multiplayer? Sure you could say locally in actual games player 1&2 can both pause, but will it be like that? Will player2's pause override player 1? Can both pause unpause at will? This was an issue with fidos stuff as the a.i would always pause the game. Human players could also troll and pause. Suggesting for a way to only pause against the A.I. & of course not allow them to use it.

I can prevent the Ai to pause the game that's easy to do in the cmd and also
Prevent another char pausing if its already paused we can do that with triggers
Or VARs.

I think fidos stuff came out before 1.0 so he didnt have the luxurys we have with
1.0 Ai coding
Re: need help iroing out bugs in my "push start to pause" system
#4  June 23, 2017, 04:49:33 am
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com
I kinda feel like this has to do with mugens command buffer
system.  How would I be able to remove directional control
During the pause states? Hmm.. 

Time to hit the lab and see if I can figure this out myself
Re: need help iroing out bugs in my "push start to pause" system
#5  June 24, 2017, 08:54:36 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
I think I got this figured out. By setting the ctrl to 0 during the pause no commands can be entered during the pause. I've posted the code below but if you want to find you own way to do it that's the main just of it.

I did use two var to make this work, I chose var(55) and its only needed in the -2 portion of the code. I turned off the helpers KeyCtrl and just used root,Command = "s" in the helper instead. also used var(1) and var(2) to detect if you're in a custom state.

I also suggest using a blank animation for this, otherwise if anything hits your helper your pause code will be broken for the rest of the round. I used anim = 9741 in the helper.

Let me know if you find any bugs with this though. It seems good from my testing.

-2:
Code:
;pause
[State -2]
Type = Helper
triggerall = roundstate=2
Triggerall = var(59) = 0
Triggerall = NumHelper(10001) = 0
trigger1 =command = "s"
;you're in a custom state!
trigger2 = var(1) = 1
trigger2 = enemy, command = "s"
Name = "Pause"
ID = 10001
Pos = 0, 10
PosType = P1
StateNo = 10001
KeyCtrl = 0
OwnPal = 1

[State 2000, ctrl 0]
type = CtrlSet
value = 0
trigger1 = numhelper(10001)=1
trigger1 = ctrl = 1
trigger1 = var(55) := 14
ignorehitpause = 1

[State 2000, ctrl 1]
type = CtrlSet
value = 1
trigger1 = numhelper(10001)=0
trigger1 = var(55) = 14
ignorehitpause = 1

[State 2000, reset]
type = null
trigger1 = numhelper(10001)=0 && gametime%2 = 0
trigger1 = var(55) = 14
trigger1 = var(55) := 0
ignorehitpause = 1


CNS:
Code:
;-----------------------
;Pause
[StateDef 10001]
Type = S
PHYSICS = N
MOVETYPE = I
Ctrl = 0
Anim = 9741 ; blank

[State 0, AppendToClipboard]
type = AppendToClipboard
trigger1 = 1
text = "root,var(55) = %d"
params = root,var(55)
ignorehitpause = 1

[State 3000]
Type = Pause
Trigger1 = RoundState = 2
Persistent = 2
Time = 0
MoveTime = 0

[State 3000, ChargeSND]
type=PlaySnd
Trigger1 = RoundState = 2
trigger1 =!time
value=S1,3

[State 3000, StopSnd]
type = StopSnd
trigger1 =stateno=10001&&time=0
channel = 10

[State 3000]
Type = changeState
Trigger1 = Parent,Alive && RoundState = 2
Value = 10002

;---------------------------------------
;Pause
[StateDef 10002]
Type = S
PHYSICS = N
MOVETYPE = I
Ctrl = 0

[State 3001]
Type = PlaySnd
Trigger1 = Time = 0
Value = 0, 17

[State 3001]
Type = AssertSpecial
Trigger1 = 1
Flag = nobardisplay

[State 3001]
Type = AssertSpecial
Trigger1 = 1
Flag = nomusic

[State 3001]
Type = Pause
Trigger1 = 1
Time = 10
MoveTime = 10

[State 3001]
Type = ChangeState
triggerall=var(59)=0
Trigger1 = Time >= 6  ;&& Command = "start"
trigger1 = root,command = "s"
Value = 10003
[State 3001]
Type = ChangeState
trigger1=var(59)>0
Value = 10003

[State 0, BindToRoot]
type = BindToRoot
trigger1 =1
time = 1
facing = 1
pos =0,-2
ignorehitpause =1
persistent =1

;---------------------------------------
;Pause
[StateDef 10003]
Type = S
PHYSICS = N
MOVETYPE = I
Ctrl = 0

[State 3002]
Type = Pause
Trigger1 = Time = 0
Time = 0

[State 3002]
Type = BGPalFX
Trigger1 = Time = 0
Time = 1

[State 0, DestroySelf]
type = DestroySelf
triggerall=var(59)=0
trigger1 = time>=0
Trigger1 = root,Command = "s"

[State -3, RemoveExplod]
type = RemoveExplod
triggerall=var(59)=0
trigger2 = root,command = "s"
id = 10001

[State 0, DestroySelf]
type = DestroySelf
triggerall=var(59)>0
trigger1 = time>=0
;Trigger1 = Command = "start"

[State -3, RemoveExplod]
type = RemoveExplod
triggerall=var(59)>0
trigger1 = Numhelper(10001) = 0
;trigger2 = parent, Command = "start"
id = 10001

[State 3002]
Type = ChangeState
Trigger1 = Time = 1
Value = 10001



-2:
Code:
;custom state detect, by 2OS
[State 2OS]
type=varset
trigger1=1
var(1)=(var(2)!=gametime*2)
ignorehitpause=1
persistent=1



-3:
Code:
;custom state detect, by 2OS
[State 2OS]
type=varset
trigger1=1
var(2)=gametime*2
ignorehitpause=1
persistent=1
Last Edit: June 25, 2017, 07:52:25 pm by ink
Re: need help iroing out bugs in my "push start to pause" system
#6  June 24, 2017, 11:20:02 pm
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com
Thanks dude I just got off work and this is the first thing
im doing when I get home
Re: need help iroing out bugs in my "push start to pause" system
#7  June 24, 2017, 11:32:55 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
No problem man! I just updated it, now you can pause during custom states too.
Re: need help iroing out bugs in my "push start to pause" system
#8  June 24, 2017, 11:38:25 pm
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com
Hell yea, I know plenty of members have been dying to pause
Gameplay and hopefully this works flawlessly so I can post
This in the code library.


EDIT

omg it works perfectly except that it ignores a superpause,
if your try a super and pause during the super pause it
pauses AFTER the super pause ends, I'm going to
experiment a bit here and see if I can find a solution.
Last Edit: June 24, 2017, 11:55:20 pm by Memo
Re: need help iroing out bugs in my "push start to pause" system
#9  June 25, 2017, 01:09:00 am
  • ****
    • USA
    • twitter.com/inktrebuchet
Well damn... I have a couple ideas for this, I'll work on it later tonight.
Re: need help iroing out bugs in my "push start to pause" system
#10  June 25, 2017, 03:14:10 am
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com
Well damn... I have a couple ideas for this, I'll work on it later tonight.

I was thinking about adding a trigger to prevent a player
From pausing during a supermove, I played a game like
That but forgot the name.

Ink of you find a fix for that too i think the system would
Be pretty much complete, theres gonna be some weird
Glitches like explods that have the pausemovetime/
Supermovetime parameter will still play during pause
But that's easy to fix by removing those from ALL
Explode.
Re: need help iroing out bugs in my "push start to pause" system
#11  June 25, 2017, 07:11:39 am
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com
I'm gonna solve this for now until I find a workaround for the superpause issue
but its fixable by preventing pausing during super moves
Pause Game
#12  June 25, 2017, 10:04:31 pm
  • ****
    • USA
    • twitter.com/inktrebuchet
I decided to rewrite this pause system and strip away anything not needed. It still can not pause during any super pauses but outside of that it works great for whatever else. Uses 3 variables: var(55), var(1),var(2)

I'm not sure it's possible to pause during a super pause.

 [StateDef -2]
Code:
;-------------------------------------------------
;pause by Inktrebuchet
[State -2]
Type = Helper
triggerall = roundstate=2
Triggerall = var(59) = 0
Triggerall = NumHelper(444444444) = 0
trigger1 =command = "s"
Name = "Pause"
ID = 444444444
Pos = 0, 10
PosType = P1
StateNo = 444444444
KeyCtrl = 0
OwnPal = 1
     
[State -2, ctrl 0]
type = CtrlSet
value = 0
trigger1 = numhelper(444444444)=1
trigger1 = ctrl = 1
trigger1 = var(55) := 14
ignorehitpause = 1
     
[State -2, ctrl 1]
type = CtrlSet
value = 1
trigger1 = numhelper(444444444)=0
trigger1 = var(55) = 14
ignorehitpause = 1
     
[State -2, Reset]
type = null
trigger1 = numhelper(444444444)=0 && gametime%2 = 0
trigger1 = var(55) = 14
trigger1 = var(55) := 0
ignorehitpause = 1
;-------------------------------------------------




 [CNS]
Code:
;-------------------------------------------------
;pause by Inktrebuchet
[StateDef 444444444]
Type = S
PHYSICS = N
MOVETYPE = I
Ctrl = 0
Anim = 9741 ; blank
 
[State 444444444, start pause]
Type = changeState
Trigger1 = Parent,Alive
Value = 444444445
ignorehitpause =1

[StateDef 444444445]
Type = S
PHYSICS = N
MOVETYPE = I
Ctrl = 0

[State 444444445, No Bars]
Type = AssertSpecial
Trigger1 = 1
Flag = nobardisplay
ignorehitpause =1
 
[State 444444445, No Music]
Type = AssertSpecial
Trigger1 = 1
Flag = nomusic
ignorehitpause =1
 
[State 444444445, Pause]
Type = Pause
Trigger1 = 1
Time = 10
MoveTime = 10
ignorehitpause =1
 
[State 444444445, Un-Pause]
Type = DestroySelf
Trigger1 = Time >= 1 
trigger1 = root,command = "s"
ignorehitpause =1
 
[State 444444445, BindToRoot]
type = BindToRoot
trigger1 =1
time = 1
facing = 1
pos =0,-2
ignorehitpause =1
persistent =1
;-------------------------------------------------
Last Edit: June 26, 2017, 05:42:39 pm by ink
Re: need help iroing out bugs in my "push start to pause" system
#13  June 26, 2017, 12:13:15 am
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com
Awesome, I'll update the code library once I get home thanks dude!
Re: need help iroing out bugs in my "push start to pause" system
#14  June 26, 2017, 05:00:46 am
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com

I found a bug not present in the old code, if you pause during a hit state the lifebars kinda glitch in and out and
the chars look like they complete there hittimes before it pauses
Re: need help iroing out bugs in my "push start to pause" system
#15  June 26, 2017, 05:07:01 am
  • ****
    • USA
    • twitter.com/inktrebuchet
That's weird! I haven't ran into that at all. I did update that code a couple hours after I first updated it. Maybe double check that yours is up to date. I will double check mine again though.
Re: need help iroing out bugs in my "push start to pause" system
#16  June 26, 2017, 05:44:44 am
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com
That's weird! I haven't ran into that at all. I did update that code a couple hours after I first updated it. Maybe double check that yours is up to date. I will double check mine again though.

I will, it happened to me when I hit a enemy and immediately pause

It only happens with the last update you posted recently
Re: need help iroing out bugs in my "push start to pause" system
#17  June 26, 2017, 06:31:40 am
  • ****
    • USA
    • twitter.com/inktrebuchet
I found the problem with it and just updated the code. It's working perfect now. Thanks!

Also the bit for the custom state isn't needed for the old or the new code. It still pauses during the same custom states as it always has though. plus 2 less vars are used!

I have noticed that I can pause during custom states your Daigo uses but not custom states other characters use... I will have to look into why that is later and hopefully be able to pause during any characters custom states.
Last Edit: June 26, 2017, 06:47:27 am by ink
Re: need help iroing out bugs in my "push start to pause" system
#18  June 26, 2017, 07:00:53 am
  • *****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • im41784@yahoo.com
I found the problem with it and just updated the code. It's working perfect now. Thanks!

Also the bit for the custom state isn't needed for the old or the new code. It still pauses during the same custom states as it always has though.

I have noticed that I can pause during custom states your Daigo uses but not custom states other characters use... I will have to look into why that is later and hopefully be able to pause during any characters custom states.

That's odd, I got the code working perfectly in ryu,  but I've only tested it
Against my cvtw2 chars and daigo so I can only speak for these, but its odd
for me because these two have Completely different coding.

What chars were breaking the code?
Re: need help iroing out bugs in my "push start to pause" system
#19  June 26, 2017, 07:08:59 am
  • ****
    • USA
    • twitter.com/inktrebuchet
I Thought it was odd too. I've used a few random characters.

Rajaa's  SF3 Urien, some Athena, and Pots' ShinGouki. Pause is not working when being thrown because commands are not being read. Maybe a ctrl thing, I will have to look into it further.

Re: need help iroing out bugs in my "push start to pause" system
#20  June 28, 2017, 02:34:07 am
  • ****
    • USA
    • twitter.com/inktrebuchet
There is a way to pause the screen during custom states.
There is NOT a way to pause the screen during a custom state and it work perfectly, without adding one state controller to each character's custom state...

I've put an rough example of the state controller that would be used in each character just before the last changestate. This just lets the enemy in the custom state know that the attack is finished.
Code:
[state custom state end]
type = StateTypeSet
trigger1 = ??                ;
trigger1 = var(?) := ??   ; universal variable in all characters. Maybe use a sysvar. state you want p2 in when custom state ends
movetype = I
ignorehitpause = 1

So it looks like unless a new community standard is set, the new pause code I'm working on right now will only work for fullgames or for people willing to patch all of their characters.  and still no pause during a superpause. :bigcry:
Last Edit: June 28, 2017, 03:06:58 am by ink