Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2018-07-19 15:04:01

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Another underwater bug [SOLVED]

Hi guys! Testing the new version of Open Surge and bringing Speedy the RollerSkater as usual, I remembered a problem I had with Speedy as he swims underwater.

The problem is when Speedy swims and touches an enemy, the enemy gets killed. This also happens with item boxes, while he swims, if he touches them, he breaks them.

Other case is when Speedy uses springs underwater to going up, the swimming sprites stills instead of changing to 'going up' sprite.

What I need to know is how to fix this and make Speedy getting hurt when he touches an enemy swimming, stopping his swim when he lands over an item box, and change his sprite when he goes up thanks to the springs.

Last edited by SynfigMaster91 (2018-08-22 12:42:41)

Offline

#2 2018-07-19 16:48:35

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Another underwater bug [SOLVED]

Hi SynfigMaster91,

Take a look at your scripts. Disable them and find out which one brings about the undesired behavior.

There's probably a strong_player somewhere.

Offline

#3 2018-07-20 14:19:08

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

Alexandre wrote:

Hi SynfigMaster91,

Take a look at your scripts. Disable them and find out which one brings about the undesired behavior.

There's probably a strong_player somewhere.

Hi, Alex. I checked out but there's no strong_player on the swim object. Just in the charge state. Here's the full code.

// ---------------------------------------------------------------------------
// Open speedy Engine
// http://opensnc.sourceforge.net
//
// File:   default_companions/speedy.inc
// Desc:   speedy's companion
// Author: Alexandre
// Date:   2011-02-09, 2011-02-11, 2012-02-23
// ---------------------------------------------------------------------------

object ".speedy_companion"
{
    requires 0.2.0
    always_active

    state "main"
    {
        create_child ".speedy_spindash_controller"
        create_child ".speedy_nolightwalk_controller"
        create_child ".speedy_swim"
        destroy
    }
}


object ".speedy_spindash_controller"
{
    requires 0.2.0
    always_active

    state "main"
    {
        hide
        observe_player "speedy"
        change_state "stand by"
    }

    state "stand by"
    {
        on_player_duck "duck"
    }

    state "duck"
    {
        let "$p = 0"
        on_button_pressed "fire1" "charge"
        on_player_duck "duck"
        change_state "stand by"
    }

    state "charge"
    {
        set_player_animation "SD_speedy" "6"
        strong_player
        springfy_player // so that the camera won't go down, since the player is ducking
        disable_player_movement
        play_sample "charge"
        let "$p = min($p+2, 8)"
        change_state "hold"
    }

    state "hold"
    {
        //textout menu.small 0 0 $p
        set_player_animation "SD_speedy" "6"
        let "$p -= 0.234 * floor(8*$p) * dt()"

        // check if there's a platform underneath the player
        attach_to_player 0 20
        unless "obstacle_exists(0,0)" "cancel"

        // create cool particles
        let "$_pixelparticle_anim = 1 + random(3)"
        let "$_pixelparticle_xvel = -player_direction() * (120 + random(60))"
        let "$_pixelparticle_yvel = -60 - random(120)"
        create_child .pixelparticle -player_direction()*7 -2
        let "$_pixelparticle_anim = 1 + random(3)"
        let "$_pixelparticle_xvel = -player_direction() * (120 + random(60))"
        let "$_pixelparticle_yvel = -60 - random(120)"
        create_child .pixelparticle -player_direction()*7 -2
        let "$_pixelparticle_anim = 1 + random(3)"
        let "$_pixelparticle_xvel = -player_direction() * (120 + random(60))"
        let "$_pixelparticle_yvel = -60 - random(120)"
        create_child .pixelparticle -player_direction()*7 -2

        // check if the user wants to charge more, or if we can release the player
        on_button_pressed "fire1" "charge"
        on_button_down "down" "hold"
        change_state "release"
    }

    state "cancel"
    {
        enable_player_movement
        weak_player
        change_state "stand by"
    }

    state "release"
    {
        play_sample "release"
        enable_player_movement
        weak_player
        set_player_xspeed "(480 + 30 * floor($p)) * player_direction()"
        roll_player
        change_state "stand by"
    }
}

object ".speedy_nolightwalk_controller" // his lighting sneakers can't shine when in the air
{
    requires 0.2.0
    always_active

