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
2 registered members (AndrewAMD, TipmyPip), 12,709 guests, and 5 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
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