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 (TipmyPip, AndrewAMD), 12,726 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
Need some help with Collision event! #316537
03/24/10 18:34
03/24/10 18:34
Joined: Feb 2008
Posts: 27
kentucky
S
SpearBang Offline OP
Newbie
SpearBang  Offline OP
Newbie
S

Joined: Feb 2008
Posts: 27
kentucky
I'm just trying to trigger an function with an action assigned to the entity that gets hit by the player. and add +10 to the score this is what i have come up with on help doc and it still not working in any scene of the word.

function hit_star()
{

if (event_type == EVENT_ENTITY) // the Player has collided with one of the entities in the level?
{
ptr_remove(me); // disappear when hit
score += 10;
}
}

action pick_up_star()
{
my.emask |= ENABLE_ENTITY; // make entity sensitive for entity collision
my.event = hit_star();

}

Re: Need some help with Collision event! [Re: SpearBang] #316541
03/24/10 19:03
03/24/10 19:03
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
remove the ()

Re: Need some help with Collision event! [Re: Rei_Ayanami] #316546
03/24/10 19:27
03/24/10 19:27
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
To add to Rei_Ayanimi's post, he means change...
Code:
my.event = hit_star();


to...
Code:
my.event = hit_star;


This is because the event is a function pointer. Adding the parenthesis means it would assign the return value of the function, and not the actual function itself.

Last edited by DJBMASTER; 03/24/10 19:27.
Re: Need some help with Collision event! [Re: DJBMASTER] #316559
03/24/10 21:39
03/24/10 21:39
Joined: Feb 2008
Posts: 27
kentucky
S
SpearBang Offline OP
Newbie
SpearBang  Offline OP
Newbie
S

Joined: Feb 2008
Posts: 27
kentucky
I tryed this but still the player walks and hits the entity and nothing happens and the panels digits are still saying 0 i am useing Intense X copper but still.


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