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,111 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
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