YesNoOk
avatar

P2StateNo Shenanigans (Read 27212 times)

Started by Afterthought, March 07, 2018, 03:20:13 am
Share this topic:
P2StateNo Shenanigans
#1  March 07, 2018, 03:20:13 am
  • avatar
  • **
Coming back at you all with a new question.

I did some research and saw that, apparently, inverting controls wasn't possible. I spent a lot of time today disproving that theory, through the use of a custom state.

The problem lies in the fact that while the commands work as I intended them to, nothing else will. Attack commands don't work, taunt doesn't work. On top of that, if P2 is sent into any other state before the custom state's duration is up, P2 will stay "locked" in that state: debug won't show the stateno, but P2 won't be able to attack or taunt, and the controls remain inverted.

I want P2 to retain their ability to attack while in this state, obviously. Probably not a new problem to anyone, and I'm sure there's an easy fix but I'm not quite grasping it. Any help would be appreciated!

Re: P2StateNo Shenanigans
#2  March 07, 2018, 04:37:44 am
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Is this for a fullgame?

Re: P2StateNo Shenanigans
#3  March 07, 2018, 05:56:03 am
  • ******
    • www.justnopoint.com/
Re: P2StateNo Shenanigans
#4  March 07, 2018, 01:29:36 pm
  • avatar
  • **
@altoiddealer: No. It would be if I had the time to apply whatever to every character. (I have a lot of characters that would need patching.)

@Just No Point: I trust your word, but I'm not immediately sure what EXPLODsive buffering would do to fix the issue. On top of that I'd still need P2 to leave the state after a set amount of time, unaffected by anything else. If you could sum up how it'd help I'd appreciate it. I will analyze your KFM in the meantime.
Re: P2StateNo Shenanigans
#5  March 07, 2018, 04:22:24 pm
  • ******
    • www.justnopoint.com/
http://mugenguild.com/forum/topics/fix-all-your-command-issues-explodsive-buffering-system-180772.0.html
Above explains what it is

Thing is that you would have to patch characters that don't use this buffering to work with it and you said you're not trying to do that.

There really isn't a way to do this universally without the other characters being in on the idea.

But anyone that uses this system will automatically be compatible.

Basically if a certain explod ID exists for the opponent then the buffering will reverse your commands.
Re: P2StateNo Shenanigans
#6  March 07, 2018, 06:56:46 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Maybe you could use SelfStates from the custom state, and have a fullscreen invisible helper ready to "hit" them to bring back into the custom state?

Thing is you won't be able to predict a lot of their moveset, just basics really.

Type = SelfState
trigger1 = SelfAnimExist(200)
trigger1 = command = "x"
value = 200

Another idea would be to have a helper looking for the enemy's current StateNo, and when triggered have it hit them and SelfState them to a different State.  Like enemy,StateNo = 200.  Then hit, bring into custom state, and SelfState to state 500 or whatever

Last Edit: March 07, 2018, 07:01:03 pm by altoiddealer
Re: P2StateNo Shenanigans
#7  March 08, 2018, 01:07:24 pm
  • avatar
  • **
@Just No Point: I have no doubt this method would work but the general agreement is that every character would need to be patched to work in conjunction with the commands and variables. That's a bit out of my time constraints at the moment but I will keep your method in mind for future ref.

@altoiddealer: Basics are all I need honestly, since I knew going in that trying to get specials, hyper, etc. wouldn't be a cakewalk. I'll try the first method. Still looking for a way to make it so regardless of what happens, P2 is restored back to their own states after a set amount of time.

I've had the unfortunate luck of losing access to a lot of work I did due to a hard drive failure, meaning the things I did that I've discussed in this topic have to be redone. I will leave this topic unsolved, and I'll post an update once I've recreated what I needed to.
Re: P2StateNo Shenanigans
#8  March 10, 2018, 07:48:17 am
  • avatar
  • **
Alright, I've hit a point where I can get back to what I've attempted here.

Gonna skip out on having this attack grant access to anything past the four basic movements (walk forward, back, jump, crouch), and save it for when I have a bit more time to poke around with states.

I'll ask once more, barring almost everything else I mentioned previously: when P2 is sent to this state, they are unable to access any state past the four basic movements I edited myself. This is intentional. However, if hit early on while in the state, they instantly revert back to their own states (not desired), and they don't return to their own states after a certain amount of time (also not desired). I want P2 to be stuck in that state for X amount of time REGARDLESS of what influences the character otherwise, and THEN return to their own states after X amount of time.

