YesNoOk
avatar

common1.cns (Read 3454 times)

Started by BC, November 17, 2014, 05:57:03 pm
Share this topic:

BC

common1.cns
#1  November 17, 2014, 05:57:03 pm
  • avatar
  • ****
    • UK
I want to make a system universal using Mugen's common1.cns. I've summoned a helper in the characters .cns file and coded the state in mugen's common file using an explod inside the helper state. However when I want to destroy the helper/explod using say trigger = var(6)=1 it doesn't recognize it. So how do I get mugen's common file to recognize triggers based on my character?

EDIT:

Guessing I need sysvar or something?
Accepting commissions
Last Edit: November 17, 2014, 06:06:02 pm by BC
Re: common1.cns
#2  November 17, 2014, 06:56:00 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
You can use character vars in common1 just fine. How are you trying to use them? Post some sample code so we can see.

-[Все слова это только слова.]-

BC

Re: common1.cns
#3  November 17, 2014, 07:07:59 pm
  • avatar
  • ****
    • UK
Code:
;TEST CODE FOR STEP SYSTEM GRAPHIC
[State 0, VarAdd]
type = VarAdd
trigger1 = stateno = 1500 && time = 1  ;Dash Cancel
v = 6
value = 1

[State 0, VarSet]
type = VarSet
trigger1 = var(6)>= 3 ;Limit
v = 6   
value = 3

;========================================================
;Display Helper When you have 1 lvl of power and the variable hasn't incremented yet.
;========================================================
[State 0, Helper]
type = Helper
trigger1 = numhelper(9997)=0
trigger1 = power>= 1000 && var(6)=0
name = "step meter"
ID = 9997
stateno = 9997
pos = 0,0
postype = left
facing = 1
ownpal = 1
supermovetime = 999
pausemovetime = 999

;==========================
common1.cns from Mugen's Data Folder
;==========================
;STEP SYSTEM
[statedef 9997]
velset = 0,0
ctrl = 0
sprpriority = 2
anim = 7999 ;blank anim

[State 0, Explod]
type = Explod
trigger1 = numexplod(9000) = 0
anim = F9000
ID = 9000
pos = 54,23
postype = left
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
pausemovetime = 999
supermovetime = 999
scale = 0.5,0.5
sprpriority = 5
ontop = 1
ownpal = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = var(6)=1 ;remove when the variable 6 from the players file has incremented.
id = 9000
Accepting commissions
Re: common1.cns
#4  November 17, 2014, 08:32:57 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
The problem with your code is with your trigger for your Explod. As soon as it gets removed, the numexplod(9000)=0 trigger will make it respawn. This would be so quick it looked like nothing happened.

-[Все слова это только слова.]-

BC

Re: common1.cns
#5  November 17, 2014, 08:54:48 pm
  • avatar
  • ****
    • UK
Changing the trigger to !time still doesn't make it disappear even when my characters var(6)=1

(Note: the common1.cns isn't in my character folder it's in the data folder in Mugen incase that helps)
Accepting commissions
Re: common1.cns
#6  November 18, 2014, 10:22:18 am
  • *****
  • Shame on you!
    • USA
The problem with your code is with your trigger for your Explod. As soon as it gets removed, the numexplod(9000)=0 trigger will make it respawn. This would be so quick it looked like nothing happened.
  BC Try adding
[State 0, Explod]
type = Explod
triggerall = animelem = 1
trigger1 = numexplod(9000) = 0
To get around the bug Алексей mentioned.

Also, one thing I'd suggest. Take the code out of common and put it into your characters. Once it works properly move it to common. This way you know it's the code or the file structure
vVv Ryuko718 Updated 10/31/22 vVv

BC

Re: common1.cns
#7  November 18, 2014, 10:48:42 am
  • avatar
  • ****
    • UK
I moved it character side and the problem is

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,var(6)>0
id = 9000

The RemoveExplod is the issue, because if I use a destroyself with the same trigger it destroys the helper fine. So is this a bug?


EDIT:

[State 0, Explod]
type = Explod
trigger1 = root,var(6)=1
anim = 10002
ID = 5
pos = 54,23
postype = left
scale = 0.5,0.5
removetime = -1
sprpriority = 5
ownpal = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,var(6)=2
id = 5

this works so it seems it's my variable that's the issue. But I want the explod to appear when the variable is 0 but it won't remove if I do that!??
Accepting commissions
Last Edit: November 18, 2014, 11:22:06 am by BC
Re: common1.cns
#8  November 18, 2014, 01:31:19 pm
  • *****
  • Shame on you!
    • USA
this works so it seems it's my variable that's the issue. But I want the explod to appear when the variable is 0 but it won't remove if I do that!??

