YesNoOk
avatar

wall (Read 313 times)

Started by sgn15, August 12, 2013, 01:40:48 pm
Share this topic:
wall
#1  August 12, 2013, 01:40:48 pm
  • ***
This is a wall helper that stays on the ground and should have a "body" that all players CANNOT pass through (as in a literal wall). I already put blue clsn on it (anim 232 only) and use playerpush, but there are problems

- p1 can pass through the wall
- the posset works but when p2 tries to "push" the wall by walking against it, the wall moves but tries to get back to its position (because posset's trigger is 1 I know but I am asking for a better way and to avoid this from happening) basically the wall "vibrates" animation-wise when p2 tries to walk against the wall
- when both players move, the wall stays on its position with respect to the screen (so if it was summoned at center, it stays at center). I don't want this. I want the wall to stay wherever it was called (and can exist off-screen) and won't be pushed by any player

The wall can't be hit by enemy players (but this part is no problem for me).

Here are the codes. States 231 and 233 are just for animations, 232 is the idle state with the problem I am talking about.

Spoiler, click to toggle visibilty
Re: wall
#2  August 12, 2013, 02:57:02 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
If you don't want P1 to pass through the wall, you have to do some proximity detection of the wall in P1. For example, set velocity x to 0 when the absolute "abs" distance between p1 and the wall, is less than a certain value. Maybe something like this:
Code:
[State ****] ;State -2 or -3
type = VelSet
triggerall = numhelper(wall helper ID) ; If your wall helper exists
trigger1 = abs(helper(wall helper ID),pos x-pos x)<20 ; If the absolute distance between your wall helper and P1 is less than 20 pixels.
x = 0

For the wall being pushed, I suggest you use two animations. The "anim" for the wall helper should be nothing but blue CLSNs. Then in the helper, spawn an explod with your wall sprite and make sure bindtime=1, so it doesn't get pushed with your helper.

If you want the wall to stay in its place and be able to move off screen, just don't use an PosSet code. By default it won't move unless you tell it to, by using PosSet. Remove that varset too. It's useless.

-[Все слова это только слова.]-
Re: wall
#3  August 12, 2013, 03:10:21 pm
  • ***
ah ok. so it is impossible to code the wall to not be passable by both p1 and p3 from the perspective/statedef of the wall?

when I remove/not use the posset, p2 can "push" against the wall by walking/running against it. any other solutions for this?

oh and another question, is it possible for the wall to be hittable by any player (including p1 and p3) ?
Re: wall
#4  August 12, 2013, 03:29:53 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Correct... you have to "fake" the boundaries of the wall.

Ah ok. I see. You can use PosSet but make sure you position by means of screenpos x. You'll have to experiment with this.

Yes, it's possible, but you'd have to spawn the wall hittable part from P2 as well. Otherwise, you could just detect if you're near the wall and "fake" your hits... but that's not ideal.

This is really something that works better in a full game environment.

-[Все слова это только слова.]-
Re: wall
#5  August 12, 2013, 03:59:33 pm
  • ***
ok. I'm dropping the "wall not being passable by p1 and p3" and "wall being hittable by p1 and p3" aspects.

I did the explod thing (bindtime = 1), but the wall itself (blank anim with blue clsn) is still the problem and the explod are the problem. The wall adjusts its own position when the camera moves and then because the explod has bindtime = 1, when the wall itself moves, the wall explod and the blank anim are not in the same place anymore.

the non-inclusion of posset still results in the wall being "pushed" by p2 by running/walking against the wall. are there alternatives for the posset?
Re: wall
#6  August 12, 2013, 04:18:25 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Hmm, this is a tough one. I remember trying to do something similar too.

See, what you need to do is position, using PosSet or PosAdd, the helper in place, relative to ScreenPos X. If you try to just use regular positioning, what you get is the wall attached to the same place in the screen, regardless of camera movement. I can't think of it off the top of my head and am on a mac right now, so I can't try test things. Like always, you have to use trial and error to get this working. ScreenPos X is your friend here. Try it with PosAdd too. See what happens?

The explod won't be a problem once you get the wall locked into place.

-[Все слова это только слова.]-
Re: wall
#7  August 12, 2013, 04:49:43 pm
  • ***
Yep I'm doing trial and error since your first reply here. still no luck though.

this is my posset code so far

[State 0, PosSet]
type = PosSet
trigger1 = 1
x = pos x - screenpos x + 110;
y = 0
;ignorehitpause =
;persistent =

using a continuous posadd will make it function like a velset/veladd/velmul unless I change the x value (from the posset above)

question: Is the trigger1 = 1 at least correct?
Re: wall
#8  August 12, 2013, 05:56:41 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Yes, trigger1=1 is correct. I suggest PosAdd because I've used it to position things on screen (y axis), like: y = -ScreenPos X with PosAdd.

Maybe someone else knows. I'm guessing at this point.

-[Все слова это только слова.]-
Re: wall
#9  August 13, 2013, 09:57:50 pm
  • ***
    • USA
I forget if my Ibuki's frog is exactly how you want, but I'm pretty sure I made it unmovable. I know if someone tries pushblocking it, Ibuki moves and not the frog... but it might just be some trickery. Like I know I spawn a helper but I think the helper spawns an explode so it doesnt bounce the way you described.

ah ok, I just looked at her. I spawn a helper that sets a variable to keep track of the point it was spawned at.

I also use
[State 12510, PlayerPush]
type = PlayerPush
trigger1 = movehit
value = 0

If you want, take a look and see if it's like what you want. 
command = ~D, DF, F, a+b to do the move. it's a level 1 ultra. A link to her topic's in my sig.