If this is impossible then I'll attempt something different, or scrap the idea altogether.
Re: P2StateNo Shenanigans
#9  March 10, 2018, 12:07:16 pm
  • ******
    • www.justnopoint.com/
It is impossible. Unless you use a method similar to what I said.
Re: P2StateNo Shenanigans
#10  March 10, 2018, 02:36:14 pm
  • avatar
  • **
That simply won't happen. Not anytime soon at least.

It's sad considering I was really banking on getting this mechanic working NOW, but I'll leave it be and come back to it when I'm ready.
Re: P2StateNo Shenanigans
#11  March 10, 2018, 05:13:43 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
*Edit* Disclaimer, this makes sense in my head, and could take awhile to set up proper.  If you get the concept maybe just code it quick down and dirty to check this is a viable solution.

For the time: Set a var when this move starts, and then compare it to gametime for your triggers.
Type = Varset
Var(10) = Gametime

If you attach your PlayerID to the HitDef with an attribute like
fall.envshake.ampl = ID
(fall.envshake.time must be 0, or not included)

...you can then accurately redirect triggers from the custom state via PlayerID, like:
Type = SelfState
trigger1 = Gametime > PlayerID(GtHitVar(fall.envshake.ampl)),var(10) + 1000 ;effect duration = 1000


Like I said: fullscreen helper waiting to hit p2 and send back to whatever state you want.
You can log the enemy's PlayerID as a Var when you first hit, in case target gets dropped and you need to redirect triggers
VarSet
trigger1 = numtarget
var(11) = target,ID

Then in the helper something like
HitDef
trigger1 = PlayerIDExist(var(11))
trigger1 = PlayerID(var(11)),StateNo = [***HITSTATE RANGE***]
Id = 1000

TargetState
trigger1 = numtarget(1000)
Value = 2000 ;The Custom state you wanna force p2 back into

Last Edit: March 10, 2018, 05:24:55 pm by altoiddealer
Re: P2StateNo Shenanigans
#12  March 10, 2018, 06:40:24 pm
  • *****
  • Estoy siempre listo para un desafĂ­o.
    • Puerto Rico
    • im41784@yahoo.com
It would take you like 20 mins to implement the
explod buffer system to 1 char, it's just alot of copy
pasting that's what I do and my chars work just fine
with it.

I copy paste the commands from KFM I know my char
also uses and renumber the state no if I need to that's
all its too easy.
Re: P2StateNo Shenanigans
#13  March 10, 2018, 07:56:28 pm
  • avatar
  • **
@altoiddealer: I appreciate your persistence when it comes to helping with code; looking over what you chalked up, it makes sense logically, but god knows what truly does and doesn't work in MUGEN. Part of the learning experience I suppose. I will try this out later tonight; I was kinda intentionally avoiding a(nother) fullscreen helper, but I've no other options so I'll attempt this before dropping it completely.
Re: P2StateNo Shenanigans
#14  March 10, 2018, 11:34:36 pm
  • ******
    • www.justnopoint.com/
His method will work if you don't mind a helper hitting them again. I was assuming you didn't want the char to get hit again when not in the state just to change him back to said state.
Re: P2StateNo Shenanigans
#15  March 11, 2018, 04:06:14 am
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
I'm not too savvy with HitOverride... maybe you can just use that in the custom states?

Re: P2StateNo Shenanigans
#16  March 11, 2018, 04:28:51 am
  • avatar
  • **
@Just No Point: Backwards: I want P2 to remain in the "confused" state if they are hit, and then, after a set amount of time, leave the state and return to their own.

@altoiddealer: I could experiment with HitOverrides but I'll try what you sent first.

It dawned on me that unlike the other topics I've created, I actually did not share any code here! That probably would have been immensely helpful. (I have some things going on in real life and that kinda took some of my attention away, oops)

Here is the code with the changes AD has proposed; I'm sure a lot of it is placed in the wrong spots so please feel free to correct me.

Attack Start code:

Code:
[Statedef 3500]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 3101
sprpriority = 2
facep2 = 1
velset = 0,0

[State 0]
Type = Varset
trigger1 = time = 0
Var(35) = Gametime

[State 3000, Explod]
type = Explod
trigger1 = Time = 0
anim = 8300
id = 8300
supermove = 1
sprpriority = 4
ownpal = 1

[State 3000, VarSet]
type = VarSet
trigger1 = animelem = 2
var(4) = 1

