Using a variable to become unhittable permanantly triggered on/off by a command........ it will have its fair use.......
#1
Inviato 04 October 2007 - 13:43
example:
P1 p2
UNHITTABLE STATE | HITTABLE STATE = P2 CANNOT HIT P1 AND P1 CANNOT HIT P2
UNHITTABLE STATE | UNHITTABLE STATE = BOTH CAN NOW HIT EACH OTHER
HITTABLE STATE | HITTABLE STATE = BOTH CAN NOW HIT EACH OTHER
Can someone write me a code that can do this?
#2
Inviato 04 October 2007 - 18:16
for proper functioning this all needs to be in the common file, in a -2 o -3 state
ok, the trype is NotHitBy
the trigger is obviously a variable.
thisvar will have 3 states;
0 (for normal) 1(for hit) 2 for (NO hit)
now all that's left is to trigget that variable in another controller (state -1) of type VarSet
and assign a trigger comand = "commandname"
and the value that such move put's it into
then you will need another trigger that will change it back to 2.
IF you are plannign to use this only in one player, everything is a little more complicated;
first of all you need anotehr variable
then you'll need in the statedef -2 a controller of typeVarSet with a trigger that matches either a STATENO or a STATETYPE or a vaild COMMAND of the enemy, and BEFORE that trigger the Enemy, redirection.
now is the problem...
then the variable will be applied, now the controller NotHitBy, specifing nothign that can hit you will once again make p2 not hit you, but you can still hit p2...
this is because to modify p2's property you need to go into p2's files.
the best solution to this is set p1 to go to a different state else then the attack when p2's var is set to no hit
this will make p1 attaack and miss because you can sue the same states but remove the hitdef property and no hit's will obviously hit p2 that can not hit you (thanks to not hit by parameter.)
this is probably the easyest solution ;)
#3
Inviato 04 October 2007 - 19:12
;fvar(18): 0 (for normal) 1(for hit) 2 for (no hit)
;IN CMD FILE
[Command]
name = "DodgeBG/FG"
command = D, a+x
time = 2
;-----------------
;IN CMD FILE -1 STATES
[State -1, Dodge2BG]
type = VarSet
trigger1 = command = "DodgeBG/FG"
fv = 18
value = 2
;---------
[State -1, Dodgeback2Foreground]
type = VarSet
trigger1 = command = "DodgeBG/FG"
fv = 18
value = 1
;=======================================
;-2 STATES
[State -2, VarSet];normal var
type = Varadd
trigger1 = 1
fv = 18
value = 0
[State -2, VarSet];hit var
type = Varadd
trigger1 = fvar(18) != 2
fv = 18
value = 1
[State -2, VarSet];no hit var
type = Varadd
trigger1 = fvar(18) != 1
fv = 18
value = 2
[state -2, nothitby]
type = NotHitBy
triggerall = fvar(18) = 2
trigger1 = enemy, fvar(18) != 2
trigger1 = enemy, fvar(18) <= 1
value = SCA
[state -2, palfx];darkened color for "stepping into the background"
type = PalFx
trigger1 = fvar(18) = 2
time = -1
add = 0, 0, 0
mul = 150, 150, 150
sinadd = 0,0,0,0
invertall = 0
color = 256
persistent = 1
ignorehitpause = 1
Am i on the right track? And should I add a state number to the char's positive states as well?
#4
Inviato 05 October 2007 - 22:11
float is a decimal and uses more memory, v is insted an integer, and the only possibility is therefore an integer number, which is why is better to use in this case, there isn't a situation in which it might be inbetween the states that we need, so use integer variables insted.
then VarADD adds one to the variable, so what you really want is VarSet to reset the variable.
the shortcut for calling a varible is var(18)=VALUE
at the end of the state. IF it does not set the var, then you ight want to use V= and Value =, but otherwise is better to save some space...
ok then...
;-2 STATES
[State -2, VarSet];normal var
type = Varadd
trigger1 = 1
fv = 18
value = 0
ok now this state in -2 changes the var back ANYTIME, so your following code will never work...
you have to add an "exception" to the rule,just eliminate it, you don't need this passage at all.
[State -2, VarSet];hit var
type = Varadd
trigger1 = fvar(18) != 2
fv = 18
value = 1
same thiong here, is useless rightnow
[State -2, VarSet];no hit var
type = Varadd
trigger1 = fvar(18) != 1
fv = 18
value = 2
and here too, is useless...
;-----------------
;IN CMD FILE -1 STATES
[State -1, Dodge2BG]
type = VarSet
trigger1 = command = "DodgeBG/FG"
fv = 18
value = 2
;---------
[State -1, Dodgeback2Foreground]
type = VarSet
trigger1 = command = "DodgeBG/FG"
fv = 18
value = 1
those don't really work either, why don't you throw the character into a state in which you change the var?
[state bla, varset]
type = varset
trigger1 = var(18) = 0
trigger1 = var(18) != 1
trigger1 = var(18) != 2
v = 18
value = 1
[state bla,varUnset]
type = varset
trigger1 = var(18) != 0
trigger1 = var(18) = 1
trigger1 = var(18) != 2
v = 18
value = 2
and then changestate back to 0
now in -2 make the thing with the nothitby
ckeck the triggers i don't think they''ll work...
you are on the right path though...
test it with KFM, jus tmodify the code and see what happens.
#5
Inviato 05 October 2007 - 22:42
#6
Inviato 08 October 2007 - 07:08
then we alter it.
putting it back to 0 is possible, but more complicated than just changing it to 2 forever for the rest of the game.
in praticality 1 is DON't get hit, and 2 is Get hit, while 0 is Don't,Get hit, enemy will not hit either.
so basically, in the event that an enemy character does not have the same type of state or does not wish to ever use it, the enemy will not be able to attack him eitherways. (because we are using var(18)=2 to code that part...) as long as his var(18) = 1 and not 2.
if var 18 = 2 then he will be able to hit the char just like if the var was 0, but it enables you to see if the enemy has ever been in the state so maybe you can alternate another ending or something for it?
#7
Inviato 08 October 2007 - 19:21
the code is 95 percent complete and ive also devised something new in the process. First i have discovered a way to scale char sprites without the char being a helper! When the char goes into the background, it will be smaller showing perception and depth. Also P1 kfm and P2 kfm are 2 different chars but the same exact char(one with the coding and one without the coding). p1 kfm's x and y char scale is 1.3,1.1 while kfm p2 is THE SAME MESUREMENTS!!!
The only difference is that kfm p1 has the smooth char sprite coding that i found out. compare how kfm1 and kfm2 look. with that char scale kfm2's sprites look shitty compared to kfm1's same measurements but with the smooth char sprite coding!!! Now you can play mugen on low res without any chars sprites looking shitty!:D I also added atmospheric shadowing to teh char in this same code showing realism of light values. (untested on highres)&&(untested on highres sprites).
Now with all that said, view the video for reference:
I dont know the bb code for displaying videos on this site so here is the link to the video:
http://www.youtube.c...h?v=PU6ro_6JDC8
At the end youll see the last 5 percent that is not complete. problem is that i ran into the problem u were talking about earlier which was "the chars cant hit each other!" By viewing the following coding can you give me further clarification and information on how to fix this?:
;cmd file [Command] name = "DodgeBG" command = /$a+x,B time = 20 [Command] name = "DodgeFG" command = /$a+x,F time = 20 ;means hold a and x then push back to go into the background but only in the foreground & ;means hold a and x then push forward to go back into the foreground while only in the ;background ;cmd file -1 states [State -1, switch2bg] type = ChangeState value = 8889 trigger1 = var(39) = 0 trigger1 = command = "DodgeBG" trigger1 = statetype != A trigger1 = statetype = S trigger1 = movetype != H trigger1 = ctrl [State -1, switch2fg] type = ChangeState value = 8890 trigger1 = var(39) = 1 trigger1 = command = "DodgeFG" trigger1 = statetype != A trigger1 = statetype = S trigger1 = movetype != H trigger1 = ctrl
;positive states ;GuiltyGearIsuka FG/BG Changer --- ;var(39) =0, foreground - 1, background ;var(40) =0, can get hit - 1, cant get hit [Statedef 8889];background Type = S movetype= A physics = S velset = 0,0 anim = 195 ;Animation for transformation ctrl = 0 ;This sets the variable for the effect. Sets Var(39) to a value of 1. [State 8889, Change2BG] Type = VarSet triggerall = command = "DodgeBG" trigger1 = var(40) = 0 trigger1 = enemy, var(39) >= 0 trigger2 = var(40) = 1 trigger2 = enemy, var(39) >= 0 var(39) = 1 [state 8889] type = changestate trigger1 = animtime = 0 value = 0 ctrl = 1 [Statedef 8890];foreground Type = S movetype= A physics = S velset = 0,0 anim = 195 ;Animation for transformation ctrl = 0 ;This sets the variable for the effect. Sets Var(39) to a value of 0. [State 8890, Change2FG] Type = VarSet triggerall = command = "DodgeFG" trigger1 = var(40) = 0 trigger1 = enemy, var(39) >= 0 trigger2 = var(40) = 1 trigger2 = enemy, var(39) >= 0 var(39) = 0 [state 8890] type = changestate trigger1 = animtime = 0 value = 0 ctrl = 1
;negative 2 states ;============================================= ;BG/FG change attributes [state -2] type = sprpriority trigger1 = var(39) = 1 trigger1 = var(39) !=0 value = -2 [state -2] type = sprpriority trigger1 = var(39) != 1 trigger1 = var(39) =0 value = 0 ;---------------------------------------- ;perspective - ;*Do not use this formula if the whole number(a or B) is zero ;or char will become inviso: floor(a * const(size.xscale)), floor(b * const(size.yscale)) ;If one (a or B) is zero and one (a or B) is not, then you can use it for that one that is not whole number 0 ;but not the other that is whole number 0. ;That formula erradicates the pixel-ness and blocky-ness of the low res char sprites!!!!!!!!!!!!!!!!!! [state -2];foreground/default perspective type = angledraw trigger1 = 1 value = 0 scale = floor(1.3 * const(size.xscale)),floor(1.1 * const(size.yscale));input original x,y main char scale sizes ;*char scale for starting round before fg and bg are activated [state -2];foreground perspective type = angledraw trigger1 = var(39) = 0 trigger1 = var(39) !=1 value = 0 scale = floor(1.3 * const(size.xscale)),floor(1.1 * const(size.yscale));input original x,y main char scale sizes [state -2];background perspective type = angledraw trigger1 = var(39) = 1 trigger1 = var(39) !=0 value = 0 scale = floor(1.17 * const(size.xscale)),0.95; subtract 0.13 from the main x,y char scale sizes ;*subtract an extra 0.02 from the x or y char scale that the whole number is 0 and is not qualified for the scale formula [state -2, possetbg] type = offset triggerall = RoundState = [0,4] trigger1 = var(39) = 1 trigger1 = var(39) !=0 y = -12 ;------------------------------------------------------ [state -2, playerpush] type = playerpush trigger1 = var(39) != 0 trigger1 = var(39) = 1 trigger1 = enemy, var(39) != 1 trigger1 = enemy, var(39) = 0 time = -1 value = 0 ------------------------------------------------------ [state -2, hitby];can get hit type = HitBy triggerall = var(40) = 0 trigger1 = var(39) >= 0 trigger2 = enemy, var(39) >= 0 time = -1 value = SCA [State -2, hit level var] Type = VarSet trigger1 = var(39) = 0 trigger1 = enemy, var(39) = 0 trigger2 = var(39) != 1 trigger2 = enemy, var(39) != 1 trigger3 = var(39) = 1 trigger3 = enemy, var(39) = 1 trigger4 = var(39) != 0 trigger4 = enemy, var(39) != 0 var(40) = 0 [state -2, nothitby];cant get hit type = NotHitBy triggerall = var(40) = 1 trigger1 = var(39) >= 0 trigger2 = enemy, var(39) >= 0 time = -1 value = SCA [State -2, no hit level var] Type = VarSet trigger1 = var(39) != 0 trigger1 = enemy, var(39) = 0 trigger2 = var(39) = 1 trigger2 = enemy, var(39) != 1 trigger3 = var(39) != 1 trigger3 = enemy, var(39) = 1 trigger4 = var(39) = 0 trigger4 = enemy, var(39) != 0 var(40) = 1 ;------------------------------------------------------------------- [state -2, palfx];darkened color for "stepping into the background" type = PalFx triggerall = time = 1 trigger1 = var(39) = 1 trigger1 = var(39) != 0 time = -1 add = 0, 0, 0 mul = 150, 150, 150 sinadd = 10,10,10,255 invertall = 0 color = 256 persistent = 1 ignorehitpause = 1 [state -2, palfx];lightened color for "stepping into the foreground" type = PalFx triggerall = time = 1 trigger1 = var(39) = 0 trigger1 = var(39) != 1 time = -1 add = 0, 0, 0 mul = 256, 256, 256 sinadd = 10,10,10,255 invertall = 0 color = 256 persistent = 1 ignorehitpause = 1 ;==========================================
I wrote it out the long way so that onlookers can try and read the code easier. writing things out the long way helped me learn to code. Now with all that said, i am so close to this breakthrough! I finally need your final thought to end the madness and frustration of the hours of thinking on how to make the chars hit. Explicate to me a little further what i must do next to make the chars hit each other.
Messaggio modificato da shinra358 il 09 October 2007 - 14:40
#8
Inviato 09 October 2007 - 23:34
don't u feel great about it?
it's usually like that every time... ergo the reason why i don't like people who choose the easy way out.
now for your solution...
ok let's see allright...
you use var 39 and 40 and you trigger in -1 their behavour, sayung basically, that if the vars ar not 0 and positive you can NOT hit eachother (or just one)
so tecnicalli speacking i can reson this:
1) if the code is only in one char, then he will always be able to NOT hit you (if u eliminate the code he will hit you.)
2) the chars go always in a NO HIT state because the trigger shold be the negavie number as stated by u... here...
;var(39) =0, foreground - 1, background
;var(40) =0, can get hit - 1, cant get hit
here is yr triggers
triggerall = var(40) = 0
trigger1 = var(39) >= 0
trigger2 = enemy, var(39) >= 0
so anytime during this -2, the value of var40 is always supposed to be 0 for u to not get hit AND to trigger the controlelr at all (hence triggerall) , so
trigger1 says that var 39 is grateer then 0, ergo not -1, ergo u r in the FOREGROUND.
good so far, you can not get hit. so far so good...
trigger2 tells that the variable number 39 of the enemy also needs to be different then -1, ergo he as well needs to be in the state of the FOREGROUND.
this is incorrect i think.
what u want to do is; if u r in the foreground and he is in the foregroun u DON"T want to get hit.
so if the 2 vars are the same u r ok to hit each other and NOT ok if the vars are different.
ergo
trigger1 = var(39) != enemy, var(39)
so if the var differ then they should not hit.
try it out see how it goes.
if u can not figure out how to do it yet, then i'd like to open your eyes to a whole nother mugen programming world. BUT if u can do it now there is really no need to jump the gun ;) (the natural brain process should let you figure it out in about 200 hours of coding :P)
#9
Inviato 10 October 2007 - 06:13
video: http://www.youtube.c...h?v=EujdXHWHS6w
here it is:
;cmd file
[Command]
name = "DodgeBG"
command = /$a,/$x,B
time = 20
[Command]
name = "DodgeFG"
command = /$a,/$x,F
time = 20
;means hold a and x then push back to go into the background but only in the foreground &
;means hold a and x then push forward to go back into the foreground while only in the ;background
;cmd file -1 states
[State -1, switch2bg]
type = ChangeState
value = 8889
trigger1 = var(39) = 0
trigger1 = command = "DodgeBG"
trigger1 = statetype != A
trigger1 = statetype = S
trigger1 = movetype != H
trigger1 = ctrl
[State -1, switch2fg]
type = ChangeState
value = 8890
trigger1 = var(39) = 1
trigger1 = command = "DodgeFG"
trigger1 = statetype != A
trigger1 = statetype = S
trigger1 = movetype != H
trigger1 = ctrl
;positive states
;GuiltyGearIsuka FG/BG Changer ---
;var(39) =0, foreground - 1, background
;This sets the variable for the effect. Sets Var(39) to a value of 1.
[State 8889, Change2BG]
Type = VarSet
trigger1 = command = "DodgeBG"
trigger1 = var(40) = 0
var(39) = 1
[state 8889]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
[Statedef 8890];foreground
Type = S
movetype= A
physics = S
velset = 0,0
anim = 195 ;Animation for transformation
ctrl = 0
;This sets the variable for the effect. Sets Var(39) to a value of 0.
[State 8890, Change2FG]
Type = VarSet
trigger1 = command = "DodgeFG"
trigger1 = var(40) = 0
var(39) = 0
[state 8890]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;statedef -2
;========================================================
;BG/FG change attributes
;========================================================
;to give your char proper projectile priority while using this code,
;you must go to the projectile (fireball, etc) statedef and
;u must duplicate the projectile sctrl state of that statedef and
;add the foreground var(var(39)=0) triggerall to one and the background var (var(39) = 1) ;triggerall to the other.
;the one with the background var should have projsprpriority = -3 while the one with the
;foreground var should have projsprpriority = 1
;sprite priority -1 is reserved for hyper backgrounds for the foreground chars
;sprite priority -2 is reserved for if people want to put props in their stages for this code for
;to be in between the forground and the background for more depth. ;)
;========================================================
[state -2];char sprite lesser priority for background
type = sprpriority
triggerall = var(39) = 1
triggerall = var(39) !=0
trigger1 = 1
value = -4
[state -2];char sprite normal priority for foreground
type = sprpriority
triggerall = var(39) != 1
triggerall = var(39) =0
trigger1 = 1
value = 0
[state -2,];nothitby var
type = varadd
trigger1 = 1
var(40) = 0
[state -2]
type = nothitby
triggerall = var(40) = 0
trigger1 = var(39) >= 0
trigger1 = var(39) != enemy, var(39)
value = SCA
;perspective -
;*Do not use this formula if the whole number(a or B) is zero
;or char will become inviso: floor(a * const(size.xscale)), floor(b * const(size.yscale))
;If one (a or B) is zero and one (a or B) is not, then you can use it for that one that is not whole number 0
;but not the other that is whole number 0.
;That formula erradicates the pixel-ness and blocky-ness of the low res char sprites!!!!!!!!!!!!!!!!!!
[state -2];foreground perspective
type = angledraw
triggerall = RoundState = [0,4]
triggerall = var(39) = 0
triggerall = var(39) !=1
trigger1 = 1
value = 0
scale = floor(1.3 * const(size.xscale)),floor(1.1 * const(size.yscale));input original x,y main char scale sizes
[state -2];background perspective
type = angledraw
triggerall = var(39) = 1
triggerall = var(39) !=0
trigger1 = 1
value = 0
scale = floor(1.16 * const(size.xscale)),0.94; subtract 0.14 from the main x,y char scale sizes
;*subtract an extra 0.03 from the x or y char scale that the whole number is 0 and is not qualified for the scale formula
[state -2, possetbg]
type = offset
triggerall = RoundState = [0,4]
triggerall = var(39) = 1
triggerall = var(39) !=0
trigger1 = 1
y = -12
[state -2, playerpush]
type = playerpush
triggerall = var(39) != 0
triggerall = var(39) = 1
triggerall = enemy, var(39) != 1
triggerall = enemy, var(39) = 0
trigger1 = 1
time = -1
value = 0
[state -2, palfx];darkened color for "stepping into the background"
type = PalFx
triggerall = var(40) = 0
triggerall = time = 1
triggerall = var(39) = 1
triggerall = var(39) != 0
trigger1 = 1
time = -1
add = 0, 0, 0
mul = 150, 150, 150
sinadd = 10,10,10,255
invertall = 0
color = 256
persistent = 1
ignorehitpause = 1
[state -2, palfx];lightened color for "stepping into the foreground"
type = PalFx
triggerall = time = 1
triggerall = var(40) = 0
triggerall = var(39) = 0
triggerall = var(39) != 1
trigger1 = 1
time = -1
add = 0, 0, 0
mul = 256, 256, 256
sinadd = 10,10,10,255
invertall = 0
color = 256
persistent = 1
ignorehitpause = 1
;[state -2, palfx];darkened color for background projectiles
;type = PalFx
;triggerall = var(40) = 0
;triggerall = time = 1
;triggerall = var(39) = 1
;triggerall = var(39) != 0
;trigger1 = 1;;replace # with stateno = (projectile state #) for correct projectile coloring
;time = -1
;add = 0, 0, 0
;mul = 150, 150, 150
;sinadd = 10,10,10,255
;invertall = 0
;color = 256
;persistent = 1
;ignorehitpause = 1
;[state -2, palfx];lightened color for foreground projectiles
;type = PalFx
;triggerall = time = 1
;triggerall = var(40) = 0
;triggerall = var(39) = 0
;triggerall = var(39) != 1
;trigger1 = 1;replace # with stateno = (projectile state #) for correct projectile coloring
;time = -1
;add = 0, 0, 0
;mul = 256, 256, 256
;sinadd = 10,10,10,255
;invertall = 0
;color = 256
;persistent = 1
;ignorehitpause = 1
;=========================================================
MISSION COMPLETE thanx to your guidance. 100% bug free
hopefully 3 on 3 simul mugen wont be out for a while but when it does ill have to make a background, middleground, and foreground code lol.
#10
Inviato 12 October 2007 - 08:05
i thinks it's not possible to make mugen u 3 chars... i mean it is "possible" but only with the sourcecode, not by hacking it...
i mean, it COULD be hackable if someone wanted to tecnically change half of mugen in a hack,... but how likely is that? i mean i hope that instead of wasting time hacking it they's simply friggin help code the source for something like it...
afterall is not that big a step from one anotehr since to hackit they have to read the binary our and disassamble it...
anyways i think we'll never see either things happen...
heY!!!... look in your pm box!
#11
Inviato 12 October 2007 - 15:08
#13
Inviato 13 October 2007 - 04:09

Aiuto