    state "main"
    {
        hide
        observe_player "speedy"
        change_state "stand by"
    }

    state "stand by"
    {
        on_player_in_the_air "air"
    }

    state "air"
    {
        on_player_walk "walking in the air"
        on_player_run "running in the air"
        on_player_brake "braking in the air"
        on_player_in_the_air "air"
        change_state "stand by"
    }

    state "walking in the air"
    {
        on_player_spring "stand by"
        on_player_jump "stand by"
        on_player_gethit "stand by"
        on_player_death "stand by"

        set_player_animation "SD_speedy" 18
        on_player_in_the_air "walking in the air"
        change_state "stand by"
    }

    state "running in the air"
    {
        on_player_spring "stand by"
        on_player_jump "stand by"
        on_player_gethit "stand by"
        on_player_death "stand by"

        set_player_animation "SD_speedy" 19
        on_player_in_the_air "running in the air"
        change_state "stand by"
    }

    state "braking in the air"
    {
        on_player_spring "stand by"
        on_player_jump "stand by"
        on_player_gethit "stand by"
        on_player_death "stand by"

        set_player_animation "SD_speedy" 20
        on_player_in_the_air "braking in the air"
        change_state "stand by"
    }
}

object ".speedy_swim"
{
    requires 0.2.0
    always_active

    state "main"
    {
        hide
        observe_player "Speedy"
        change_state "wait"
    }

    state "wait"
    {
        change_state "up"
    }

    state "up"
    {
        change_state "ready"
    }

    state "ready"
    {
        on_button_pressed "fire6" "start"
        on_player_walk "main"
        on_player_run "main"
    }

    state "start"
    {
        on_player_underwater "sswim"
        change_state "main"
    }

    state "sswim" 
    {
        set_player_animation "SD_SPEEDY" 21
        on_button_pressed "fire6" "swim"
        on_player_walk "main"
        on_player_run "main"
    }

    state "swim"
    {
        set_player_animation "SD_SPEEDY" 21
        set_player_yspeed -90
        change_state "sswim"
    }
}

Offline

#4 2018-07-20 18:38:08

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Another underwater bug [SOLVED]

SynfigMaster91 wrote:

I checked out but there's no strong_player on the swim object. Just in the charge state.

Exactly. So you have to debug it. Remove the "charge" state, its triggers and see what is going on.

See also if you have other objects that might be calling strong_player.

If you replace Speedy by Surge, does it work? It works on a clean install.

Offline

#5 2018-07-20 20:31:30

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

Alexandre wrote:
SynfigMaster91 wrote:

I checked out but there's no strong_player on the swim object. Just in the charge state.

Exactly. So you have to debug it. Remove the "charge" state, its triggers and see what is going on.

See also if you have other objects that might be calling strong_player.

If you replace Speedy by Surge, does it work? It works on a clean install.

I removed the charge state but nothing worked, beside getting an error when trying to do a spin dash.

I don't think replacing Speedy by Surge works because I didn't make Surge swimming neither.

Offline

#6 2018-07-21 00:56:27

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Another underwater bug [SOLVED]

SynfigMaster91 wrote:

I don't think replacing Speedy by Surge works because I didn't make Surge swimming neither.

Think at first that you're doing a diagnosis. You're not looking for a solution (just yet), rather, you're doing an investigation to see what is wrong.

In your diagnosis, you run a series of tests. Each test tells you a bit about the actual condition, so you get closer and closer to a correct diagnosis. Once you identify what the problem is, then you can proceed to a solution, but not before.

Offline

#7 2018-07-21 13:02:43

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

Alexandre wrote:
SynfigMaster91 wrote:

I don't think replacing Speedy by Surge works because I didn't make Surge swimming neither.

Think at first that you're doing a diagnosis. You're not looking for a solution (just yet), rather, you're doing an investigation to see what is wrong.

In your diagnosis, you run a series of tests. Each test tells you a bit about the actual condition, so you get closer and closer to a correct diagnosis. Once you identify what the problem is, then you can proceed to a solution, but not before.


Hmm... how could I do this? Testing other characters? It's the first time I'm doing this and some step by step info would be nice for me.

Offline

#8 2018-07-21 15:46:07

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

I tried with checking the code and changing some things but the problem is still the same.

