News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

Problems with target

Started by Odb718, February 27, 2018, 10:35:37 AM

Previous topic - Next topic

Odb718

I'm not exactly sure what the differences are, but I use a targetlifeadd and a targetbind and a targetvelset.
In the targetlifeadd I have two triggerall
triggerall = var(18) = 1
triggerall = anim = 3002
With or without the triggeralls the targetlifeadd works normal. If I add the two triggeralls to targetbind it no longer works.
The targetlifeadd has multiple triggers and goes off 5 times while the targetbind keeps P2 locked in place.

Why/How can the triggeralls work with targetlifeadd but not targetbind????
vVv Gouken718 vVv SabreTooth718 vVv


altoiddealer

I know you're an experienced coder so it hurts to ask simple questions heh

There are only so many logical explanations before we're stepping into "it's a bug"

-Does your TargetBind have at least one trigger1?
-What is the result you are expecting from TargetBind, what is actually happening?


XGargoyle

are there any persistent=x in an of these scrtls?


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!

Odb718

#3
So this is the crappy-crap-crapness Ive been trying to sort.

Spoiler (click to show)
[State 0, VarSet]
type = VarSet
triggerall = var(18) = 0
trigger1 = movehit = 1
v = 18
value = 1
ignorehitpause = 1

[State 2210, Hurt1]
type = TargetLifeAdd
;triggerall = var(18) = 1
;triggerall = anim = 3002
trigger1 = time =35 
trigger2 = time = 85
trigger3 = time = 130
trigger4 = time = 165 
value = -30
kill = 0 

[State 2210, Hurt2]
type = TargetLifeAdd
triggerall = var(18) = 1
triggerall = anim = 3002
trigger1 = time =205   
value = -50
kill = 0 


[State 0, TargetBind]
type = TargetBind
;triggerall = var(18) = 1
triggerall = anim = 3002
trigger1 = time >=34 
trigger1 = time <=170
time = 135
id = -1
pos =floor(rootdist x)+75,220
ignorehitpause = 1
;persistent =
[State 0, TargetVelSet]
type = TargetVelSet
trigger1 = time >=171
x = -2
y = -13
ID = -1
ignorehitpause = 1 

Hurt1 and Hurt2 react exactly the same. If I add the triggeralls to TargetBind it breaks it completely. Same thing with TargetVelSet.
I've tried to have the attack switch states but the target always seems to drop when I do it that way. I'm not sure what I'm missing. It's probably something completely obvious but because I haven't messed with it in 2 years I dont know what it is.

What happens now is P2 is hit, casts a shadow where he stands, and is placed under the stage. I've set up a displayto and it shows P2 is locked into position where I expect it. But the timing is WAY off some how. Like time >= 171 actually converts to something like time = 251. I'm not sure what the heck is going on. But it's my ultra where the black hole comes down, hit's P2, damage 5x, rumbles, and spits them out.

So here's the craziest part. The lifeadd works at the normal time. The bind and the vel at a different time. The lifeadd happens way before the spit out. I've no clue how I can be controlling the character in 2 different realities of mugen.


----
On top of all this, I need to adjust P2's sprite priority and I'm not sure how. When ever I do stuff in P2's custom state, the target drops. Everything breaks.
vVv Gouken718 vVv SabreTooth718 vVv


XGargoyle

You are using -1 in the targetbind. Perhaps another event is creating a new target and therefore the targetbind gets confused. Try assigning a specific ID instead of just -1.

Also, there's a period of time where you have active both targetbind and targetvelset. I haven't tested it, but my assumption is that either you bind the target in a position or you give him a velset, but not both.
At time 170, the targetbind is activated and gives you a binding period of  additional 135 ticks, therefore at time 171 the targetvelset creates a conflict with the still bound character


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!

Odb718

I definitely missed the time of 135. I've set it to 1 so I can just work with the time range in a way I can see easier.
BUT
It's still messed up some how. The timing is always crazy.

So the ultra drops the teleporter.
It hit's P2, and P2 root disappears under the map, but
instantly P2 spawns a helper who's then hit instantly by P1's teleporter. The same exact one that hits initially.
The helper is switched to a custom animation to be a shadow type fade out effect.

I can't have the teleporter switch states until after P2's shadow is made. So it's like 2 tics.
Trying to do EVERYTHING in 1 state is mass confusion though.
When I try to put velsets and other things inside P2's root's custom state, my target drops or just acts crazy.

Because the ultra starts, it takes a while for the hole to fall and hit P2, and P2's custom state, All THREE states are at different timings and I've no real way of syncing them up.
tic 0 - P1 starts the ultra.
tic 10 - the hole is shot up
tic 20-60 the hole hit's P2
Based off of the hole's timing
tic 240 the ground opening explod shows up
tic 300 P2's velset launches them through the hole.

It doesn't matter if the hole hits at 20 or 60, 240 the hole shows up, 300 P2 is shot through. ON SCREEN the hole and P2 show up at the exact same time. I still have to work in some more explods to make this thing look good.

When I look at the regular special version of the black hole, I'm not even sure how it works.
Spoiler: This is how I feel right now (click to show)



