I am currently programming a Piccolo for UB22. I learned the basics and he has a nice set of moves with what i would say is low moderate - moderate programming. I believe that if i can learn how to take advantage of vairiables i can make my character more fluid, solid and balanced. Can anlyone help me understand variables and more advanced CNS programiing? and what advantages there are to using variables?Thanks FoQ
Thx. That on helped me to understand how variable are manipulated, however I still dont get how to set them up proporly in terms setting them state -2 vs -3 or in a normal state of the character.
That depends on what do you want to do.Exactly what use are you going to give to your character variables?
Variables won't really make anything more fluid. Precise triggering and lots of time spent checking and changing values will. Using variables doesn't actually make you a good coder. Novel use of everything available will though.If you can get your head around all the different ways of using variables you can have some fun with them but they won't instantly improve your character.Practice makes perfect.
while not directly related to programming, but directly related to improving, there are two things you should study.first, fighting game theory,design and mechanics.. this might be the funniest thing, as it is done by watching fighting game videos and playing fighting games, and if you are into mugen and creating stuff, you should already like fighting games.. a video like that http://youtube.com/watch?v=7KQJonJ6XoQ , is very useful to grasp concepts, as well as combo and tournament videos.second, study physics and math, just a bit, even the most basic concepts on both subjects will help you improve tremendously.
I am mainly interested in using the variable for charging attacks. E.G i created a ChangeAnim triggered by a "hold_y" command. I was attempting to create a variale that would increase damage as the "hold_y" is held down. When released, the variable value would be added to the damage of a hitdef. Also i would lke to use variable in my juggles and to create a transformation state that would persist after it is initiated. it would add damage, defense, speed, life and power to the char
If it's a move where the character goes in a state when you press y, holds, and doesn't leave it until you release y, then you don't need a variable, just count the time he stays in it. If you stay in the same statedef when releasing you can use time, but if you go to a different state for the actual attack when releasing, you have to store the time in a variable just before changing state.If it's a move sorta like Raiden's dropkick or Bison's chargeable punch, then it's a variable. Start counting when you enter the first state, then in statedef -2, keep adding 1 to the variable as long as it's != 0, when you release (if you have control) go to the attack state and transfer the variable then put it back to 0, but if you release it without having control, you won't change state, and don't forget to still reset the var to 0.
I woul like to hold_y on animelem = 3 for a maximum of 3 seconds. When 3 seconds are up , or if the button is release, the move would goto the next animelem which has a HitDef with damage modified by the holding duration from 0 - 3 seconds.1) How do you track time while holding "Y"2) How do you turn off the "timecounter" in the same state?3) How do i add the damage to the hitdef E.G. (damage = [1,60(based off of duration)]+40also are you saying [State Blah]type = Varsettrigger1 = animelem = 3value = 1v = 0[Statedef -2]type = varaddTrigger1 = time = 0value = 1v = 0will add 1 to var(0)?
Well, there can be various ways. The most straight forward would be the variable, yes (there are workarounds to avoid using a variable, but it would only be to have fun making it complicated for no real reason ).So, the variable.[state blah]type = varsettrigger1 = animelem = 3, = 0var([number of your variable]) = 0[state blah]type = varaddtrigger1 = animelem = 3, > 0 && animelem = 4, < 0trigger1 = command = "hold_y"v = [same number]value = 1[state blah]type = changeanimtrigger1 = animelem = 3, > 2 && animelem = 4, < 0trigger1 = command != "hold_y"trigger2 = var([same number]) >= 180 && animelem = 4, < 0value = animelem = 4Then, in the hitdef,damage = 40 + var([still same number])Charging to the max would give 220 damage with that formula. Manipulate var([number]) (like, var([number])/2 or whatever) as you want to adjust the damages.If you didn't hold y at all, anim elem 3 will display for only 2 ticks and the total damage will be 40 ; hold y for one second and anim elem 3 will display for 60 ticks (1 second) with damages be of 40+60=100...
The trigger "animelem = 3, > 0" is "true" at any time in the animation past one tick after the third element. It's actually the exact same as writing "animelemtime(3) > 0", just that I'm more used to the former for some reason. Don't mind that. Ditto with "animelem = 4, < 0" it's "true" at any point before the 4th element, meaning it's the same as animelemtime(4) < 0.So, the whole trigger is "true" at any time during anim elem 3, starting from one tick after the beginning up to the end of elem 3.
If either of those elude you, remember time is always an option.Time > 10 for eg would work just as well as animelemtime(3) >= 0
OK...another problem is that i Have a "power charge" state which of course adds power while holding "a+x". aand all that worls fine hower, i have several explods that are drawn when the power meter reaches a cirtain value e.g 2000, 4000. My first explood draws fines however when i try to get my second and third explods to draw using trigger1 = power >= 2000 for example the sprites are distorted (by the way the way i am using "A" on my transparencies). I can set the triggers to time = 0 && power >=2000 but then i have to end the state and press the command again to see the new explods . How can i trigger my additinal explods without them drawing distorted.PS i think my imagination is past my progoming...lol
You're changing explod as you travel up the power settings. You need to remove the old one when you hit a new setting.Creation triggers are power > 1000, power = [1000,1999] and power = [2000,3000]Give each explod an unique ID and remove it when power > 1000/2000All same state.
R[E]ika said, November 02, 2007, 08:29:42 pmpost your code...[Statedef 1000]Type =Sphysics = Sanim = 1000ctrl = 0velset = 0,0[State 1000, PowerAdd]type = PowerAddtrigger1 = ((GameTime%3) = 0) && (command = "hold_x") && (command = "hold_a")value = 25[State 1000, Explod]type = Explod;trigger1 = animelem = 4trigger1 = power > 2000;trigger1 = (command = "hold_x") && (command = "hold_a");trigger1 = command = "hold"trigger1 = time = 0anim = 1100ID = 1100pos = 0,0postype = p1 ;p2,front,back,left,rightfacing = 1vfacing = 1bindtime = 1vel = 0,0accel = 0,0random = 0,0removetime = -1;supermove;ausemovescale = 1,1sprpriority = 3ontop = 1shadow = 0,0,0ownpal = 1removeongethit = 0trans = add[State 1001, RemoveExplod]type = RemoveExplodtrigger1 = (command != "hold_x") || (command != "hold_a")id = 1100[State 1000, Explod]type = Explodtrigger1 = animelem = 4trigger1 = power <= 2000anim = 6030;ID = 6030;pos = 0,0;-110,-190postype = p1 ;p2,front,back,left,rightfacing = 1vfacing = 1bindtime = 1vel = 0,0accel = 0,0random = 0,0removetime = -1supermovepausemovescale = 1,1sprpriority = 2ontop = 0shadow = 0,0,0ownpal = 0removeongethit = 0;ignorehitpause =;persistent =[State 1000, RemoveExplod]type = RemoveExplodtrigger1 = time = 0trigger1 = power > 2000id = 6030;Var(9);ignorehitpause =;persistent =[State 1000, Explod2]type = Explodtrigger1 = AnimElem = 4trigger1 = power >= 4000anim = 6192ID = 6192pos = -60,60postype = p1 ;p2,front,back,left,rightfacing = 1vfacing = 1bindtime = 1vel = 0,0accel = 0,0random = 0,0removetime = -1;supermove;ausemovescale = 1,1sprpriority = 2ontop = 0shadow = 0,0,0ownpal = 1removeongethit = 0trans = add[State 1000, Explod]type = Explodtrigger1 = animelem = 4anim = 6031ID = 6031pos = 0,3postype = p1 ;p2,front,back,left,rightfacing = 1vfacing = 1bindtime = 1vel = 0,0accel = 0,0random = 0,0removetime = -1scale = 1,1sprpriority = 0ontop = 0shadow = 0,0,0ownpal = 0removeongethit = 0;ignorehitpause =;persistent =[State 1000, EnvShake]type = EnvShaketrigger1 = time > 44trigger1 = TimeMod = 4,0time = 4freq = 60ampl = -4;phase = 90;ignorehitpause =persistent = 1[State 1000, PlaySnd]type = PlaySndtrigger1 = Time = 0channel = 1value = 1100, 0[State 1000, PlaySnd]type = PlaySndtrigger1 = Time = 0channel = 1value = 1100, 2loop = 1[State 1000, PlaySnd]type = PlaySndtrigger1 = time = 44channel = 2value = 1100, 1loop = 80[State 1000, End]type = ChangeStatetrigger1 = (command != "hold_x") || (command != "hold_a")trigger2 = power = 2000trigger3 = power = 4000value = 1001[State 1000, End]type = null;ChangeStatetrigger1 = (command != "hold_x") || (command != "hold_a")trigger2 = power = 4000value = 1001
You have 2 removeexplods. 1 will only trigger if you release X or Y, the other one only triggers when you enter the state.You need 1 removeexplod, per explod, with the conditions it should be removed under.For example the level 1 version should always be removed when power > 1000 OR when you release the keys.