Page 1 of 1

Following an actor (Catterpillar Script)

PostPosted: Tue Mar 20, 2007 6:47 pm
by Hblade
This is a catterpillar script, the download is in my second message

PostPosted: Tue Mar 20, 2007 6:51 pm
by UltimatHedgehog
im the only one to download :(

PostPosted: Tue Mar 20, 2007 6:55 pm
by UltimatHedgehog
it doesnt work the data folder is empty

PostPosted: Tue Mar 20, 2007 7:18 pm
by makslane
Please, upload the data files and a screenshot.

Sorry about that, guys. Here is the demo.

PostPosted: Tue Mar 20, 2007 8:08 pm
by Hblade
Sorry about that, guys, here is the demo.

PostPosted: Tue Mar 20, 2007 9:10 pm
by Sgt. Sparky
any pictures on Hblade the game? :D

PostPosted: Tue Mar 20, 2007 9:18 pm
by UltimatHedgehog
follow me, set me free, trust me and we will escape from the city

thats a sonic song :D um....good job could you say what part of the script makes him follow

Yeah.

PostPosted: Wed Mar 21, 2007 2:16 am
by Hblade
Yeah, it's from a game called sonic for the gamecube.

Herer it is.

PostPosted: Wed Mar 21, 2007 2:20 am
by Hblade
Here's the code
Code: Select all
char *key=GetKeyState();

if (key[KEY_UP] == 1 && key[KEY_DOWN] == 0)
{
    ChangeAnimation("Event Actor", "U............", FORWARD);
}
if (key[KEY_RIGHT] == 1 && key[KEY_LEFT] == 0)
{
    ChangeAnimation("Event Actor", "Wingingiliki", FORWARD);
}
if (key[KEY_RIGHT] == 1 && key[KEY_LEFT] == 0 && key[KEY_UP] == 1)
{
    ChangeAnimation("Event Actor", "U............", FORWARD);
}
if (key[KEY_DOWN] == 1 && key[KEY_UP] == 0)
{
    ChangeAnimation("Event Actor", "WINGIHIIIIIIII.", FORWARD);
}
if (key[KEY_DOWN] == 1 && key[KEY_UP] == 0 &&  key[KEY_RIGHT] == 1)
{
    ChangeAnimation("Event Actor", "Wingingiliki", FORWARD);
}
if (key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 0)
{
    ChangeAnimation("WNRIHIHIHIHIHIHIHIHI", "RINGIHIHIHIHIHIHIHIHI.", FORWARD);
}
if (key[KEY_RIGHT] == 1 && key[KEY_LEFT] == 0 && key[KEY_UP] == 1)
{
    ChangeAnimation("Event Actor", "U............", FORWARD);
}
if (key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 0 && key[KEY_UP] == 1)
{
    ChangeAnimation("Event Actor", "U............", FORWARD);
}
if (key[KEY_RIGHT] == 1 && key[KEY_LEFT] == 1)
{
    ChangeAnimation("Event Actor", "RINGIHIHIHIHIHIHIHIHI.", FORWARD);
}

Then when the actor following you collides with a side of the player just have it change his animation

PostPosted: Wed Mar 21, 2007 2:38 am
by Caaz Games
:shock: :shock: :shock: :shock: :shock: :shock: Thats a biiiig code!!! :shock: :shock: :shock: :shock: :shock:

PostPosted: Wed Mar 21, 2007 9:08 am
by UltimatHedgehog
can you replace the weird names with up down right and left walk so i know what to put

PostPosted: Wed Mar 21, 2007 8:20 pm
by Sgt. Sparky
I got a bigger
Code: Select all
char*key=GetKeyState();
yvelocity += 1;
if(SLASH == 0)
{
if(key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 0)
{
    gs = 0;
    if(j == 0)x -= 5;
    if(j == 1 && xvelocity > - 5 && hw == 0)xvelocity -= 1;
    if(af == 1 && key[KEY_DOWN] == 0 && j == 0)
    {
        ChangeAnimation("Event Actor", "WL", FORWARD);
        af = 0;
    }
    if(af == 1 && key[KEY_DOWN] == 0 && j == 1)
    {
        ChangeAnimation("Event Actor", "JL", FORWARD);
        af = 0;
    }
    if(af == 1 && key[KEY_DOWN] == 1 && j == 0)
    {
        ChangeAnimation("Event Actor", "CL", FORWARD);
        af = 0;
    }
}
if(key[KEY_LEFT] == 0 && key[KEY_RIGHT] == 1)
{
    gs = 1;
    if(j == 0)x += 5;
    if(j == 1 && xvelocity < 5 && hw == 0)xvelocity += 1;
    if(af == 1 && key[KEY_DOWN] == 0 && j == 0)
    {
        ChangeAnimation("Event Actor", "WR", FORWARD);
        af = 0;
    }
    if(af == 1 && key[KEY_DOWN] == 0 && j == 1)
    {
        ChangeAnimation("Event Actor", "JR", FORWARD);
        af = 0;
    }
    if(af == 1 && key[KEY_DOWN] == 1 && j == 0)
    {
        ChangeAnimation("Event Actor", "CR", FORWARD);
        af = 0;
    }
}
}
if(key[KEY_UP] == 1 && j == 0 && SLASH < 2)
{
    if(gs == 0)ChangeAnimation("Event Actor", "JL", FORWARD);
    if(gs == 1)ChangeAnimation("Event Actor", "JR", FORWARD);
   PlaySound2("data/jump2.wav", 0.555556, 1, 0.000000);
    yvelocity = - 15;
    j = 1;
}
if(key[KEY_SPACE] == 1 && SLASH == 0 && j == 0)
{
    PlaySound2("data/Swipe1.wav", 0.211111, 1, 0.000000);
    if(gs == 0)ChangeAnimation("Event Actor", "SLL", FORWARD);
    if(gs == 1)ChangeAnimation("Event Actor", "SLR", FORWARD);
    SLASH = 1;
}
if(key[KEY_SPACE] == 1 && SLASH == 0 && j == 1)
{
    PlaySound2("data/Swipe1.wav", 0.211111, 1, 0.000000);
    if(gs == 0)ChangeAnimation("Event Actor", "!JLSpiral", FORWARD);
    if(gs == 1)ChangeAnimation("Event Actor", "!JRSpiral", FORWARD);
    SLASH = 1;
}
if(SLASH == 2 && animpos > 3)
{
    if(gs == 0)ChangeAnimation("Event Actor", "SL", FORWARD);
    if(gs == 1)ChangeAnimation("Event Actor", "SR", FORWARD);
    SLASH = 0;
}
if(yvelocity > 4)j = 1;
if(yvelocity < -3)j = 1;
if(Health <= 0)
{
    Life_Count -= 1;
    PlaySound2("data/click.wav", 0.255556, 4, 0.066667);
    x = Spawnpoint.x;
    y = Spawnpoint.y;
    Health = 18;
    CreateActor("effect1", "Effect2", "(none)", "(none)", 0, 0, false);
}
if(Life_Count < 0)
{
 directional_velocity = 0;
 SLASH = -1;
 transp = .999;
 ChangeAnimationDirection("Event Actor", STOPPED);
}
if(sentryCount.textNumber == 0)
{
    if(distance(xscreen, yscreen, portal.xscreen, portal.yscreen) < 400)
    {
        if(yscreen < portal.yscreen)yvelocity += 1;
        if(yscreen > portal.yscreen)yvelocity -= 2;
        if(xscreen > portal.xscreen)xvelocity -= 1;
        if(xscreen < portal.xscreen)xvelocity += 1;
    }
}
if(key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 1)
{
    if(gs == 1 && af == 1)
    {
        ChangeAnimation("Event Actor", "SR", FORWARD);
    }
    if(gs == 0 && af == 1)
    {
        ChangeAnimation("Event Actor", "SL", FORWARD);
    }
}

XD that is only the half that is in use in my SamuraiDude game :D
the other half will be added with a character change,
will be added maybe today or tomarrow! :D
(look at the post for more info in game development under: SamuraiDude[testers])

PostPosted: Wed Mar 21, 2007 8:23 pm
by Sgt. Sparky
oh, most of the code is ineffective without the many other coded actors :D

Woah.

PostPosted: Thu Mar 22, 2007 4:31 pm
by Hblade
Woah. Dude, whats awesome. That is alot of code.

PostPosted: Thu Mar 22, 2007 4:37 pm
by Sgt. Sparky
yeah, but its not about how much cod you use, its about how well it functions.
sometimes to make a perfectly functional code it takes alot of code. :D
if you look through my code how the keys interact it allows you to do a special attack in the currently out version. :D
all you do is press the left arrow then the right arrow then the up arrow really fast :D
it makes him slash both ways with a slight circle of his tail around him :D
(he also gets blury)
EDIT: tail is with the second character, for the other one its a sword :D