The targetvelset and targetbind do work together. It's just the player can't move. Once the bind is released the velocity is already set, and moves the target.  I've added ID's to the attacks and to the target(sets). I think I should be able to not rely on var(18) now.
vVv Gouken718 vVv SabreTooth718 vVv


XGargoyle

Why are you creating a helper within the P2 custom state and then hitting such helper to get a target??

If you have placed P2 in a cuatom state, you could simply do all that fade in shadow effects with the actual P2 character. You don't need an extra helper to do the stuff


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!

Odb718

Yes and no. The move the character actually is supposed to look like it's in 2 different spots. The screen moves once P2 is hit. I'm not sure how I can have P2 in 1 spot and get the camera to center properly.
It's not a bad idea.
The original special you actually see the shadow and P2 at the same time. The ultra P2 is hidden but the camera moves. Sometimes the shadow is half out of frame. It depends on which black hole hits.
I do have a technique where I make a "runner". It's a P1 helper that just goes across the floor to center the camera. I think I use it in my Sagat's raging demon/tiger.

I think I'm just going to try and start fresh. Idk. It's slowly coming together but feels like it could all fall apart at any instant.
vVv Gouken718 vVv SabreTooth718 vVv


XGargoyle

All you said can be done directly with just P2 in a custom state and interacting with him directly, without extra helpers. If you need to display both P2 and a shadow/clone at the same time, this "copy" can be done via explods


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!

Odb718

#9
Well, I've tried with explods. A lot.
I hit P2 into a custom state and need to have P1's explod of P2's sprites. Either I get P1's sprites, or I get an error that the animation doesn't exist or P2's own animation which isn't what I want.
Maybe I was setting something up wrong originally.

This is the animation I need to play with P2's sprites instead of P1's
Spoiler (click to show)
[Begin Action 1655]
5000,0, 0,0, 2, , AS204D0
5000,0, 0,0, 2, , AS154D0
5000,0, 0,0, 2, , AS103D0
5000,0, 0,0, 2, , AS51D0
5000,0, 0,0, 2, , AS0D52
5000,0, 0,0, 2, , AS0D103
5000,0, 0,0, 2, , AS0D154
5000,0, 0,0, 2, , AS0D205
5000,0, 0,0, 2, , AS0D256
-1,0, 0,0, 2

----
I just did a simple test. Sending P2 into a custom state and spawning the explod in P2's state displays P2's animation for the explod. If P2 doesn't have the animation, nothing shows up.
vVv Gouken718 vVv SabreTooth718 vVv


XGargoyle

Ok, now I understand what you are attempting to achieve.
Yes, spawning the explod from P2 custom state will display the animation group from P2, not the custom anim from P1. Somehow I thought you wanted the oposite.

Yes, then the only way afaik is to create a second helper and put it under another custom state. If targetbind is not fully working, why don't you try using instead a continuous posset inside the custom state? This will position the character and bind it for some time.


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!

Odb718

#11
The targetbind IS working. It's just all messed up with the timing. It's like it's 40 to 50 tics off on one particular instance. As in, It's always say 47tics slow.

Spoiler: Ramblings of a mad man (click to show)
See let me just post these two hitdefs. I dont underfuckingstand how I figured out how to get this to work. It works. But when I think about it, it shouldn't. When I input the values that make sense to work, it doesn't....

Spoiler: P1 Hitdefs (click to show)

[State 1351, 1]
type = HitDef
trigger1 = movetype = A
attr = S, SA
hitflag = M
hitsound = s718,0
guardflag = AF
priority = 1, Miss
sparkno = -1
sparkxy = -15,-55
pausetime = 0, 0
guard.sparkno = s1207
guardsound = s98,0 ;s6, 0
p1sprpriority = 1
p1facing = 1
p2facing = 1
guard.velocity=0;,0
p2stateno = 3053 
fall = 1
kill=0
palfx.time = 1
hitonce = 1
Id = 3050

[State 0, Shadow Maker]
type = HitDef
trigger1 = Enemynear,anim = 1653
attr = C,HT        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = light          ;light,medium,hard,back,up,diagup
air.animtype = light
damage = 0,0
pausetime = 0 ,0
P2sprpriority = -1
p2stateno = 1654 
hitonce = 1
numhits = 0
Id = 1654

Spoiler: P2 Custom state (click to show)
; Hell Hole Victim
[Statedef 3053]
type = A
movetype = H
physics = N
velset = 0,0 
sprpriority = -5 

[State 3053, Helper]
type = Helper
trigger1 = numhelper(1654) = 0
trigger1 = time = 0
helpertype = normal ;player
name = "Deadman"
ID = 1654
stateno = 5000
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0

