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
Help with collision event script. #208359
05/26/08 21:14
05/26/08 21:14
Joined: Apr 2008
Posts: 10
C
Chavias Offline OP
Newbie
Chavias  Offline OP
Newbie
C

Joined: Apr 2008
Posts: 10
Hi,
The concept is this: I am working on a script that, when the player comes into contact with a certain object, that object is deleted and one point is added to the score.
I have a script so far, that runs fine, but when the player comes into contact with the object, it isnt removed, and is still quite clearly visible. When I run the application, and press F11 twice, I can see that the 'boxes' touch, but the models/objects do not.

Please find below, the script so far:

Code:
function killAndScore(){ 
    my.event = NULL;
    set(my,PASSABLE|INVISIBLE);
    score++;
    wait(1);
    ent_remove(me);
} 

action applyToObject(){ 
    my.emask |= EVENT_IMPACT;
    my.event = killAndScore;
    
} 


If you have any ideas, improvements, suggestions of better working code, it would be greatly appreciated.
PS: I think this has something to do with the Hull (f/n?) Can someone please shed some light on this, thanks.

Re: Help with collision event script. [Re: Chavias] #208477
05/27/08 16:35
05/27/08 16:35
Joined: Feb 2008
Posts: 337
V
Vadim647 Offline
Senior Member
Vadim647  Offline
Senior Member
V

Joined: Feb 2008
Posts: 337
1.
Code:
action score_me()
{
set(my,PASSABLE);
while (vec_dist(player.x,my.x)>32) {wait(1);}
score++;
ent_remove(me);
}

Or in my '3d pacman game' (direct link)
2. This topics doesn't realy belong to contributions.


I switched to other account since marth 2010. Guess which.

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