Setting Animation for Actor(Experimenting with State Method)

Non-platform specific questions.

Re: Setting Animation for Actor(Experimenting with State Met

Postby Turon » Tue Jun 10, 2014 2:31 pm

This is all getting very complicated....
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: Setting Animation for Actor(Experimenting with State Met

Postby lcl » Tue Jun 10, 2014 2:59 pm

Turon wrote:This is all getting very complicated....

Well, it seemed all good at the point where your only problem was the shooting thing.
From that point on you made something weird because now the whole movement system has stopped working?
What if you take the ged in where the only problem was shooting and try to continue working on that instead of the one with everything broken?
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Setting Animation for Actor(Experimenting with State Met

Postby Turon » Sat Jun 14, 2014 11:04 am

I think the confusion may have come because I changed to logic to work like "<>" instead of "><",
Here is my animation values:
PlayerStillLeft 0
PlayerStillRight 1
PlayerMoveLeft 2
PlayerMoveRight 3
PlayerJumpLeft 4
PlayerJumpRight 5
PlayerShootLeft 6
PlayerShootRight 7
In my logic points outward like so "<>".
so I tried to modify the code to suit this set of values but I got the same mess as the one where I was using "define".

-Edit- 20/5/2015
To this day animation setting remains a major issue in my projects...
-Edit- 1/11/2015
I have overcome these problems with better code! :D
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: Setting Animation for Actor(Experimenting with State Met

Postby Turon » Mon Aug 01, 2016 7:19 pm

Turon wrote:-Edit- 1/11/2015
I have overcome these problems with better code! :D

what better code? hmm I wish I were more specific. Now that I'm writing this, Say Lcl, Dimension 55355 was your most recent platformer, it didn't use state method did it? Do you know of any .ged where State Method was used?

I suppose it's promising I now kinda get this one post:
Hares wrote:
Turon wrote:What do you mean by 2 else and 1 if?

Your code is like this:
if (check some thing)
{
do some thing;
}
else
{
do some thing else;
}
else
{
do some thing else (again :?: );
}

}

It is the red part that makes your code unacceptable.

Turon wrote:Sorry to confuse you but my code had a typo so I typed "IF Z IS PRESSED AND X" which was meant to be "IF Z IS PRESSED AND NOT X"

I modified that in the code below.
So I suggest you copy the code below here (push the select all button)
Then in your .ged you erase your code, and replace it by the one you copied.
See if it gets accepted.
If (so)
{
figure out what is different from your code, and try to understand it;
}
else
{
report back here;
and we try to help you figure it out;
}
else
{
forget about the second else ...
}

}
:)


Code: Select all
char* key = GetKeyState();
if (key[KEY_RIGHT] == 1 && key[KEY_LEFT] == 0)
{
    // IF KEY RIGHT IS PRESSED AND NOT LEFT
    if(key[KEY_x]==1)
    // AND THEN IF X IS ALSO PRESSED
    {
        ChangeAnimation("Event Actor", "PlayerJumpRight", NO_CHANGE);
    }
    if (key[KEY_z]==1 && key[KEY_x]!=1)
    {
        //IF Z IS PRESSED AND NOT X
        ChangeAnimation("Event Actor", "PlayerShootRight", NO_CHANGE);
    }
    if (key[KEY_x]!=1)
    {
        // BUT IF X ISN'T PRESSED
        x+=3;
        ChangeAnimation("Event Actor", "PlayerMoveRight", NO_CHANGE);
    }
}

if (key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 0)
{
    // IF KEY LEFT IS PRESSED AND NOT RIGHT
    if(key[KEY_x]==1 && key[KEY_z]==1)
    {
       // AND THEN IF X IS ALSO PRESSED
       ChangeAnimation("Event Actor", "PlayerJumpLeft", NO_CHANGE);
    }
    if (key[KEY_z]==1 && key[KEY_x]!=1)
    {
        // IF Z IS PRESSED AND NOT X
        ChangeAnimation("Event Actor", "PlayerShootLeft", NO_CHANGE);
    }
    if (key[KEY_x]!=1)
    {
        // BUT IF X ISN'T PRESSED
        x-=3;
        ChangeAnimation("Event Actor", "PlayerMoveLeft", NO_CHANGE);
    }
 }
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron