Noob question: How to create clones?

Started by Agent Z, December 03, 2008, 05:23:45 AM

Previous topic - Next topic

Agent Z

I'm customizing Tetsu by XCB right now as an entryway into creating Mugen characters, and I wanted to know how to make him not only duplicate himself, but have the duplicate fight alongside him. I've searched both google and this board for "helper" tutorials, "controller" tutorials, and other related tutorials, as well as studied the character Itachi by anjel for clues.

I managed to get the duplicate already. Here is the code I've done:

Spoiler (click to show)

;-------------------------------------------------------------------------------
; Raibunshin no Jutsu!
;-------------------------------------------------------------------------------

[Statedef 1110]
type = S
physics = S
velset = 5,0
anim = 1074
ctrl = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S0,13
channel = -1
freqmul = 1.0


[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 1
value = S0,4
channel = -1
freqmul = 1.0


[State 0, EnvShake]
type = EnvShake
trigger1 = AnimElem = 1
time = 40
freq = 120


[State 1110, Helper]
type = Helper
helpertype = normal ;player
keyctrl = 0
trigger1 = stateno = 1110 && numhelper <= 1
postype = p1
pos = 0,0
stateno = 1111
bindtime = 1
ownpal = 1
name = "bunshin"
ID = 11000
size.xscale ;(float)
size.yscale ;(float)
size.ground.back ;(int)
size.ground.front ;(int)
size.air.back ;(int)
size.air.front ;(int)
size.height ;(int)
size.proj.doscale ;(int)
size.head.pos ;(int,int)
size.mid.pos ;(int,int)
size.shadowoffset ;(int)
;ignorehitpause =
;persistent =


[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1,0
channel = -1
freqmul = 1.0


[State 1110, 1]
type = ChangeState
trigger1 = AnimTime >= 60
value = 0
ctrl = 1


;-------------------------------------------------------------------------------
; Raibunshin
;-------------------------------------------------------------------------------

[Statedef 1111]
type = S
physics = S
velset = -5,0
anim = 1074

[State 1111, SelfState]
type = SelfState
trigger1 = AnimTime >= 60
value = 0
;anim =
;ctrl =
;ignorehitpause = 0
persistent = 1


[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1,0
channel = -1
freqmul = 1.0


[State 1110, 1]
type = ChangeState
trigger1 = AnimTime >= 60
value = 0
ctrl = 1

The animations are just poses. What happens so far is Tetsu "separates" into two versions of himself, a bunch of special effects go off, and that's it. The clone just stands there without a hitbox or anything.

No more clones can be created thanks to the trigger in the helper state, but Tetsu still does the animation for the technique when I press the command... another issue I need help with. I guess a numhelper<=1 might do the trick, but where do I put such a trigger? .cmd or--where?

Thanks a lot for the help!
The Red Threat has arrived in Gilta Nnea. Nine heroes are prophecied to defeat him, but no one knows who they are. When a journey to the Hollowlands unites players in an all-out war, the stage is set for the heroes' rise. This is their battle. METAL SHADOW

Shamrock

It's easy.

Just use some code I have written and and you will have clones popping up all over the place. LOL



Agent Z

Quote from: shamrock on December 03, 2008, 05:27:19 AM
It's easy.

Just use some code I have written and and you will have clones popping up all over the place. LOL


I'm sorry but, where do I find your code?
The Red Threat has arrived in Gilta Nnea. Nine heroes are prophecied to defeat him, but no one knows who they are. When a journey to the Hollowlands unites players in an all-out war, the stage is set for the heroes' rise. This is their battle. METAL SHADOW

Shamrock

LMAO. Sorry I was joking about my shitty coding. You have created something I often do accidentally.

I'm no expert on Helpers because I haven't coded any that use hitboxs but from what I can tell your helper is going to state 1111 and that would need to have hitboxes. As far as everything else goes you just need commands and change states which you have. Unless I did not understand the problem.

I'll move you over to the Development help section and I know that CY has the answer for you.

Agent Z

Quote from: shamrock on December 03, 2008, 05:54:59 AM
LMAO. Sorry I was joking about my shitty coding. You have created something I often do accidentally.

I'm no expert on Helpers because I haven't coded any that use hitboxs but from what I can tell your helper is going to state 1111 and that would need to have hitboxes. As far as everything else goes you just need commands and change states which you have. Unless I did not understand the problem.

I'll move you over to the Development help section and I know that CY has the answer for you.
Lol, thanks anyway.

State 1111 replicates state 0. However the little bugger is still playing invisible. I'm sure it has to do with the way the clone is created, or how it's defined or something.

Btw, does CY = Cyanide?
The Red Threat has arrived in Gilta Nnea. Nine heroes are prophecied to defeat him, but no one knows who they are. When a journey to the Hollowlands unites players in an all-out war, the stage is set for the heroes' rise. This is their battle. METAL SHADOW

Rajaa Retired

#5
there is a wrong way to do it like using a helper with keyctrl, or there is an advanced way to do it, which would probably boggle our mind if anyone tried to explain it to you.


you will need various states for the helper go to and probably a seperate, stand walk pose, either that or you could fill a bunch of your normal states with sctrl and ishelper triggers, you can check out my lilith to see how i did it, pretty strait forward if you know the triggers well :P

also if you don't want limited clones, how about just removing the numhelper trigger period? or if you don't want him to do the aniamtion just use numhelper=0 as a triggerall

Shamrock

Please Rajaa boggle our minds because I could use this too.

Rajaa Retired

i explained it already even after i said that :P

a main state for the helper to go back to that is a hub of all other changestates, a separate walk state etc.... would be coded accordingly whatever you want the clone to do, you can kindly copy one of your states and change the number of it, and then add neccassry triggers like hittoveride whatever.
i never realLy used hitoverrides i just modified the states 5000-5999 using ishelper triggers. it's nothing more than coding AI into a PsEudo cmd file that has roots that exTend out to many other states, be it non helper specific states or not.

it's pretty easy now that i think about it, the main problem for someone just trying to do it, is actually geting the helper to respond to things because of their limited knowledge on how triggers work, this was the first advnced code i worked on myself, but in the end i removed it form my character and it showed back up in lilith, who i recommend to look at if you want an idea, be sure to look at my 5000-5999 as well to see whats in their, the cns is separate for the clone so it should be easy to follow.

again it's either the separate states for the helper or it's the ishelper triggers or bith, i went with both. :P

Shamrock


Agent Z

Quote from: Rajaa on December 03, 2008, 06:20:51 AM
i explained it already even after i said that :P

a main state for the helper to go back to that is a hub of all other changestates, a separate walk state etc.... would be coded accordingly whatever you want the clone to do, you can kindly copy one of your states and change the number of it, and then add neccassry triggers like hittoveride whatever.
i never realLy used hitoverrides i just modified the states 5000-5999 using ishelper triggers. it's nothing more than coding AI into a PsEudo cmd file that has roots that exTend out to many other states, be it non helper specific states or not.

it's pretty easy now that i think about it, the main problem for someone just trying to do it, is actually geting the helper to respond to things because of their limited knowledge on how triggers work, this was the first advnced code i worked on myself, but in the end i removed it form my character and it showed back up in lilith, who i recommend to look at if you want an idea, be sure to look at my 5000-5999 as well to see whats in their, the cns is separate for the clone so it should be easy to follow.

again it's either the separate states for the helper or it's the ishelper triggers or bith, i went with both. :P

Thanks a bunch, I'm off to try that now.

Basically, just have Tetsu create the helper, and then put the helper into its own states from then on? What about the hitboxes? How come my helper doesn't have any even though it's in state 0? I walked through it with both players one and two, so it isn't a team issue or anything...

Thanks again.
The Red Threat has arrived in Gilta Nnea. Nine heroes are prophecied to defeat him, but no one knows who they are. When a journey to the Hollowlands unites players in an all-out war, the stage is set for the heroes' rise. This is their battle. METAL SHADOW

Agent Z

 :sugoi:
ARIGATO GOZAIMASHTA!!! HE CAN WALK!
:sugoi:

I am still confused as to why the opponent can walk through the clones, but screw that for now, I'm about to make this guy totally badarse. :D
The Red Threat has arrived in Gilta Nnea. Nine heroes are prophecied to defeat him, but no one knows who they are. When a journey to the Hollowlands unites players in an all-out war, the stage is set for the heroes' rise. This is their battle. METAL SHADOW

Rajaa Retired

Nagi Prablami =no problem(lol. i don't know Japanese)

I'm sure you are very happy. :)

Agent Z

Well, I've made some significant progress with the clone, so a moment of cheers and backflips please.

Now I can't figure out how to get the helper to communicate with Tetsu at all. I wanted to make a twelve second timer that would destroy the clone, but the only place I know where to put the code is in Tetsu's .cmd, which seems to be the only thing recording everything that's going on in the .cns files. Here is a piece of code I inserted earlier in the .cmd that worked:
[State -1, Raibunshin power drain]
type = PowerAdd
triggerall = numhelper(11100) ;The clone itself must be available for the power to start draining.
triggerall = stateno != 1109 ;This is the state Tetsu goes into to create the clone. When he leaves this state,
                            ;his power will start draining.
trigger1 = power > 0 && time %8 = 0 ;The power drains over time so I did the time% thingy.
value = -15
ignorehitpause = 0

That worked. After Tetsu made the clone, his power started draining on its own at exactly the right speed I wanted. However, when I tried to make a variable change to 1 to activate the clone's "DestroySelf" trigger, it didn't work, and instead Mugen crashed when Tetsu ran out of power and the clone tried to destroy itself that way.

Here is the code:
[State -1, Raibunshin timer]
type = Varset
trigger1 = numhelper(11100) && !time%20 = 0 ;%20 just to see if it would work. Before it was time >= 720.
v = 11100
value = 0
ignorehitpause = 1
persistent = 0

[State -1, Raibunshin timer]
type = Varset
trigger1 = numhelper(11100) && time%20 = 0
v = 11100
value = 1
ignorehitpause = 1
persistent = 0

And on the clone's end:
[State 1111, DestroySelf]
type = DestroySelf
trigger1 = MatchOver
trigger2 = parent, life = 0 || parent, power = 0
trigger3 = var(11100) = 1 ;Right here--this is where the variable comes in.
ignorehitpause = 0

So what's up with that? If it works for the other code, what's the difference here? Is it something to do with "VarSet"?

Thanks for the help. The clone is coming along great otherwise. :) I got most of its movement down-pack.
The Red Threat has arrived in Gilta Nnea. Nine heroes are prophecied to defeat him, but no one knows who they are. When a journey to the Hollowlands unites players in an all-out war, the stage is set for the heroes' rise. This is their battle. METAL SHADOW

Rajaa Retired

varset

read it carefully, then check out the number you used for the variable.


Agent Z

Quote from: Rajaa on December 04, 2008, 04:25:21 AM
varset

read it carefully, then check out the number you used for the variable.

I feel like an idiot... :P

But even though I changed the variable number, it still won't work... I feel it has something to do with how I'm using "time". I've switched it around a bit but nothing seems to be working.

[State -1, Raibunshin timer]
type = Varset
triggerall = stateno != 1109
trigger1 = numhelper(11100)
v = 19
value = 0
ignorehitpause = 1
persistent = 0


[State -1, Raibunshin timer]
type = VarAdd ;Instead of VarSet, so that it adds up over time
triggerall = stateno != 1109
trigger1 = numhelper(11100)
trigger1 = time%60 = 0 ;time%60 is 1 second, right?
v = 19
value = 1
ignorehitpause = 1
;persistent = 1

And for the clone:
[State 1111, DestroySelf]
type = DestroySelf
trigger1 = MatchOver
trigger2 = parent, life = 0 || parent, power = 0
trigger3 = var(19) = 3 ;As in 3 seconds
ignorehitpause = 0

Sorry if I somehow missed what you were saying, Raj. I read through the reference several times and could find nothing but the variable number as the culprit.
The Red Threat has arrived in Gilta Nnea. Nine heroes are prophecied to defeat him, but no one knows who they are. When a journey to the Hollowlands unites players in an all-out war, the stage is set for the heroes' rise. This is their battle. METAL SHADOW

Rajaa Retired

is the helper in that state when you want it to be destroyed? you might want to put the destroyself in a negative state with a triggerall=numhelper(11100)

Agent Z

Quote from: Rajaa on December 04, 2008, 05:20:05 AM
is the helper in that state when you want it to be destroyed? you might want to put the destroyself in a negative state with a triggerall=numhelper(11100)
I tried doing that, but the timer still didn't work. Everything else (the power = 0 and life = 0 triggers) did, and they worked while the helper was in the middle of other states like running and dashing.
The Red Threat has arrived in Gilta Nnea. Nine heroes are prophecied to defeat him, but no one knows who they are. When a journey to the Hollowlands unites players in an all-out war, the stage is set for the heroes' rise. This is their battle. METAL SHADOW

Rajaa Retired

#17
you'll probably need to put a destroyself in all of the states the helper go into then.

Agent Z

Okay then, guess there's no other way around it... Thanks again.
The Red Threat has arrived in Gilta Nnea. Nine heroes are prophecied to defeat him, but no one knows who they are. When a journey to the Hollowlands unites players in an all-out war, the stage is set for the heroes' rise. This is their battle. METAL SHADOW

Agent Z

#19
I've updated Tetsu. You guys can check out the thread here: http://mugenguild.com/forumx/index.php?topic=90098 or download him directly from here: http://www.mediafire.com/file/yxttcgmmamk/CustomTetsu(UpdatedDec04-08).rar

To unlock the clone, just go into his .cmd file and delete the semicolons around the "Raibunshin" changestate. I'd really like some feedback on it; perhaps one of you might find something I missed?

Thanks for all the help so far! :)
The Red Threat has arrived in Gilta Nnea. Nine heroes are prophecied to defeat him, but no one knows who they are. When a journey to the Hollowlands unites players in an all-out war, the stage is set for the heroes' rise. This is their battle. METAL SHADOW