[State 3053, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 1653

Statedef 1654 is the shadow clone and that's it. When I follow the code it seeeeems like
P1 hit's P2
P2 is sent to statedef 3053, spawns the helper 1654 into statedef 5000, and switches animations to 1653.
P2 is then hit a second time sending it to statedef 1654. Because P2's animation is 1653 and that's what the hitdef is looking for.

What happens in game is P2 is hit, spawns the helper, the helper is hit and forced into state 1654, and P2 drops from the sky. I keep reading it and it's not supposed to work... but I can upload a video of it working... the way I want it to and programmed it to but doesn't make sense...
If I make the P2 helper have anim 1653 it breaks. But it wont work unless the helper has animation 1653. P2 Gets put into anim 1653!!!?? Nothing makes sense and yet the special works perfect. But not the Ultra?!
I mean the freaking helper is NEVER told to go into animation 1653, but it's still hit like it's animation 1653. How do I spawn statedef 5000 and have it become statedef 1654???????
No my statedef 5000 isn't overwritten.

I feel like I'm going crazy
So it finally dawned on my that the second hitdef wasn't allowed to hit anything until it was close to an enemy with animation 1653 playing. Once P2 switches to that animation it can hit P2. But I move P2 up and out of the way, so only the helper is there to get hit. This might mess up in a big way 2vs2.
vVv Gouken718 vVv SabreTooth718 vVv


altoiddealer

Quick tip: Never use Explod for P2 player anims in a custom state (unless if for a fullgame).
Reason: If P2 has different local screen coordinates (is higher or lower resolution), it is not factored. The Explods will display huge or tiny. There is no way to detect/fix it (I've tried e-v-e-r-y-t-h-i-n-g)


Odb718

#13
Testing against my Samus seems completely normal.
Spoiler (click to show)
Samus' localcoord is
localcoord = 1280,720
The 110 hit combo is testing on which of the three hitdefs hit. Using 1, 10, and 100 slots to check.

I think I've finally figured out the major problem. The Super Version uses PosSet and just drops P2 from the sky. The Ultra version uses TargetBind and hides P2 off screen.
the SV changes location with the hit reaction time = 1. the UV changes location when....?...?

What's the code for when you hit P2 but you want it to be 1 tic into the pause time??

Maybe if I use that This will work properly.


----
This thing I swear. I have the PERFECT timing on the targetbind to get the shadow to work now. But BUT The targetbind doesn't actually work....
It only moves P2 for 1 tic.  I think maybe this is why I had the 135 originally?
---- ----
Nope... Not sure how targetbind is working but not working. I can move P2 where ever I want on screen but only for 1 tic...
---- ---- ----
So somehow P2 selfstates on tic 1 of statedef 3053. I've paused mugen on time = -1, time = 0, and state 5050 time = 1. I dont see how it can selfstate if it's in the custom state.

Spoiler: State 3053 (click to show)

;----------------------------------------------------------------------
; Hell Hole Victim
[Statedef 3053]
type = A
movetype = H
physics = N 
velset = 0,0   
sprpriority = -5 

[State 0, Helper]
type = Helper
trigger1 = numhelper(1654) = 0
trigger1 = time = 0
helpertype = normal ;player
name = "Deadman"
ID = 1654
stateno = 5000
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0

[State 1352, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 1653
 
;commented out for testing
;[State 0, ScreenBound]
;type = ScreenBound
;trigger1 = 1
;value = 1
;movecamera = 1,0
;ignorehitpause = 1
 
[State 0, Gravity]
type = Gravity
trigger1 =time>111 

[State 1372, 4] ;Hit ground
type = SelfState
triggerall = time >= 410
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground
Yet again it just doesn't seem possible.
vVv Gouken718 vVv SabreTooth718 vVv


altoiddealer

Quote from: Odb718 on March 01, 2018, 10:09:54 PM
Testing against my Samus seems completely normal.
And she is drawn using Explod, in the custom state?


Odb718

Ah, no, that's why I have the two hitdefs. I put a helper into a state for an animation and destroyself. In my mind it's set up to be exactly like an explod. I'm telling you this Ultra has my brain fried. <_<

What the heck can make my custom hit state instantly selfstate?? And I'm talking INSTANTLY


Sprite 5030,40 may be some context clues but all I can figure is it's because it got hit, and is in the air. But physics are N and it's supposed to be in a customgoddamnedstate!! I mean as you can clearly see, the selfstate is only a few tics away from being active. Just 409 more tics.... I'm not sure what's sending P2 out of the state, let alone selfstate. I thought it was Fall = 1 in the hitdefs, so I commented it out. Same results. I'm not sure what the heck is going wrong each and every step of the way.

vVv Gouken718 vVv SabreTooth718 vVv


Odb718

I've rebuilt from the ground up. Everything is on track to work. But,
When I use

[State 0, HitAdd]
type = HitAdd
;triggerall = anim = 3005
trigger1 = time = 15
trigger2 = time = 65
trigger3 = time = 110
trigger4 = time = 145
trigger5 = time = 170
value = 131  ;1 ;so I can see if and when it pops up
ignorehitpause = 1

The "combo" counts at 132 because of the helper. Then it resets to 131, then back to 131, and it just keeps resetting. Is it because the timing is too far apart? How can I keep the "combo" going??
I feel like if I get the combo to work, something else is just going to break.
vVv Gouken718 vVv SabreTooth718 vVv