[State 3000, Helper]
type = Helper
trigger1 = animelem = 2
stateno = 8500
supermovetime = 99999999
pos = -15,ceil(-160*const(size.yscale))
ownpal = 1
id = 8500

[State 0, PalFX]
type = envshake
trigger1 = time = 40
time = 16
ampl = -3
ignorehitpause = 1

[State 3000, SuperPause]
type = SuperPause
trigger1 = animelem = 2
time = 36
movetime = 36
darken = 1
anim = -1
p2defmul = 1
poweradd = -5000

[State 3001, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = S3001, 0
channel = 0

[State 3001, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 1480,0
channel = 0

[State 0, PalFXWiz]
type = PalFX
triggerall = (time%2)=0
;triggerall = time <= 240
;triggerall = numhelper(3301)
trigger1 = animelemtime(5) >= 0
time = 1
add = 256,-50,-50
mul = 256,200,200
sinadd = 0,0,0,1
invertall = 0
color = 128


[State 0, Helper]
type = Helper
;trigger1 = time = 55
trigger1 = animelem = 8
helpertype = normal
name = "Mind Env"
ID = 3501
stateno = 3501
pos = 0,0
postype = p1
facing = 1
ownpal = 1
persistent = 0
supermovetime = 90
pausemovetime = 90

[State 0]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

First helper (sends opponent into "confused" state):
Code:
[Statedef 3501]
type    = A
movetype= A
physics = N
ctrl = 0
anim = 3500
poweradd = 0
sprpriority = 5
velset = 0,0
facep2 = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,NT,ST,HT
time = 2
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 1
attr = S, NA
palfx.color = 256
palfx.invertall = 1
fall.envshake.ampl = ID


[State 0]
type = TargetState
trigger1 = movecontact
value = 3503

[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0

Second helper (should be used to check if opponent has been knocked out of state, then return to said state):
Code:
[Statedef 3502]
type    = A
movetype= A
physics = N
ctrl = 0
anim = 3500
poweradd = 0
sprpriority = 5
velset = 0,0
facep2 = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,NT,ST,HT
time = 2
ignorehitpause = 1


[State 200, 1]
type = VarSet
trigger1 = numtarget
var(36) = target,ID

[State 200, 1]
type = HitDef
trigger1 = PlayerIDExist(var(36))
trigger1 = PlayerID(var(36)),StateNo = [200, 250]
Id = 1000

[State 200, 1]
type = TargetState
trigger1 = numtarget(1000)
Value = 3503 ;The Custom state you wanna force p2 back into


[State 0]
type = TargetState
trigger1 = movecontact
value = 3503

[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0

"Confused" state:
Code:
[Statedef 3503]
type = S
physics = S
ctrl = 1

[State 0]
type = VarSet
trigger1 = time = 0
var(32) = 1

[State 0]
type = VarSet
trigger1 = time = 100
var(32) = 0

[State 0]
Type = SelfState
trigger1 = Gametime > PlayerID(GetHitVar(fall.envshake.ampl)),var(10) + 1000 ;effect duration = 1000
value = 0

[State 0]
type = SelfState
trigger1 = time = 100
value = 0

As it is currently, var(35) = Gametime throws an error. (That variable is free of use, just in case that was a question.) On top of that there is no code that actually utilizes the second helper YET. Any further tips would be wonderful.
Re: P2StateNo Shenanigans
#17  March 11, 2018, 04:54:30 am
  • ******
    • www.justnopoint.com/
I know, I'm saying that using Altoid's method you'd have the helper hit them again everytime they leave the custom state. Until the timer runs out.
Re: P2StateNo Shenanigans
#18  March 11, 2018, 05:03:53 am
  • avatar
  • **
Ah. Yeah, I was trying to avoid that initially since I'm stubborn and believed there was a workaround. Not so.
Re: P2StateNo Shenanigans
#19  March 11, 2018, 07:21:05 am
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
The helper can have triggers to hit p2 back into confusion state if the timer is still running, AND after p2 has recovered from the hit.  Include triggers like PlayerID(var(**),statetype != H

It's late and I didn't review it too closely but I notice:
-The Player stores initial gametime to Var(35), but the helper attaches ITS OWN PlayerID to the Hitdef, so the trigger in the custom state is not redirected to the right PlayerID.  So for the HitDef attr use parent,ID   Or rework /rearrange thinga if you want the helper to keep track of the time instead

Last Edit: March 11, 2018, 07:30:08 am by altoiddealer
Re: P2StateNo Shenanigans
#20  March 11, 2018, 03:01:09 pm
  • avatar
  • **
I'm going to go all in and say that I'm completely lost. I went in feeling confident that I would assemble this code properly but I'm not getting it. I'm gonna need a little more help.
Re: P2StateNo Shenanigans
#21  March 12, 2018, 05:27:32 am
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Attack Start code:

Code:
[Statedef 3500]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 3101
sprpriority = 2
facep2 = 1
velset = 0,0

[State 3000, Explod]
type = Explod
trigger1 = Time = 0
anim = 8300
id = 8300
supermove = 1
sprpriority = 4
ownpal = 1

[State 3000, VarSet]
type = VarSet
trigger1 = animelem = 2
var(4) = 1

[State 3000, Helper]
type = Helper
trigger1 = animelem = 2
stateno = 8500
supermovetime = 99999999
pos = -15,ceil(-160*const(size.yscale))
ownpal = 1
id = 8500

[State 0, PalFX]
type = envshake
trigger1 = time = 40
time = 16
ampl = -3
ignorehitpause = 1

[State 3000, SuperPause]
type = SuperPause
trigger1 = animelem = 2
time = 36
movetime = 36
darken = 1
anim = -1
p2defmul = 1
poweradd = -5000

[State 3001, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = S3001, 0
channel = 0

[State 3001, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = 1480,0
channel = 0

[State 0, PalFXWiz]
type = PalFX
triggerall = (time%2)=0
;triggerall = time <= 240
;triggerall = numhelper(3301)
trigger1 = animelemtime(5) >= 0
time = 1
add = 256,-50,-50
mul = 256,200,200
sinadd = 0,0,0,1
invertall = 0
color = 128


[State 0, Helper]
type = Helper
;trigger1 = time = 55
trigger1 = animelem = 8
helpertype = normal
name = "Mind Env"
ID = 3501
stateno = 3501
pos = 0,0
postype = p1
facing = 1
ownpal = 1
persistent = 0
supermovetime = 90
pausemovetime = 90

[State 0]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

First helper (sends opponent into "confused" state):
Code:
[Statedef 3501]
type    = A
movetype= A
physics = N
ctrl = 0
anim = 3500
poweradd = 0
sprpriority = 5
velset = 0,0
facep2 = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,NT,ST,HT
time = 2
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 1
attr = S, NA
palfx.color = 256
palfx.invertall = 1
fall.envshake.ampl = ID

[State 0]
Type = Varset
trigger1 = movehit
Var(35) = Gametime ;TIME WHEN ENEMY GETS CONFUSED
persistent = 0
;I MOVED THIS TO HELPER AND ADJUSTED

[State 200, 1]
type = ParentVarSet ;MOVED HERE, CHANGED TO PARENTVARSET
trigger1 = numtarget
var(36) = target,ID

[State 0]
type = TargetState
trigger1 = movecontact
value = 3503

[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0

Second helper (should be used to check if opponent has been knocked out of state, then return to said state):
Code:
[Statedef 3502]
type    = A
movetype= A
physics = N
ctrl = 0
anim = 3500
poweradd = 0
sprpriority = 5
velset = 0,0
facep2 = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,NT,ST,HT
time = 2
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = PlayerIDExist(root,var(36)) ;P1's VAR
trigger1 = PlayerID(root,var(36)),StateNo = [200, 250]
Id = 1000
;ADD MORE LIKE PRIORITY, MAYBE UNGUARDABLE, IGNOREHITPAUSE, etc

[State 200, 1]
type = TargetState
trigger1 = numtarget(1000)
Value = 3503 ;The Custom state you wanna force p2 back into

[State 0, DestroySelf]
type = DestroySelf
trigger1 = numtarget(1000) ;ADJUSTED
trigger1 = target,stateno = 3503 ;ADDED

"Confused" state:
Code:
[Statedef 3503]
type = S
physics = S
ctrl = 1

[State 0]
type = VarSet
trigger1 = time = 0
var(32) = 1

[State 0]
type = VarSet
trigger1 = time = 100
var(32) = 0

[State 0]
Type = SelfState
trigger1 = Gametime > PlayerID(GetHitVar(fall.envshake.ampl)),var(35) + 1000 ;effect duration = 1000
;THIS IS THE 1ST HELPERS PLAYERID FROM THE HITDEF.  HELPER'S VAR 35
value = 0

[State 0]
type = SelfState
trigger1 = time = 100
value = 0

I fixed a few things, and wrote some comments... maybe it makes some more sense now

Re: P2StateNo Shenanigans
#22  March 12, 2018, 01:45:47 pm
  • avatar
  • **
Thank you, everything makes a lot more sense now; I now understand more how the sequence works when everything is in their proper spots. Tired putting codes in a whole bunch of different places left and right but I couldn't get it working. But I have a better understand of what each variable does, use of IDs, etc.

Now, a new question: how would I make it so P2 is hit by their "own" helper (3502)? I assume it has something to do with that ID, but anytime P2 is sent out of that state, the helper isn't activated. No fullscreen hitbox in debug, state changes as usual.

Code:
[Statedef 3503]
type = S
physics = S
ctrl = 1

[State 3000, Helper]
type = Helper
trigger1 = stateno != 3503
stateno = 3502
supermovetime = 99999999
pos = -15,ceil(-160*const(size.yscale))
ownpal = 1
id = 3502
 
[State 0]
type = VarSet
trigger1 = time = 0
var(32) = 1
 
[State 0]
type = VarSet
trigger1 = time = 100
var(32) = 0
 
[State 0]
Type = SelfState
trigger1 = Gametime > PlayerID(GetHitVar(fall.envshake.ampl)),var(35) + 1000 ;effect duration = 1000
;THIS IS THE 1ST HELPERS PLAYERID FROM THE HITDEF.  HELPER'S VAR 35
value = 0

As a side, I have actually found a way (I assume it's a glitch) to make it so P2 has access to all of their states while their main controls are reversed.

So if there's a way to turn var(32) (the variable controlling the reversed inputs) off for P2 by P1's states (since P2 would no longer have access to it through their "own") that would essentially be what I needed in the first place.
Re: P2StateNo Shenanigans
#23  March 12, 2018, 03:33:34 pm
  • *****
  • Shame on you!
    • USA
There may be a convoluted way of doing that. I dont know of an easy "Target,Var(x)=" Method. I've never tried something like this.
But what I imagine would be P2 monitoring a helper and setting a var based on it's state or it's animation.
You'd spawn a helper from P1 and a helper from P2, and you'd use P1's helper to hit P2's helper into a custom state. This would effectively change P2's variable.
I think.

I would only try that if you HAD to try that though.

You can have P2's helper hit P2 by using
affectteam = team_type (string)  team_type specifies which team's players can be hit by this HitDef. Use B for both teams (all players), E for enemy team (opponents), or F for friendly team (your own team). The default is E.
in the hitdef.
vVv Ryuko718 Updated 10/31/22 vVv
Re: P2StateNo Shenanigans
#24  March 12, 2018, 10:20:34 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
You obtain p2's PlayerID as var(36), so a helper should be able to monitor p2 and hit him when needed.
Example,
HitDef
teigger1 = PlayerIDExist(parent,var(36))
trigger1 = PlayerID(parent,var(36)),StateNo = XXX

You should probably just keep the first helper around until the timer runs out, and have it do additional hits as necessary

Re: P2StateNo Shenanigans
#25  March 13, 2018, 02:39:38 pm
  • avatar
  • **
I appreciate all of your input. The truth is, I can feel my mental health deteriorating trying to figure this out, and without delving too much into my personal business, I have enough to deal with here and there without this weighing in. On top of that I'm always experimenting so I can't stay focused on this too much longer.

I'm gonna poke around with it once I have more time to using everything you all posted, but otherwise I'm gonna leave this topic unsolved (for now). Again I am more than grateful for all of your input. You've all helped me more than I imagined.
Re: P2StateNo Shenanigans
#26  March 14, 2018, 05:36:35 am
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Yeah, what you're trying to do is pretty complicated for MUGEN :)

I think it's doable, but will take lots of bug testing and fine tuning after the groundwork is layed out.

Good luck!

Re: P2StateNo Shenanigans
#27  March 18, 2018, 07:48:44 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I know this is a little old but accessing anything other than basic commands is impossible globally. You can do it if both files actually have the same commands in (iirc). But then you need to know what states these go to for it to work. No point having qcf start a hyper.

The basic walk forward back stuff can be achieved with the same method as the poison code/glitch where p2 is hit and then hits a helper that uses reversaldef to retain its target. Then its just timers and looking at targetstate. Whenever its 5120 or 0 or something send it back to the custom ones. For the specials etc you're kind of out of luck.


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.