I wonder why won't I be able to make Speedy get hurt by an enemy while he swims? Is fate wanting me to fail in everything I try? sad

Offline

#9 2018-07-21 17:24:07

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Another underwater bug [SOLVED]

If I might suggest something, get a clean install of Open Surge and make Speedy work on that. Do not copy any scripts.

Once you make it work, check the difference between the versions.

I'm sure you can figure that one out wink

Offline

#10 2018-07-21 18:45:12

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

Alexandre wrote:

If I might suggest something, get a clean install of Open Surge and make Speedy work on that. Do not copy any scripts.

Once you make it work, check the difference between the versions.

I'm sure you can figure that one out wink

You mean... using a clean version of Open Surge and copying my Speedy script and sprites there?

Not sure if it will work but I can try.

Offline

#11 2018-07-23 09:19:49

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Another underwater bug [SOLVED]

if the player is set to roll or any animation that causes the attack hitbox to be created, it will act as a constant strong_player.

what you want to do is to make a simple object, that is always_active and every frame observes that player and gives them weak_player.

state "main"
{
    observe_player "player_name"
    weak_player
}

unless this has been changed in the latest revisions, it should work


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#12 2018-07-23 12:56:07

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

KZR wrote:

if the player is set to roll or any animation that causes the attack hitbox to be created, it will act as a constant strong_player.

what you want to do is to make a simple object, that is always_active and every frame observes that player and gives them weak_player.

state "main"
{
    observe_player "player_name"
    weak_player
}

unless this has been changed in the latest revisions, it should work

I tried but nothing works! sad

Here's my code now:

object ".speedy_companion"
{
    requires 0.2.0
    always_active

    state "main"
    {
        create_child ".speedy_spindash_controller"
        create_child ".speedy_nolightwalk_controller"
        create_child ".speedy_swim"
        destroy
    }
}


object ".speedy_spindash_controller"
{
    requires 0.2.0
    always_active

    state "main"
    {
        hide
        observe_player "speedy"
        change_state "stand by"
        weak_player
    }

    state "stand by"
    {
        on_player_duck "duck"
    }

    state "duck"
    {
        let "$p = 0"
        on_button_pressed "fire1" "charge"
        on_player_duck "duck"
        change_state "stand by"
    }

    state "charge"
    {
        set_player_animation "SD_speedy" "6"
        strong_player
        springfy_player // so that the camera won't go down, since the player is ducking
        disable_player_movement
        play_sample "charge"
        let "$p = min($p+2, 8)"
        change_state "hold"
    }

    state "hold"
    {
        //textout menu.small 0 0 $p
        set_player_animation "SD_speedy" "6"
        let "$p -= 0.234 * floor(8*$p) * dt()"

        // check if there's a platform underneath the player
        attach_to_player 0 20
        unless "obstacle_exists(0,0)" "cancel"

        // create cool particles
        let "$_pixelparticle_anim = 1 + random(3)"
        let "$_pixelparticle_xvel = -player_direction() * (120 + random(60))"
        let "$_pixelparticle_yvel = -60 - random(120)"
        create_child .pixelparticle -player_direction()*7 -2
        let "$_pixelparticle_anim = 1 + random(3)"
        let "$_pixelparticle_xvel = -player_direction() * (120 + random(60))"
        let "$_pixelparticle_yvel = -60 - random(120)"
        create_child .pixelparticle -player_direction()*7 -2
        let "$_pixelparticle_anim = 1 + random(3)"
        let "$_pixelparticle_xvel = -player_direction() * (120 + random(60))"
        let "$_pixelparticle_yvel = -60 - random(120)"
        create_child .pixelparticle -player_direction()*7 -2

        // check if the user wants to charge more, or if we can release the player
        on_button_pressed "fire1" "charge"
        on_button_down "down" "hold"
        change_state "release"
    }

    state "cancel"
    {
        enable_player_movement
        weak_player
        change_state "stand by"
    }

    state "release"
    {
        play_sample "release"
        enable_player_movement
        weak_player
        set_player_xspeed "(480 + 30 * floor($p)) * player_direction()"
        roll_player
        change_state "stand by"
    }
}

object ".speedy_nolightwalk_controller" // his lighting sneakers can't shine when in the air
{
    requires 0.2.0
    always_active

    state "main"
    {
        hide
        observe_player "speedy"
        change_state "stand by"
        weak_player
    }

