YesNoOk
avatar

Help with Desummoning my Stand? (Read 775 times)

Started by ZeroZero7, April 27, 2020, 06:28:13 am
Share this topic:
Help with Desummoning my Stand?
#1  April 27, 2020, 06:28:13 am
    • USA
So I've been working on a stand mechanic for one of the characters in my mugen project, and I'm at a bit of a brick wall at the moment. Basically, I've gotten my Stand into the scene by pressing a button ("a" in my case), I just have no idea how to get them out of the scene when I press the same button. The Stand is a Helper and so far I've tried:

.Sending the Stand into a second custom state in which it would destroy itself

.Having the Stand destroy itself when the button that created it is pressed again

.Having the Stand be destroyed when a Variable is set at a certain value

.Having the Stand be destroyed when both a button press and the same variable is set to a certain value

I've also tried looking at various HFTF characters without much luck. Most of the code is uncommented, and any comments that are there are in Japanese. There was a Part 4 Jotaro that did help put me in the right direction, but now I seem to be stuck here. I've looked around on various sites and there doesn't seem to be any documentation or tutorials on the subject.

To help give you a better idea of where I left off, here's the code:

CNS:
;Star Platinum Summon
[Statedef 700]
type    = S            ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I            ;Move-type: A-attack, I-idle, H-gethit
physics = S
ctrl = 0            ;Set ctrl (Def: no change)
anim = 1
poweradd = 0

[State 700, Helper]
type = Helper
trigger1 = Var(10) != 1
helpertype = normal ;player
name = "Star Platinum"
ID = 701
stateno = 701
pos = 25,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0

[State 700, ChangeState]
type = ChangeState
trigger1 = time = 0
value = 0
ctrl = 1
;anim =
;ignorehitpause =
;persistent =

(This sets the Variable I mentioned earlier)
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 10    ;fv = 10
value = 1
;ignorehitpause =
;persistent =

;Star Platinum Return
[Statedef 703]
type    = S            ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I            ;Move-type: A-attack, I-idle, H-gethit
physics = S
ctrl = 0            ;Set ctrl (Def: no change)
anim = 0
poweradd = 0

[State 230, 3]
type = ChangeState
trigger1 = Time = 0
value = 0
ctrl = 1

[State 0, VarSet]
type = VarSet
trigger1 = Time = 0
v = 10    ;fv = 10
value = 0
;ignorehitpause =
;persistent =

Both of these states are for the user. The next states are for the Stand itself:

;STAR PLATINUM

;Stand Idle
[Statedef 701]
type    = A
movetype= I
physics = N
;velset = 0,0
sprpriority = 0
ctrl = 0
anim = 1

[State 191, 2]
type = velset
trigger1 = 1
x = parent,vel x
y = parent,vel y

[State 230, 2]
type = statetypeset
trigger1 = parent,statetype = S
statetype = S
ignorehitpause = 1

[State 230, 2]
type = statetypeset
trigger1 = parent,statetype = C
statetype = C
ignorehitpause = 1

[State 230, 2]
type = statetypeset
trigger1 = parent,statetype = A
statetype = A
ignorehitpause = 1

[State 191, 2]
type = parentvarset
trigger1 = 1
v = 10
value = 1

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 191, 2]
type = turn
trigger1 = facing != parent,facing

[State 1065, 3]
type = bindtoparent
trigger1 = 1
pos = 25,0
time = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = command = "a"
value = 0 (I set this to 0 because I read that in a different forum that setting the Helpers state to zero would destroy it using code set in State 0)
ctrl = 0
;anim =
;ignorehitpause =
;persistent =
[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = command = "a"
v = 10    ;fv = 10
value = 0

[State 701, 2]
type = destroyself
trigger1 = command = "a"




;Desummon
[Statedef 702]
type    = A
movetype= I
physics = N
velset = 0,0
sprpriority = 3
;anim = 9999


[State 702, 2]
type = destroyself
triggerall = time = 0
trigger1 = 1


So I am a bit lost as to what to do here. I didn't want to ask for help and it feels like it should be really simple but I'm honestly lost right now. Would really appreciate any help.

Oh and I mention code in state 0 used to destroy the helper (Which also didn't work). Here's that:

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 1 && ishelper
trigger2 = animelem = 1 && ishelper
ignorehitpause = 1

Edit: I forgot the code I used in the CMD file

;StandSummon
[State -1, Stand Summon]
type = ChangeState
value = 700
triggerall = NumHelper(701)= 0
triggerall = Var(10) = 0
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = [100,105]

;StandReturn
[State -1, Stand Return]
type = ChangeState
value = 703
triggerall = NumHelper = 701
triggerall = Var(10) = 1
triggerall = command = "a"
trigger1 = statetype = S
trigger1 = ctrl
Last Edit: April 27, 2020, 09:54:21 pm by ZeroZero7
Re: Help with Desummoning my Stand?
#2  April 27, 2020, 11:00:57 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
The helpers don't see the commands that you input:
[State 701, 2]
type = destroyself
trigger1 = command = "a"

This means the helper presses the command "a", which is not true, because it's the actual player who does it

You need instead to redirect to the main player like this:

[State 701, 2]
type = destroyself
trigger1 = root,command = "a"
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Help with Desummoning my Stand?
#3  April 27, 2020, 11:19:22 am
    • USA
Just tested that out and that did the trick! Thank you so much!
Re: Help with Desummoning my Stand?
#4  April 27, 2020, 09:46:55 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Good, then mark the post as "solved"
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Help with Desummoning my Stand?
#5  April 27, 2020, 09:54:52 pm
    • USA
Done! Thanks again!