Page 1 of 2

Event disable

PostPosted: Fri Jan 11, 2008 3:45 pm
by Azou
Hi!! I wanted to ask a question:how to make that even if we put the event disable action,we will be just be able to walk,not else,not more?? :D

Re: Event disable

PostPosted: Fri Jan 11, 2008 3:49 pm
by Kalladdolf
event disable means:
the event won't work on the actor anymore.
if you make:
event disable -> key down,

the actor will ignore all the buttons you press.

Re: Event disable

PostPosted: Fri Jan 11, 2008 5:45 pm
by Troodon
But you can use a canWalk variable just like the famous canJump. :D

Re: Event disable

PostPosted: Fri Jan 11, 2008 8:34 pm
by Azou
So i wil do:
canWalk=1;
x = x + 3;

Re: Event disable

PostPosted: Fri Jan 11, 2008 9:51 pm
by Kalladdolf
if you want to make the action dependent on the variable, make the code:
Code: Select all
if(canwalk ==1)
{x +=3;}

Re: Event disable

PostPosted: Sat Jan 12, 2008 8:45 am
by Bee-Ant
This is the friendly code
Code: Select all
if(canwalk==1)
{
    if(right==1)
    {
        x+=3;
    }
    if(right==0)
    {
        x-=3;
    }
}

Re: Event disable

PostPosted: Sat Jan 12, 2008 9:37 am
by Azou
Thanx,Kalladdolf and Bee-Ant!! :D
:mrgreen:

Re: Event disable

PostPosted: Sat Jan 12, 2008 9:41 am
by Bee-Ant
:mrgreen:

Re: Event disable

PostPosted: Sat Jan 12, 2008 9:51 am
by Troodon
What about me?? :(

:lol: Ok, Bee-Ant code was 11 lines. This makes the same thing but is only 2 lines. :D

Code: Select all
if(canwalk==1 && right ==1) { x+=3; }
if(canwalk==1 && right ==0) { x-=3; }


8)

Re: Event disable

PostPosted: Sat Jan 12, 2008 9:57 am
by Bee-Ant
just 1 line
Code: Select all
if(canwalk==1&&right ==1){x+=3;}if(canwalk==1&&right==0){x-=3;}

Re: Event disable

PostPosted: Sat Jan 12, 2008 10:09 am
by Troodon
That was 62 symbols. Here is 61 symbols.
if(canwalk==1&&right==1){x+=3;}if(canwalk==1&&right==0){x-=3;}
Or make the actor feel himself more free by changing the variable name to can.
if(can==1&&right==1){x+=3;}if(can==1&&right==0){x-=3;}
Only 48 symbols. :lol:

Re: Event disable

PostPosted: Sat Jan 12, 2008 10:27 am
by Bee-Ant
42 symbols... :P
Code: Select all
if(c==1&&r==1){x+=3;}if(c==1&&r==0){x-=3;}

Re: Event disable

PostPosted: Sat Jan 12, 2008 10:43 am
by Troodon
But GE doesn't allow just c as variable name doesn't it?
But check this:

if(can==1){x+=3;}if(can==-1){x-=3;}
32 symbols

We don't count draw actor code doesn't we? :lol:

Ok, I guess the codes in the up are more usefull for Azou. :lol: So let's stop this competition. :lol:

Re: Event disable

PostPosted: Sat Jan 12, 2008 10:45 am
by Bee-Ant
ah...I lose :cry: :P

Re: Event disable

PostPosted: Sat Jan 12, 2008 6:07 pm
by Azou
tekdino wrote:What about me?? :(

:lol: Ok, Bee-Ant code was 11 lines. This makes the same thing but is only 2 lines. :D

Code: Select all
if(canwalk==1 && right ==1) { x+=3; }
if(canwalk==1 && right ==0) { x-=3; }


8)

OOPPSSS :oops:
Sorry,my Coach!! I forgot you :oops:
Do you forgive me? :P