YesNoOk
avatar

show a helper attached to the top edge of the screen (Read 2197 times)

Started by warriorz, April 30, 2020, 10:46:53 pm
Share this topic:
show a helper attached to the top edge of the screen
#1  April 30, 2020, 10:46:53 pm
  • **
i must do this.. p1 launch a fireball that must hit the edge of screen and then must transform into other that hit p2..

I thought an helper that when is near the top edge of screen change his state/anim..

- first problem: i can set frontedgedist for the back of screen but there's a trigger for floor and top edge of the screen?

- second problem: the helper don't change his state.. i don't see the anim 13507.. i don't understand why!!!

;helper fireball
[Statedef 13503]
type    = S
movetype= A
physics = S
anim = 13503

[State 0, VelSet]
type = Velset
trigger1 = time >= 0
x = 5
y = -6

[State 13503]
type = changestate
trigger1 = frontedgedist <= 10
value = 13507

;---------------------------------------
[Statedef 13507]
type    = S
movetype= A
physics = S
anim = 13507
velset = 0,0

[State 0, Posset]
type = Posset
trigger1 = time = 0
X = p2dist X
y = p2dist y

[State 0, HitDef]
type = HitDef
trigger1 = animelem = 3
attr = S,NA
hitflag = MAF
guardflag = MA

[State 13503]
type = Destroyself
trigger1 = animtime = 0
value = 0
Re: show a helper attached to the top edge of the screen
#2  May 02, 2020, 02:44:00 pm
  • ***
  • AVP Project
    • Spain
    • sergeusmugen.blogspot.com
Hi!

Try to use "FrontEdgeBodyDist" instead of "FrontEdgeDist"
Maybe there´s the problem why the helper don´t change its state. If the x position of the helper can´t get the front edge (for the screenbound), it will not change never.

The same thing with "p2dist x", try with "p2bodydist x"

What you want to do with this?
[State 0, Posset]
type = Posset
trigger1 = time = 0
X = p2dist X
y = p2dist y

If you want to move the helper where the p2 is, maybe there could be better ways.
Re: show a helper attached to the top edge of the screen
#3  May 02, 2020, 07:41:50 pm
  • **
hi Sergeus..
yes, I want to bring up 3 helper (3 different attacks)
the attacks where the helper appears or hanging from the ceiling or coming out of the floor must correspond to p2 (so the reason of the sctrl that you asked me)
while in the attack where it appears behind the p2 it must remain attached to the edge of the screen

help me Serg it don't work..

- in the attack when helper must appear hanging to the top, i tried to use frontedgebodydist but nothing.. maybe because the projectile that p1 launch (before helper appear) don't run straight so it's possible that don't impact on frontedge but go in sky

- in the attack when helper must appear linked to the frontedge of screen i see helper but isn't link to the edge..

- in the attack when helper must appear from floor, first projectile don't stop his run on the ground.. i need to fix it.. but i see helper also if not in p2 position but in center of screen.

Last Edit: May 02, 2020, 08:59:55 pm by warriorz
Re: show a helper attached to the top edge of the screen
#4  May 02, 2020, 09:14:30 pm
  • ***
  • AVP Project
    • Spain
    • sergeusmugen.blogspot.com
Well, at first, if you want to make a helper stay in the edge of the screen, the problem is that the players are moving, and the screen follows them.
So, i think this could help you: use screenbound=0 when the helper exist, for example:
[State xxxx, 0];
type = ScreenBound
trigger1 = 1
value = 0

You must do it in all the states of the helper or in statedef -2 linked to:

[State -2, x];
type = ScreenBound
triggerall = NumHelper(xxxx) = 1
trigger1 = 1
value = 0

Of course, it´s better to use helpers than projectiles in this cases.

When you get the helper stay where you want, go to the next step. Try first with the helper who goes straight to the end of the screen.
Re: show a helper attached to the top edge of the screen
#5  May 02, 2020, 10:04:21 pm
  • **
so.. we talk about second attack (in my kids image, lol) i put screenbound but nothing change.. now p1 launch a fireball (helper). this fireball vanish over the edge of screen when frontedgebodydist <= 0 (with a simply changestate) and comes out from the edge this new helper that must hit p2 and block in a cage (simply setting an high pausetime value "for now").. 