    state "stand by"
    {
        on_player_in_the_air "air"
    }

    state "air"
    {
        on_player_walk "walking in the air"
        on_player_run "running in the air"
        on_player_brake "braking in the air"
        on_player_in_the_air "air"
        change_state "stand by"
    }

    state "walking in the air"
    {
        on_player_spring "stand by"
        on_player_jump "stand by"
        on_player_gethit "stand by"
        on_player_death "stand by"

        set_player_animation "SD_speedy" 18
        on_player_in_the_air "walking in the air"
        change_state "stand by"
    }

    state "running in the air"
    {
        on_player_spring "stand by"
        on_player_jump "stand by"
        on_player_gethit "stand by"
        on_player_death "stand by"

        set_player_animation "SD_speedy" 19
        on_player_in_the_air "running in the air"
        change_state "stand by"
    }

    state "braking in the air"
    {
        on_player_spring "stand by"
        on_player_jump "stand by"
        on_player_gethit "stand by"
        on_player_death "stand by"

        set_player_animation "SD_speedy" 20
        on_player_in_the_air "braking in the air"
        change_state "stand by"
    }
}

object ".speedy_swim"
{
    requires 0.2.0
    always_active

    state "main"
    {
        observe_player "Speedy"
        weak_player
        change_state "wait"
    }

    state "wait"
    {
        change_state "up"
    }

    state "up"
    {
        change_state "ready"
    }

    state "ready"
    {
        on_button_pressed "fire6" "start"
        on_player_walk "main"
        on_player_run "main"
    }

    state "start"
    {
        on_player_underwater "sswim"
        change_state "main"
    }

    state "sswim" 
    {
        set_player_animation "SD_SPEEDY" 21
        on_button_pressed "fire6" "swim"
        on_player_walk "main"
        on_player_run "main"
    }

    state "swim"
    {
        set_player_animation "SD_SPEEDY" 21
        set_player_yspeed -90
        change_state "sswim"
    }
}

No matter how much I try, why is this problem being so persistent?

Offline

#13 2018-07-23 15:08:43

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

Also I made a video showing graphically my problem just in case you need to see more clues.

https://drive.google.com/open?id=1gi-yF … G1EMbLyOUw

Offline

#14 2018-07-23 23:16:40

Race the Hedgehog
Member
From: Sao Bernardo do Campo, Brazil
Registered: 2010-12-16
Posts: 163
Website

Re: Another underwater bug [SOLVED]

SynfigMaster91 wrote:

No matter how much I try, why is this problem being so persistent?

It's simple, the problem is that when your character jumps, he will become "invincible" until he falls on the ground, or against a spring.
The solution to your problem is to get the character out of the jump state by adding a "springfy_player" code before the swim animation.
Something like this:

    
    state "sswim" 
    {
        springfy_player
        set_player_animation "SD_SPEEDY" 21
        on_button_pressed "fire6" "swim"
        on_player_walk "main"
        on_player_run "main"
    }

PunBB bbcode test
Creating and Editing Sprites.

Offline

#15 2018-07-24 13:24:58

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

Race the Hedgehog wrote:
SynfigMaster91 wrote:

No matter how much I try, why is this problem being so persistent?

It's simple, the problem is that when your character jumps, he will become "invincible" until he falls on the ground, or against a spring.
The solution to your problem is to get the character out of the jump state by adding a "springfy_player" code before the swim animation.
Something like this:

    
    state "sswim" 
    {
        springfy_player
        set_player_animation "SD_SPEEDY" 21
        on_button_pressed "fire6" "swim"
        on_player_walk "main"
        on_player_run "main"
    }

Okay, now the character gets hurt when he touches the enemy but the swimming sprite stays, even touching the ground. Here's a video showing it:

https://drive.google.com/open?id=1m3cEQ … rssZzL0s7T

Here's the code:

object ".speedy_companion"
{
    requires 0.2.0
    always_active

    state "main"
    {
        create_child ".speedy_spindash_controller"
        create_child ".speedy_nolightwalk_controller"
        create_child ".speedy_swim"
        destroy
    }
}


object ".speedy_spindash_controller"
{
    requires 0.2.0
    always_active

    state "main"
    {
        hide
        observe_player "speedy"
        change_state "stand by"
        weak_player
    }

