im helping a friend code a movebasically he has a hoverboard that will hover above the floor during the course of the round....which will be available to jump on or off it.when he is standing on it then ill need to make it invisible as sprites have him standing on the hoverboard already.so my questions-how would i go about making the hoverboard available each round? would i code a helper under statedef - 2(i tried this, and it kept repeating the animation, so i changed it to persistent = 0 which worked, but then i was doing an air jump it kept repeating the animation)(figure i need to use numhelper(blah) = 0)-how would i got about over riding the walking, Turn, crouch, basically all the movement animations? would i use a variable in each of them, like var(10) != 1 or whatever, and the 1 being anim = 10000 which could be him on the board?-or is there a completely different approach to this?also when i get him to jump on the hoverboard, do i just flag it as invisible using assertspecial when he goes into that state or animation?(making it invisible as stated above because he has sprites drawn with him on the hoverboard)
use a var in the character to know whether or not you are on the board; varX = 1 if on board, 0 if off of it., in state5900 reset it to 0.for ease of coding you need states for getting on/off the board.knowing how helpers act in mugen, in st-2 create the helper, use as triggers varX=0 (off the board) and numhelperID=0 ; using whichever id you gave to the board.in the change anims in the walking, etc.. states, add the variable as a condition to change to a different anim.[EDIT]I am not going into any detail on the last part because you did not specify how would the board move.
ah ok thats alot easier than i thought thanks one question what would the trigger be for the varset?p.s your right i didnt.i want the board to move along the ground back and forth, like walking, and be able to just jump(and air jump)EDIT: so whats the varset trigger? the stateno of himon the board when it equals 1?also where do i set the var? state -1, -2, -3? state 0? lol
ok heres what i got so far(the board now shows)[mcode][statedef -2][State -2, Helper]type = Helpertriggerall = var(10)=0trigger1 = NumHelper(10000)=0helpertype = normalname = "hoverboard"ID = 10000stateno = 10000pos = -59,0postype = p1facing = 1keyctrl = 0ownpal = 1supermovetime = 9999999pausemovetime = 9999999[/mcode][mcode][State 0, VarSet]type = VarSettrigger1 = stateno = 11000v = 10value = 1 [State 0, VarSet]type = VarSettrigger1 = stateno = 0v = 10value = 0[/mcode]i set the variable to equal 1 when state number is 11000 which is him on the board. correct?and to 0 when he is in stance?[mcode][statedef 10000]type = Aphysics = Nanim = 10000ctrl = 0sprpriority = -6[State 10000, NotHitBy]type = NotHitBytrigger1 = 1value = SCAtime = 1[/mcode]helper state.it shows up fine at the moment, was my variable triggers ok?or for the value could i just use ifelse(stateno = 11000,1,0)EDIT: also something else i need help with, say i want the command of hopping on to the hoverboard as hard punch(Z) how would i code it so that he sucessfully jumps on the board when near it?........like he'll just jump and land on the floor if not near it....how does he identify, say where the board is?
do i set the variables in state -2?also what are the triggers for the varsets?ok scrap that, lets start again, coz im over tired and confusing myselfright step 1i wanna use state 900 as the hop on board state.....state 901 as on the board....(in which ill have to make the helper invisible because it has sprites on the board already)state 902 jumping off the board.i coded the helper with the trigger1's as numhelper(10000)=0 and also trigger1 as var(1)=0where do i set these variables......and when i code the helper state do i get it to change to a blank anim state when rootdist x = [-10,10](when the player is right near the board) (gave it a better range of -10,10 instead of 0im just stuck on how to go about all of this,.......its confusing me
do not set them in negative states, make it so if helperdist in the parent's cmd is in a certain range, the chaarcter changes to the "hopping up" state, and use the varset in there, same for coming down.
is helperdist a trigger? couldnt find it in the docs....... also "parent's cmd"? did you mean cns?how i check p1's distance for a helper is use rootdist which ive used, how would i check a helpers distance for p1?
helperdist is Abs( (pos x)- (helper(10000), pos X) ) , if that value is < let's say 40 you have something in your cmd like:[State -1]type = ChangeStatevalue = 620triggerall = command = "z"trigger1 = ctrl = 1trigger1 = Abs( (pos x)- (helper(10000), pos X) ) < 40620 is a state in which your char hops into the hover.
ok thnks for that, finally im getting somewhere, the move isnt complete yet, but so far so good.obv i havent used state 620, as thats jump strong punch, so instead i used 6000.
i think im making this out to be more difficult than it is, but im a little stuck still....... apologies for my slowness lol, this is something ive never coded before.ok ill break down what i have so far.helper code[mcode][State -2, Helper]type = Helpertrigger1 = NumHelper(10000)=0trigger1 = var(1)=0helpertype = normalname = "hoverboard"ID = 10000stateno = 10000pos = -59,0postype = p1facing = 1keyctrl = 0ownpal = 1supermovetime = 9999999pausemovetime = 9999999[/mcode]helper state[mcode][statedef 10000]type = Aphysics = Nctrl = 0anim = 10000sprpriority = -6[State 10000, NotHitBy]type = NotHitBytrigger1 = 1value = SCAtime = 1[/mcode]not sure if that needed a changestate.........? because i need the helper to dissapear when on the board...as i explained before, the sprites have him already on the board.hop on state(UNFINISHED)[mcode][statedef 6000]type = Sphysics = Smovetype = Ictrl = 0anim = 900sprpriority = 2[State 6000, StateTypeSet]type = StateTypeSettrigger1 = time = 0statetype = Aphysics = N[State 6000, VelSet]type = VelSettrigger1 = time = 0x = 0y = -11[State 6000, StateTypeSet]type = StateTypeSettrigger1 = time = 5physics = A[State 6000, VelSet]type = VelSettrigger1 = time = 5x = 0y = 0[/mcode]ok this is the hop on state, basically when near the helper pressing Z makes him jump up like a hop then land again.what my problem is, and apologies if you already mentioned, what is the trigger for the varset in state 6000(hopping state)and does this state need a changestate.
the trigger is how you want ti to be, you can use animtime= 0, liketype = varserttrigger1 = animtime=0var(1) = 1about the changestate it depends on who do you want him to move while on the hover, so explain that next.
ok, also when jumping up, when he reaches a certain height(on the way down......... 4.84 y vel exactly i want him to change to the "on board animation"....then for the board to dissapear. while in that animation.basically he will move back and forwards while on the board.......also be allowed to jump and air jump........thats about it.....crouching might be allowed on the board too ill have to ask the creator that bit(crouch).also forgot to mention.......when he is hit by the opponent he will fall off the board also.reason for the Vel Y value is because the helper is hovering above the ground.
EDIT: got him on and off the board.now all i need help with is the movement. how to make him move back and foth from his position(pos Y = -20)EDIT2:another problem. Z makes him jump on the board.........using normal jump while in the air above the board if you press Z itll land in mid air
fr problem 2 add stateype!= A in the cmd triggers.about the movement, you will have to explain exactly how you want him to move, in the meanwhile, just play around with satte0 and state 20 in common1.cns (put a copy of that file in your character's folder).
ok im having problems overriding the walking state.[mcode][Statedef 20]type = Sphysics = Ssprpriority = 0[State 20, 1]type = VelSettrigger1 = command = "holdfwd"x = const(velocity.walk.fwd.x)[State 20, 2]type = VelSettrigger1 = command = "holdback"x = const(velocity.walk.back.x)[State 20, 3]type = ChangeAnimtriggerall = var(1)=0triggerall = vel x > 0trigger1 = Anim != 20 && Anim != 5trigger2 = Anim = 5 && AnimTime = 0value = 20[State 20, 4]type = ChangeAnimtriggerall = var(1)=0triggerall = vel x < 0trigger1 = Anim != 21 && Anim != 5trigger2 = Anim = 5 && AnimTime = 0value = 21[State 20, 3]type = ChangeAnimtriggerall = var(1)=1 && anim = 900triggerall = vel x > 0trigger1 = Anim != 950 && Anim != 5trigger2 = Anim = 5 && AnimTime = 0value = 950[State 20, 4]type = ChangeAnimtriggerall = var(1)=1triggerall = vel x < 0trigger1 = Anim != 951 && Anim != 5trigger2 = Anim = 5 && AnimTime = 0value = 951[/mcode]var(1) is set to 1 when on the board. so i thought when var(1) = 1 he can use anims 950 for move forward on the board and 951 for move back. and i set var(1) to 0 in state 0, so he can use 20 and 21.well when on the board he still uses anim 20 and 21 for move forward and back.EDIT: nmv figured it out. the varset was in the wrong place. setting var(1) to equal 0 needed to be put into the jumping off board state.
ok now when i dismount from the board, the helper appears back where it started.how do i change it so that it appears wherever i dismount?at the start of each round it appears herepos = -59,0postype = p1when i dismount it appears there again.
state -1 of the dismount or 6002(dismount state) i didnt quite understand what you mean by make the helper use the same id in the dismount state.i have given the helper the id of 10000......so what do i exactly code in the dismount state?, be it -1 or 6002.p.s what trigger do i give when i want him to turn when passing p2?(i knew it but forgot lol)
ok the turn works good thanks.(although you missed out the X in the trigger )what am i exactly coding in state 6002am i coding the helper again?.....i didnt really understand what you meant
yup thats the hop down state but the problem isin the helper state the changestate is:[mcode][State 10000, ChangeState]type = ChangeStatetrigger1 = root,pos y = -20value = 19000ctrl = 0[/mcode]and in statedef 19000 which is the invisible animation state for the helper i have...[mcode][State 10000, ChangeState]type = ChangeStatetrigger1 = root,pos y = 0value = 10000ctrl = 0[/mcode]so when im dismounted the invisible helper state goes back to 10000 in which the board appears to its original state.and also in the dismount state (6002) adding the same helper, wont appear because of the trigger numhelper(10000) = 0.....the helper already exisits all the way through doesnt it?
no i was just putting it in a invisible state.but then again killing it wouldnt be a bad idea right?EDIT: ok instead of the changestate i just deleted the invisible state, changed the helper changestate to a destroyself then in the dismount added the helper works perfect
ok debuged it and got an error.warning player dan emp(33) in state 6001 has no helper 10000. (6001 = on board state) only happens when i press Zthink i know why, seeing as the helpers are using the same ID and stateno........... i asked the first helper to be destroyed, when the roots position Y is lvl on the ground.so that destroys the helper i need to appear on the dismount frame.so mayb i need to give the helper the same id but a different stateno right?EDIT: ok that didnt make much difference. done the same, although the move works why the debug errorEDIT": Fixed it.......kept the invisible state just used a destroy self so it doesnt go back to the original helper state, then kept the other helper in the dismount state........works great with no debug error erm............yay? lol