i need to set the position of this damn helper.. with this posset i'm able to set y axis.. but if i try to add a negative X value the helper jump in the middle of screen.. there's a wall also if i add a screenbound..
Last Edit: May 02, 2020, 10:11:56 pm by warriorz
Re: show a helper attached to the top edge of the screen
#6  May 03, 2020, 01:04:24 am
  • ***
  • AVP Project
    • Spain
    • sergeusmugen.blogspot.com
This is what i would do (if i have understand you correctly):

Code:
[Statedef xxxx]; this is the helper appearing from the player1
type = A
movetype = A
physics = N
sprpriority = 3
anim = xxxx; the fireball

[State xxxx, VELX]
type = VelSet
trigger1 = TIME = 0
x = 5 ; the velocity you want

[State xxxx, nopush]; i think you dont want it to be push...
type = playerpush
trigger1 = 1
value = 0

[state xxxxx, HO] ; if you want the fireball to be hit
type = HitOverRide
trigger1 = Time = 0
time = -1
attr = SCA, NA, NP, NT, SA, ST, SP, HA, HT, HP
slot = 0
stateno = XXXX; state vanishing or exploding
ignorehitpause= 1

[State xxxx, ]; change to the new helper in the edge of the screen
type = ChangeState
trigger1 = frontedgebodydist <= 0
value = xxxx ; the state of the new helper

;--------------------------------------------------
[Statedef xxxxxx] ; new helper in the edge
type = A
movetype = A
physics = N
sprpriority = 3
anim = xxxx ; whatever...

[State xxxx, turn]
type = turn
trigger1 = anim = xxxx
trigger1 = animtime = 0

[State xxxx, VELINI]
type = VelSet
trigger1 = TIME = 0
x = 0

[State xxxx, nopush]
type = playerpush
trigger1 = 1
value = 0

[State xxxxx, 2] ; the hit or whatever you want
type = HitDef
trigger1 = 1
attr = S, NA
animtype  = light
damage    = 50,5
getpower  = 50
hitflag = MA
guardflag = MA
priority = 5, Hit 
pausetime = 0,0
sparkno = S920
guard.sparkno = S900
sparkxy = ceil(-8*const(size.xscale)), ceil(-30*const(size.yscale))
hitsound   = S2,0
guardsound = S3,0
ground.type = high
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = ifelse(p2movetype=H, -2, -6),ifelse(p2movetype=H, -5, 0)
airguard.velocity = -4,-3
air.velocity = -4,-5
fall = 0
air.fall = 1
persistent = 0

[state xxxx, 0] ; if you want to make possible to hit it
type = HitOverRide
trigger1 = Time = 0
time = -1
attr = SCA, NA, NP, NT, SA, ST, SP, HA, HT, HP
slot = 0
stateno = xxxxx
ignorehitpause= 1

[State xxxxx, 3]; go or something
type = ChangeState ; or destroyself
trigger1 = animtime = xxxx
value = xxxxx

Adding the screenbound if is necessary in every state or in statedef -2

Then you can call a new helper in that last state, with an invisible anim, give it a high x speed and make it stop when p2bodydist x<=0.
At this moment, hit the p2 and spawn the cage right there.
Re: show a helper attached to the top edge of the screen
#7  May 03, 2020, 02:19:20 pm
  • **
yeah you understand me and i have to make the attack as you wrote (little difference: i didn't use playerpush just didn't add blu boxes to helper, but i will see this thing..)..
- first helper (the fireball) is ok!!
-second helper (the cage linked to the edge of screen) spawn near the edge, half helper must be over the edge


Re: show a helper attached to the top edge of the screen
#8  May 03, 2020, 06:45:59 pm
  • ***
  • AVP Project
    • Spain
    • sergeusmugen.blogspot.com
First thing to check: the helper type must be "normal", not "player". It could make it do strange things in the edge of the screen...
Second: Test it in different stages (maybe there could be problems with the bound of the concrete stage)
Re: show a helper attached to the top edge of the screen
#9  May 03, 2020, 06:46:14 pm
  • **
ok. i've found a solution.. but as you say.. need that p2 must be near back edge.. if p2 walk.. the screen moves and this helper fly in air!.. so i thought about first helper.. the fireball.. i don't want damage from it.. but it could push the p2 near his back edge with same effect that p1 walkin direction of p2 push him.. i put blu boxes on helper/fireball and erase playerpush sctrl.. but now this fireball passes through p2.. if i use an hitdef can hit p2 but it's not the same effect.. other ideas?
Last Edit: May 03, 2020, 06:54:38 pm by warriorz
Re: show a helper attached to the top edge of the screen
#10  May 03, 2020, 07:09:55 pm
  • ***
  • AVP Project
    • Spain
    • sergeusmugen.blogspot.com