    state "stand by"
    {
        on_player_duck "duck"
    }

    state "duck"
    {
        let "$p = 0"
        on_button_pressed "fire1" "charge"
        on_player_duck "duck"
        change_state "stand by"
    }

    state "charge"
    {
        set_player_animation "SD_speedy" "6"
        strong_player
        springfy_player // so that the camera won't go down, since the player is ducking
        disable_player_movement
        play_sample "charge"
        let "$p = min($p+2, 8)"
        change_state "hold"
    }

    state "hold"
    {
        //textout menu.small 0 0 $p
        set_player_animation "SD_speedy" "6"
        let "$p -= 0.234 * floor(8*$p) * dt()"

        // check if there's a platform underneath the player
        attach_to_player 0 20
        unless "obstacle_exists(0,0)" "cancel"

        // create cool particles
        let "$_pixelparticle_anim = 1 + random(3)"
        let "$_pixelparticle_xvel = -player_direction() * (120 + random(60))"
        let "$_pixelparticle_yvel = -60 - random(120)"
        create_child .pixelparticle -player_direction()*7 -2
        let "$_pixelparticle_anim = 1 + random(3)"
        let "$_pixelparticle_xvel = -player_direction() * (120 + random(60))"
        let "$_pixelparticle_yvel = -60 - random(120)"
        create_child .pixelparticle -player_direction()*7 -2
        let "$_pixelparticle_anim = 1 + random(3)"
        let "$_pixelparticle_xvel = -player_direction() * (120 + random(60))"
        let "$_pixelparticle_yvel = -60 - random(120)"
        create_child .pixelparticle -player_direction()*7 -2

        // check if the user wants to charge more, or if we can release the player
        on_button_pressed "fire1" "charge"
        on_button_down "down" "hold"
        change_state "release"
    }

    state "cancel"
    {
        enable_player_movement
        weak_player
        change_state "stand by"
    }

    state "release"
    {
        play_sample "release"
        enable_player_movement
        weak_player
        set_player_xspeed "(480 + 30 * floor($p)) * player_direction()"
        roll_player
        change_state "stand by"
    }
}

object ".speedy_nolightwalk_controller" // his lighting sneakers can't shine when in the air
{
    requires 0.2.0
    always_active

    state "main"
    {
        hide
        observe_player "speedy"
        change_state "stand by"
        weak_player
    }

    state "stand by"
    {
        on_player_in_the_air "air"
    }

    state "air"
    {
        on_player_walk "walking in the air"
        on_player_run "running in the air"
        on_player_brake "braking in the air"
        on_player_in_the_air "air"
        change_state "stand by"
    }

    state "walking in the air"
    {
        on_player_spring "stand by"
        on_player_jump "stand by"
        on_player_gethit "stand by"
        on_player_death "stand by"

        set_player_animation "SD_speedy" 18
        on_player_in_the_air "walking in the air"
        change_state "stand by"
    }

    state "running in the air"
    {
        on_player_spring "stand by"
        on_player_jump "stand by"
        on_player_gethit "stand by"
        on_player_death "stand by"

        set_player_animation "SD_speedy" 19
        on_player_in_the_air "running in the air"
        change_state "stand by"
    }

    state "braking in the air"
    {
        on_player_spring "stand by"
        on_player_jump "stand by"
        on_player_gethit "stand by"
        on_player_death "stand by"

        set_player_animation "SD_speedy" 20
        on_player_in_the_air "braking in the air"
        change_state "stand by"
    }
}

object ".speedy_swim"
{
    requires 0.2.0
    always_active

    state "main"
    {
        observe_player "Speedy"
        change_state "wait"
    }

    state "wait"
    {
        change_state "up"
    }

    state "up"
    {
        change_state "ready"
    }

    state "ready"
    {
        on_button_pressed "fire6" "start"
        on_player_walk "main"
        on_player_run "main"
    }

    state "start"
    {
        on_player_underwater "sswim"
        change_state "main"
    }

    state "sswim" 
    {
        springfy_player
        set_player_animation "SD_SPEEDY" 21
        on_button_pressed "fire6" "swim"
        on_player_walk "main"
        on_player_run "main"
    }

    state "swim"
    {
        set_player_animation "SD_SPEEDY" 21
        set_player_yspeed -90
        change_state "sswim"
    }
}

