Code issue...

Game Editor comments and discussion.

Code issue...

Postby Oman » Mon May 07, 2007 12:46 am

can anyone tell me why i get the

Error line 25: expected ;

for this code...

if (shield == 0)
{
CreateTimer("Event Actor", "attack1", 500);
if (pd == 1)
{
ChangeAnimation("Event Actor", "player right attack - 1bp", FORWARD);
attack = 3;
}

else if (pd == 2)
{
ChangeAnimation("Event Actor", "player left attack - 1bp", FORWARD);
attack = 4;
}

else if (pd == 5)
{
ChangeAnimation("Event Actor", "player right swipe - 1bp", FORWARD);
attack = 1;
}

else if (pd == 6)
{
ChangeAnimation("Event Actor", "player left swipe - 1bp", FORWARD)
attack = 2;
}
}

else if (shield == 1)
{
if (pd == 5)
{
ChangeAnimation("Event Actor", "player right shield - 1bp", FORWARD);
}

else if (pd == 6)
{
ChangeAnimation("Event Actor", "player left shield - 1bp", FORWARD);
}
}

thx guyes, i am reallty stumped, this is a big code
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Sgt. Sparky » Mon May 07, 2007 12:51 am

I think you matched all the }'s and {'s
right,
but you do not need else if,
just use if. :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Re: Code issue...

Postby Sgt. Sparky » Mon May 07, 2007 12:52 am

Oman wrote:ChangeAnimation("Event Actor", "player left swipe - 1bp", FORWARD)

AHA!
THERE IS THE ERROR!
:D
there is no ";" :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Oman » Mon May 07, 2007 12:56 am

yay THANK YOU!

A point for you my man
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Oman » Mon May 07, 2007 1:00 am

Why did it give me a problem on error line 25... that was line 24
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Sgt. Sparky » Mon May 07, 2007 1:01 am

Oman wrote:Why did it give me a problem on error line 25... that was line 24

does it still not accept it? :(
EDIT:
that is line 25,
if you are using your code above.(the first one you posted)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Oman » Tue May 08, 2007 12:31 am

Yes it works.. i was just wondering about line 25.
Well thanks i got it to work, and you are correct it is line 25 after i make the changes. :D
"Beyond a wholesome discipline, be gentle with yourself." - Max Ehrmann
User avatar
Oman
 
Posts: 268
Joined: Tue Oct 31, 2006 4:00 am
Location: Somewhere out there...
Score: 6 Give a positive score

Postby Sgt. Sparky » Tue May 08, 2007 12:51 am

:D
I'm glad it works! :)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron