YesNoOk
avatar

P2StateNo Shenanigans (Read 27203 times)

Started by Afterthought, March 07, 2018, 03:20:13 am
Share this topic:
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.