Page 1 of 1
Collision problem

Posted:
Sat Apr 28, 2018 1:34 pm
by Kcee
What code should I use to change a variable to 0(false) if two actors are not in collision?
Re: Collision problem

Posted:
Sat Apr 28, 2018 8:15 pm
by Kcee
Please I really need a reply, I tried using CollisionFree but I don't know much about it.
Re: Collision problem

Posted:
Sun Apr 29, 2018 7:07 pm
by Ehman
KCEE PLS. CAN YOU NARRATE YOUR PROBLEM IN A SIMPLER XPRESION
Re: Collision problem

Posted:
Sun Apr 29, 2018 7:23 pm
by Kcee
Something like: If player actor is not colliding with car actor, touching car=0; Are you familiar with GE?
Re: Collision problem

Posted:
Mon Apr 30, 2018 7:01 am
by lcl
Player -> Create Actor -> Script Editor:
- Code: Select all
touching_car = 0;
Player -> Collision any side of Car -> Script Editor:
- Code: Select all
touching_car = 1;
Player -> Collision Finish with Car -> Script Editor:
- Code: Select all
touching_car = 0;
Re: Collision problem

Posted:
Mon Apr 30, 2018 7:04 am
by Kcee
Thanks lcl, I owe you one.
Re: Collision problem

Posted:
Mon Apr 30, 2018 8:08 am
by Kcee
Quick questions: What kind of code should put in draw actor and create actor? And isn't 0 the default number assigned to user variables?
Re: Collision problem

Posted:
Mon Apr 30, 2018 11:23 am
by lcl
Draw Actor event occurs when the actor is drawn, i.e. every frame of the game. Gravity code is an example of what should be put to this event.
Create Actor event occurs when the actor is created. This means either when the game starts and the actor is created, or when using Create Actor action to create the actor. Notice that Create Actor event and Create Actor action are different things. The latter one creates actors, while the first is an actor's event that takes place upon the creation of the actor. An example of the usage of the Create Actor event could be setting the xvelocity of a bullet actor.
Yes, global variables and actor variables are automatically initialized to zero. But remember that it doesn't apply to local variables, i.e. variables created inside an event or a function through code.
Re: Collision problem

Posted:
Mon Apr 30, 2018 11:44 am
by Kcee
Thanks a lot!
Re: Collision problem

Posted:
Tue May 01, 2018 6:44 am
by Ehman
Kcee wrote:Something like: If player actor is not colliding with car actor, touching car=0; Are you familiar with GE?
uhmmm. Just a little bit but it's not like I can't create games on game editor

Re: Collision problem

Posted:
Tue May 01, 2018 6:46 am
by Ehman
Did anyone know the kinda programming Language script editor Uses
But I heard somewhere that it is C Language.

Re: Collision problem

Posted:
Tue May 01, 2018 9:05 am
by lcl
Ehman wrote:Did anyone know the kinda programming Language script editor Uses
But I heard somewhere that it is C Language.

Yes, Game Editor uses C.
Re: Collision problem

Posted:
Fri May 04, 2018 3:17 pm
by Ehman
THANKS LCL