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 2014-02-22 14:14:12

Loilkas
Member
Registered: 2010-07-20
Posts: 155

Character moveset

Does anyone know where the characters moveset folder would be located?

thx big_smile


nvm

I found it in imput.def now all I need to find is the spindash command, and I have no idea how I am going to do that, could you help?

thx big_smile

Last edited by Loilkas (2014-02-22 14:17:48)


Dead account. YEAH

Offline

#2 2014-02-22 17:44:29

svgmovement
Member
Registered: 2011-11-24
Posts: 209

Re: Character moveset

I think the spindash is actually a sequence of three commands
(usually down, fire 1, up), and the input.def just says which key
or joystick button maps to those commands. hmm

What exactly are you trying to do?


-- svgmovement

Offline

#3 2014-02-23 10:06:57

Loilkas
Member
Registered: 2010-07-20
Posts: 155

Re: Character moveset

Just make another spindash but instead you have to press up instead of down...
Kinda like the super peel out big_smile


Dead account. YEAH

Offline

#4 2014-02-23 13:35:24

fahyda
Member
Registered: 2013-05-04
Posts: 40

Re: Character moveset

speaking about move sets can u make a command for a gun (e.g. the megabuster from megaman)?

Offline

#5 2014-02-24 00:13:03

svgmovement
Member
Registered: 2011-11-24
Posts: 209

Re: Character moveset

I think you need object scripting for that.


-- svgmovement

Offline

#6 2014-02-24 23:16:01

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

Re: Character moveset

studying the Object API in the wiki and reading a few object scripts would be a start. there are no commands to give guns, and input.def only says which keys the game uses. the actual spindash is an object that reads input ofr "down" and "fire1" and then does something to the player. But like i said, you'll only understand if you look at the documentation and see how objects are made.


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

Offline

#7 2014-02-24 23:33:14

S32X
Member
From: Rochester, New York
Registered: 2012-03-18
Posts: 880
Website

Re: Character moveset

The actual code for the spindash is located in a character's companion file as shown below

object ".surge_spindash_controller"
{
    requires 0.2.0
    always_active

    state "main"
    {
        hide
        observe_player "Surge"
        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_SURGE" "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_SURGE" "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"
    }
}

Each player has a certain companion file with this code in it (with variations depending to the player's graphics of course). They used to be in .inc format, but have seemed to changed to .obj format since whenever tongue

I had a lot of fun messing with this file about a little over a year ago when I was in England for a few weeks.

Loilkas wrote:

Just make another spindash but instead you have to press up instead of down...
Kinda like the super peel out big_smile

Ah, see while I was messing around with the file (about a little over a year ago when I was in England for a few weeks), I also attempted to reverse-engineer the code/script so I could do what you're trying to do now; create a super peel-out, however the way the actual procedure of the code/script works makes it impossible to create this effect in method of just reversing the control scheme due to the Engine's game physics.

Eventually it led me to making a half-assed "psuedo" peel-out where I just changed the somersault animation to a running animation. hmm

I'm sure there's another way to achieve a super peel-out-esque move, just not this way.

Offline

#8 2014-02-25 18:41:46

aronthehedgehog
Member
From: Lincoln, NE
Registered: 2013-04-05
Posts: 390

Re: Character moveset

Loilkas wrote:

Just make another spindash but instead you have to press up instead of down...
Kinda like the super peel out big_smile

I've already done that if your asking.


Not active much anymore.
The only things I do now is just let inspiration come to me when it's needed.
Also bad profile pic because I don't have anything else in mind.

Offline

#9 2014-02-26 18:30:55

Loilkas
Member
Registered: 2010-07-20
Posts: 155

Re: Character moveset

aronthehedgehog wrote:
Loilkas wrote:

Just make another spindash but instead you have to press up instead of down...
Kinda like the super peel out big_smile

I've already done that if your asking.

When? And do you have a download?


Dead account. YEAH

Offline

#10 2014-02-26 19:56:14

aronthehedgehog
Member
From: Lincoln, NE
Registered: 2013-04-05
Posts: 390

Re: Character moveset

no but i have the code.

object ".sonic_complicated_controller"
{
    requires 0.2.0
    always_active

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

    state "stand by"
    {
        on_player_lookup "ready"
    }

    state "ready"
    {
        let "$p = 0"
        on_button_pressed "fire1" "charge"
        on_player_lookup "ready"
        change_state "stand by"
    }

    state "charge"
    {
        set_player_animation "SD_SONIC" "2"
        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_SONIC" "2"
        let "$p -= 0.234 * floor(8*$p) * dt()"

        // check if there's a platform underneath the player
        attach_to_player 0 20
        unless "brick_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 "up" "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 "(700 + 30 * floor($p)) * player_direction()"
        change_state "stand by"
    }
}

it's basically the same as the spindash though it's pressing the up button. big_smile


Not active much anymore.
The only things I do now is just let inspiration come to me when it's needed.
Also bad profile pic because I don't have anything else in mind.

Offline

#11 2014-02-28 19:22:51

Loilkas
Member
Registered: 2010-07-20
Posts: 155

Re: Character moveset

aronthehedgehog wrote:

no but i have the code.

object ".sonic_complicated_controller"
{
    requires 0.2.0
    always_active

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

    state "stand by"
    {
        on_player_lookup "ready"
    }

    state "ready"
    {
        let "$p = 0"
        on_button_pressed "fire1" "charge"
        on_player_lookup "ready"
        change_state "stand by"
    }

    state "charge"
    {
        set_player_animation "SD_SONIC" "2"
        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_SONIC" "2"
        let "$p -= 0.234 * floor(8*$p) * dt()"

        // check if there's a platform underneath the player
        attach_to_player 0 20
        unless "brick_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 "up" "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 "(700 + 30 * floor($p)) * player_direction()"
        change_state "stand by"
    }
}

it's basically the same as the spindash though it's pressing the up button. big_smile

Can you change it to Tux? when I tried it didn't work


Dead account. YEAH

Offline

#12 2014-03-02 21:21:03

fahyda
Member
Registered: 2013-05-04
Posts: 40

Re: Character moveset

i want to make a game using open surge that has multiple platformers to play. is that possible?

Offline

#13 2014-03-02 22:17:58

S32X
Member
From: Rochester, New York
Registered: 2012-03-18
Posts: 880
Website

Re: Character moveset

aronthehedgehog wrote:

no but i have the code.

object ".sonic_complicated_controller"
{
    requires 0.2.0
    always_active

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

    state "stand by"
    {
        on_player_lookup "ready"
    }

    state "ready"
    {
        let "$p = 0"
        on_button_pressed "fire1" "charge"
        on_player_lookup "ready"
        change_state "stand by"
    }

    state "charge"
    {
        set_player_animation "SD_SONIC" "2"
        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_SONIC" "2"
        let "$p -= 0.234 * floor(8*$p) * dt()"

        // check if there's a platform underneath the player
        attach_to_player 0 20
        unless "brick_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 "up" "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 "(700 + 30 * floor($p)) * player_direction()"
        change_state "stand by"
    }
}

it's basically the same as the spindash though it's pressing the up button. big_smile


Tested it. It works.

XMYouH9.png

Oh wait....

uPfeWfy.png

he he he.... now I remember the problem. I you did the exact same thing I did; and that's what happens when you try to do that just by reversing the control scheme. The player looks like it's belly-flopping in sideways gravity.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org