Offline

#16 2018-07-25 14:45:41

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

Well? Can anyone do something about this?

Offline

#17 2018-07-26 04:00:01

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Another underwater bug [SOLVED]

In your state sswim, add a check: if the player is not underwater, quit the state.

As it is, the animation will be changed to 21 unless you quit the state.

Offline

#18 2018-07-26 08:26:40

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

Alexandre wrote:

In your state sswim, add a check: if the player is not underwater, quit the state.

As it is, the animation will be changed to 21 unless you quit the state.

Is there info about adding a check on the wiki?

Offline

#19 2018-07-26 14:18:44

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

How can I check if the player is not underwater? What API event should I use?

Offline

#20 2018-07-27 05:31:33

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Another underwater bug [SOLVED]

SynfigMaster91 wrote:

How can I check if the player is not underwater? What API event should I use?

In the old scripting API, I like to use a technique like this:

    state "sswim" 
    {
        springfy_player
        set_player_animation "SD_SPEEDY" 21
        on_button_pressed "fire6" "swim"

        // see below
        on_player_underwater "sswim"
        change_state "main"
    }

The state will be changed to main only if the player is not underwater.

Adapt as needed.

Offline

#21 2018-07-27 12:48:20

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

Alexandre wrote:
SynfigMaster91 wrote:

How can I check if the player is not underwater? What API event should I use?

In the old scripting API, I like to use a technique like this:

    state "sswim" 
    {
        springfy_player
        set_player_animation "SD_SPEEDY" 21
        on_button_pressed "fire6" "swim"

        // see below
        on_player_underwater "sswim"
        change_state "main"
    }

The state will be changed to main only if the player is not underwater.

Adapt as needed.

I tried your code but...

https://drive.google.com/open?id=1JTPl8 … p8DScMOtaT

Offline

#22 2018-07-27 12:49:53

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

It seems to me this problem doesn't want to be solved and it's beggining to be annoying... hmm

Offline

#23 2018-07-28 01:43:15

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Another underwater bug [SOLVED]

Here's one thing I noticed on your video:

when the player gets off water, his animation seems to be restored to normal. When he gets underwater again, the swimming animation is played.

I don't know what exactly is "bugged" there, as this gameplay seems fair to me. For us to understand the problem better, can you explain in clear terms what exactly do you expect for this animation? When should it be played, exactly? If he touches the ground?

// Try this
    state "sswim" 
    {
        springfy_player
        set_player_animation "SD_SPEEDY" 21
        on_button_pressed "fire6" "swim"
        on_player_walk "main"
        on_player_run "main"
        on_player_underwater "sswim"
        change_state "main"
    }

Offline

#24 2018-07-28 12:38:16

SynfigMaster91
Member
Registered: 2017-10-10
Posts: 144

Re: Another underwater bug [SOLVED]

Alexandre wrote:

Here's one thing I noticed on your video:

when the player gets off water, his animation seems to be restored to normal. When he gets underwater again, the swimming animation is played.

I don't know what exactly is "bugged" there, as this gameplay seems fair to me. For us to understand the problem better, can you explain in clear terms what exactly do you expect for this animation? When should it be played, exactly? If he touches the ground?

// Try this
    state "sswim" 
    {
        springfy_player
        set_player_animation "SD_SPEEDY" 21
        on_button_pressed "fire6" "swim"
        on_player_walk "main"
        on_player_run "main"
        on_player_underwater "sswim"
        change_state "main"
    }

Here's a list of things I want to get:

1) When Speedy swims and touches an enemy, he must be change to the 'hurt' sprite. The one when you get hit by an enemy when you don't attack.

2) When Speedy swims over a item box, he must not destroy it, only when he roll jumps.

3) When Speedy lands on the floor while he swims, he walks like Sonic on the underwater levels of the Sonic games.

4) When he reaches to the surface swimming, he can change to his roll jumping sprite and hit enemies.

Offline

#25 2018-07-28 15:27:06

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: Another underwater bug [SOLVED]

So, basically:

1) If he gets underwater, he should play the swimming animation until: a) he gets off water b) he lands on the floor or c) gets hit
2) When playing the swimming animation, he should not be able to attack baddies nor crash item boxes

Outside the water, just use Surge's behavior.

Is that correct?

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org