Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, 1 invisible), 19,045 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
detecting checkpoint #223728
08/26/08 09:22
08/26/08 09:22
Joined: Aug 2008
Posts: 11
S
silently99 Offline OP
Newbie
silently99  Offline OP
Newbie
S

Joined: Aug 2008
Posts: 11
Hi guys, im having some problem dealing with detecting checkpoint. I used ENABLE_IMPACT and ENABLE_ENTITY, but the problem is what if i only want the check point to detect the player?

Below is what i did:

function checkpoint1_event(){
add_laps_player();
time_left += 20;
my.flags |= PASSABLE;
wait(1000);
my.flags &= ~PASSABLE;
}

action checkpoint1(){

my.emask |= ENABLE_IMPACT | ENABLE_ENTITY;
my.event = checkpoint1_event;
}

What can i do to prevent the AI car from activating the time extension and increment of lap function?

I tried doing condition

while(player){
...
//activate checkpoint
}

but it doesn't seems to work.
What other methods can i try? Thanks.

Re: detecting checkpoint [Re: silently99] #223730
08/26/08 09:29
08/26/08 09:29
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
check to see if its the player who collided


function checkpoint1_event(){
proc_kill(4);// so that there is only one instance of this function running//

if (you==player)
{
add_laps_player();
time_left += 20;
my.flags |= PASSABLE;
wait(1000);
my.flags &= ~PASSABLE;

}


}

Last edited by badapple; 08/26/08 09:36.
Re: detecting checkpoint [Re: badapple] #223736
08/26/08 09:53
08/26/08 09:53
Joined: Aug 2008
Posts: 11
S
silently99 Offline OP
Newbie
silently99  Offline OP
Newbie
S

Joined: Aug 2008
Posts: 11
Thanks badapple for the fast reply.

There's something wrong still, after trying the solution, the AI cars will just stopped infront of the checkpoint (because it is a little higher on level ground). So i made the check point passable when it detects anything other than the player.

function checkpoint1_event(){
proc_kill(4);// so that there is only one instance of this function running

if (you==player)
{
add_laps_player();
time_left += 20;
my.flags |= PASSABLE;
wait(1000);
my.flags &= ~PASSABLE;
}
else {
my.flags |= PASSABLE;
wait(1);
my.flags &= ~PASSABLE;
}

}

But something is wrong still. One of the AI car will still stop infront of the checkpoint, and the checkpoint does not detect the player anymore.
What are the likely cause of it? Thanks alot for the help!

Re: detecting checkpoint [Re: silently99] #223751
08/26/08 11:49
08/26/08 11:49
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
hmm im not sure , maybe you could post your movement code for the players car and an ai car , this might help us find the solution

but you say ai car stops at checkpoint maybe increase wait time some in your else statement maybe 100 instead of 1 , but really
this doesnt seem to me like the best way for to do your checkpoint maybe try another way

Re: detecting checkpoint [Re: badapple] #223781
08/26/08 17:15
08/26/08 17:15
Joined: Aug 2008
Posts: 11
S
silently99 Offline OP
Newbie
silently99  Offline OP
Newbie
S

Joined: Aug 2008
Posts: 11
mm.. the player car is the car demo codes, whereas the ai car is quite long and messy and linked everywhere. =\ not sure how to paste the whole chunk.

increasing the wait time does helps, but the checkpoint only detects the player occasionally, and sometimes perform time_left +=20; sometimes add_laps_player();
cranky!!

function checkpoint1_event(){
proc_kill(4);// so that there is only one instance of this function running

if (you==player)
{
add_laps_player();
time_left += 20;
my.flags |= PASSABLE;
wait(50);
my.flags &= ~PASSABLE;
}
else {
my.flags |= PASSABLE;
wait(5);
my.flags &= ~PASSABLE;
}

}

What other methods is good for detecting a checkpoint? i tried scan but it scans too many times.. frown

Re: detecting checkpoint [Re: silently99] #223808
08/26/08 19:28
08/26/08 19:28
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
there is car ai racing in the aums that uses laps maybe check into that see how checkpoint is done there , that might help

Re: detecting checkpoint [Re: badapple] #223890
08/27/08 03:48
08/27/08 03:48
Joined: Aug 2008
Posts: 11
S
silently99 Offline OP
Newbie
silently99  Offline OP
Newbie
S

Joined: Aug 2008
Posts: 11
aums? Don't know what's that but will look for it. Thanks badapple!

Re: detecting checkpoint [Re: silently99] #223985
08/27/08 22:03
08/27/08 22:03
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Back from the Conitec/Gamestudio homepage there is a link
to the Acknex Magazine. Thats what Badapple means by "aum's".
Somewhere in there should be a tutorial on how do do approximatly
what you want, or there will probable be a tutorial on how to get
a door to open as a player approches it and that may be modifiable to
be the checkpoint check.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1