Let´s go on other ways of thinking...
Why doesn´t the fireball puts the P2 into a custom state when it hits him or pass him through?
In that state you put the P2 in the position you want, and add the helpers/explods needed for the cage effect...
Re: show a helper attached to the top edge of the screen
#11  May 03, 2020, 07:51:19 pm
  • **
but is so strange that a simply helper don't hit p2 and work as if it has a playerpush sctrl !!!
Re: show a helper attached to the top edge of the screen
#12  May 03, 2020, 08:17:35 pm
  • ***
  • AVP Project
    • Spain
    • sergeusmugen.blogspot.com
Have a look at the code of your Predator Raptor. The netgun attack. It could be something like this. Instead of take P2 on flight, make him walk back, for example (in that custom state), and when he´s near the edge of the screen, could appear the cage...
The fireball can pass through P2 as nothing happens...
Re: show a helper attached to the top edge of the screen
#13  May 03, 2020, 09:15:21 pm
  • **
the netgun' attack of my predator raptor was coding by you, lol.. same problem, different year!

but

i've done..

just I've add playerpush with value 1 at fireball (and 0 for second helper), a targetbind and I changed the offset of explod.. now work.. -1

now we can speak about other two situation.. from the floor (but i think that i can do alone)
just how can i make the fireball disappear when it hits the floor? I can't use the frontedgebodydist on the floor!


hanging from the top edge always at p2 (like vines that block p2) is the main problem
Last Edit: May 03, 2020, 09:42:57 pm by warriorz
Re: show a helper attached to the top edge of the screen
#14  May 04, 2020, 12:03:54 am
  • ***
  • AVP Project
    • Spain
    • sergeusmugen.blogspot.com
Great!

now we can speak about other two situation.. from the floor (but i think that i can do alone)
just how can i make the fireball disappear when it hits the floor? I can't use the frontedgebodydist on the floor!

Use the trigger "Pos Y >= 0  &&  vel Y > 0", it´s the moment that the helper touch the floor
Re: show a helper attached to the top edge of the screen
#15  May 04, 2020, 03:16:31 pm
  • **
don't work, the fireball don't vanish..
Are you sure? because i must say: change your state when this trigger is true: pos y >= 0 and vel >= 0, but the fireball's fly must be visible in every pos y on the screen but when touch pos y = 0 (the floor) must vanish.. but i'm not sure that "pos y = 0" is really the floor or is the axis that i put the sprite in .air file!

actually:
[State 13504]
type = changestate
triggerall = (enemy,backedgebodydist) < 10
 
   
;if the p2 is far from its rear edge must vanish (there's also a destroyself >= 10)
trigger1 = frontedgebodydist <= 0                    
;even if in a low direction the fireball can reach the frontedge (backedge for p2) before of the floor
value = 13508
Re: show a helper attached to the top edge of the screen
#16  May 04, 2020, 06:17:58 pm
  • ***
  • AVP Project
    • Spain
    • sergeusmugen.blogspot.com
Y = 0 is the correct floor position, but it your anim is not in the 0 axis, it´s higher for example, it will reach the floor later... or sooner (i´m not sure right now)

Try only triggering with this:
[State 13504]
type = changestate
triggerall = Pos Y >= 0  &&  vel Y > 0     
trigger1 = 1                   
value = 13508

But before it, check the animation, must be in the axis
Re: show a helper attached to the top edge of the screen
#17  May 05, 2020, 03:04:23 pm
  • **
in the .air the fireball anim is on 0.0.. but on screen i see fireball starts in direction of p1's arms (in helper's statedef i put an offset with time = 0 and y = -80)
- if i put your last changestate: immediately changestate and i see directly the second helper on p1 position!.. i don't see any fireball anim.

i tried to change the run of fireball (more simple i thought)..so i wrote a second veladd near the floor with trigger1 y = 0, y = 5, y >= 0, y > 0 but nothing.. the fireball doesn't even appear!



I was bored so I changed the trajectory of the fireball .. now it hits the front edge in the lower area and does not touch the floor, same thing for the third attack .. it impacts in the high area and does not go to the sky, I'm not satisfied but better than nothing..
now I have to test the three attacks together for any bugs