It will remove it. But your code is instantly spawning it again. So YOU will never see it disappear but it did. for 1 tic, possibly 0 tics...

Also, not sure but
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,var(6)>0
id = 9000

ID = 9000 there and

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,var(6)=2
id = 5
 ID = 5 there.

Again,
 
[State 0, Explod]
type = Explod
trigger1 = numexplod(9000) = 0
anim = F9000
ID = 9000
pos = 54,23
postype = left
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
pausemovetime = 999
supermovetime = 999
scale = 0.5,0.5
sprpriority = 5
ontop = 1
ownpal = 1

What ever contains this ^^^ will instantly spawn helper 9000. Put

[State 0, Explod]
type = Explod
trigger1 = var(6)= 0
trigger1 = numexplod(9000) = 0
You only want it to show up if Var 6 is zero right? and you want it gone if var 6 is equal to 1 or more. So put that.
vVv Ryuko718 Updated 10/31/22 vVv

BC

Re: common1.cns
#9  November 19, 2014, 09:45:44 am
  • avatar
  • ****
    • UK
Either way it's still not working, I've corrected my code and no luck.

Code:
[State 0, VarAdd]
type = VarAdd
trigger1 = stateno = 1500 && time = 1
v = 6
value = 1

[State 0, VarSet]
type = VarSet
trigger1 = var(6)>= 3
v = 6   
value = 3

[State 0, Helper]
type = Helper
trigger1 = numhelper(9997)=0
name = "step meter"
ID = 9997
stateno = 9997
pos = 0,0
postype = left
facing = 1
ownpal = 1
supermovetime = 999
pausemovetime = 999
ignorehitpause = 1
persistent = 0



Helper State: (triggers provided do not make a difference)

[statedef 9997]
type = A
anim = 7999


;If the explods trigger is root,var(6)=1 it appears when the variable is equal to 1 and disappears when the variable is equal to  2
(if set in the removeexplod)
;But I want it to disappear when it's equal to 1. But for some reason it's not doing that.

[State 0, Explod]
type = Explod
trigger1 = root,var(6)=0
trigger1 = numexplod(5)=0
anim = 10002
ID = 5
pos = 54,23
postype = left
scale = 0.5,0.5
removetime = -1
sprpriority = 5
ownpal = 1
persistent = 0

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,var(6)=1
id = 5

Accepting commissions
Last Edit: November 19, 2014, 09:52:19 am by BC
Re: common1.cns
#10  November 19, 2014, 10:18:31 am
  • ***
  • ^First attempt ain't so bad......
    • buckus.mugen-infantry.net/
If I understand correctly, you want the explod to show when root,var(6)=0, and disappear when root,var(6)=1 or more, right?
If so, try this:

Code:
[State 0, Explod]
type = Explod
trigger1 = root!,var(6)
trigger1 = numexplod(5)=0
anim = 10002
ID = 5
pos = 54,23
postype = left
scale = 0.5,0.5
removetime = -1
sprpriority = 5
ownpal = 1
persistent = 0
 
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = root,var(6)
id = 5

What's the trigger that resets var(6) to 0?

BC

Re: common1.cns
#11  November 19, 2014, 02:58:59 pm
  • avatar
  • ****
    • UK
Nothing's resetting the variable just yet, I'm just trying to get the graphic to work properly first. Even adding a reset sctrl doesn't make much difference, I tried that code but still nothing, this should be simple but I'm convinced it's a bug lol.

I might need a work around? I'll wait for other responses. Thanks for helping so far though guys.
Accepting commissions
Re: common1.cns
#12  November 19, 2014, 06:47:16 pm
  • ***
  • ^First attempt ain't so bad......
    • buckus.mugen-infantry.net/
I'm sure it's something minor that's being overlooked. I had a similar situation with explods for my full game. Best solution may be to just re-code it altogether. What worked for me is I switched summoning the explod from a helper to the chars themselves in a negative state(negative states are shared through all chars in common1). Good luck with everything.

BC

Re: common1.cns
#13  November 19, 2014, 07:08:10 pm
  • avatar
  • ****
    • UK
Ok It works coding it as an explod in state -2 which is cool! but a shame because I wanted to code it using my method but at least it's working now. thanks man.

     Posted: November 23, 2014, 01:56:38 am
Ok I found the problem!

For those who are interested, this was stupidly overlooked by me.

The explod was removing but only for player 1 because I forgot to position player 2's graphic, so they were sharing the exact same position so when player 1's disappears player 2's is still there LOL

I found it out by accident by doing the move using player 2 after I did it with player 1 then it finally disappeared. D'OH!
Accepting commissions