YesNoOk
avatar

P2StateNo Shenanigans (Read 27213 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.