Gamestudio Links
Zorro Links
Newest Posts
Bug in train mode, or it seem to me
by jcl. 09/22/26 14:47
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 09/22/26 12:21
Capital slider is not saving in Z12
by Petra. 09/22/26 06:49
Parent/child object
by VoroneTZ. 09/22/26 05:52
Zorro tutorial ideas?
by AndrewAMD. 09/21/26 14:50
Trades during a running bar
by Martin_HH. 09/21/26 12:03
Avoiding pop-up training parameter results
by Martin_HH. 09/16/26 21:31
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 1,180 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Opus, Jubilee, lopezsergio07, mistery, lokkalyansamiti
19239 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Collision pickup event #316615
03/25/10 16:13
03/25/10 16:13
Joined: Feb 2008
Posts: 27
kentucky
S
SpearBang Offline OP
Newbie
SpearBang  Offline OP
Newbie
S

Joined: Feb 2008
Posts: 27
kentucky

What code should I use to make an pickup object “when player hit obj, obj is removed and score is +10”
I have tried this found in the Help content
function bounce_event()
{
if (event_type == EVENT_IMPACT)
{
ent_playsound(my,explode,50);
ptr_remove(me); // disappear when hit
}
}

action exploding_barrel()
{
my.ENABLE_IMPACT = ON; // sensible for push collision
my.emask |= ENABLE_IMPACT;
my.event = bounce_event;
...
}
but nothing happened and tired other ways but still no luck. Do they need to both be in void main if so they crash when its ran.

Re: Collision pickup event [Re: SpearBang] #316618
03/25/10 16:44
03/25/10 16:44
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
You have to apply the action to an entity, that one that you want to be picked up.
You can hit F11 twice when running the level to see the collision boxes of player and entity and whether they actually touch each other.

There's been a thread about this some time ago in the beginners(Starting with GameStudio) forum, but it was in German.
Maybe, you can understand at least the code.

Re: Collision pickup event [Re: Pappenheimer] #316703
03/25/10 22:55
03/25/10 22:55
Joined: Feb 2008
Posts: 27
kentucky
S
SpearBang Offline OP
Newbie
SpearBang  Offline OP
Newbie
S

Joined: Feb 2008
Posts: 27
kentucky
Thank you that is what it was was the bbox my object did not have one. Any how thank you agine for you time.


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