Help with my game

Game Editor comments and discussion.

Help with my game

Postby Astro Lemur » Fri Aug 10, 2007 10:22 pm

Sorry about the subject title.

In my game i want the charecter to be able to pick up and carry objects like rocks, but my code isnt working for me. I want the player to pick up the rock, and be able to set it down when there in the "base" region. Heres the code i have:

if (canpick == 1);
{
ChangeParent("Event Actor", "player");
MoveTo("Event Actor", 0.000000, -5.000000, 9999.000000, "player");
ChangeAnimation("player", "GuyCarry", FORWARD);
carry = 1;
}

if (canpick == 1 && incamp == 1);
{
MoveTo("Event Actor", 20.000000, 20.000000, 10.000000, "camp_region");
canpick=0;
}


Thanks!
User avatar
Astro Lemur
 
Posts: 12
Joined: Sun Mar 25, 2007 4:05 pm
Location: Port Townsend, WA
Score: 1 Give a positive score

Postby DilloDude » Fri Aug 10, 2007 11:14 pm

What is it doing?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby pixelpoop » Sat Aug 11, 2007 1:22 am

don't use a ";" until after the stuff in the if statement.

if (canpick == 1);
should be
if (canpick == 1)

I don't know if that will solve your problem but it is a start.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

Postby Astro Lemur » Sat Aug 11, 2007 4:01 am

Thanks pixelpoop, it worked!
User avatar
Astro Lemur
 
Posts: 12
Joined: Sun Mar 25, 2007 4:05 pm
Location: Port Townsend, WA
Score: 1 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron