Gamestudio Links
Zorro Links
Newest Posts
Help!
by VoroneTZ. 10/14/25 05:04
Zorro 2.70
by jcl. 10/13/25 09:01
ZorroGPT
by TipmyPip. 10/12/25 13:58
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/11/25 18:45
Reality Check results on my strategy
by dBc. 10/11/25 06:15
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (AndrewAMD, Quad, TipmyPip, 1 invisible), 5,861 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joenxxx, Jota, krishna, DrissB, James168
19170 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Dumb question #426609
07/25/13 19:38
07/25/13 19:38
Joined: Jul 2010
Posts: 283
Germany
J
jenGs Offline OP
Member
jenGs  Offline OP
Member
J

Joined: Jul 2010
Posts: 283
Germany
I am workin with gs since a4 but never got this problem.

I have a block in my level, that got hit 2 times by a ball.
This block has no while loop, because it is passive. The only thing attached is an event_impact event.
Now I want to remove this entity after the second hit (hits are counted in an entSkill. HOW do I do that without letting the engine whine about : invalidCall in event ...

Is it only possible to remove entitys in the "agressor" function.
if yes, this concept is stupid, because my ball entity has a lot of other stuff to do and the event function is very crowded allready.

Re: Dumb question [Re: jenGs] #426610
07/25/13 20:08
07/25/13 20:08
Joined: Jul 2008
Posts: 2,110
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,110
Germany
This should work.
Code:
void _ball_event(){
   my.hits += 1;
   if (my.hits > 2) my.skill2 = 1;   
}
Action ball(){
   my.emask |= ENABLE_BLOCK;
   my.event = _ball_event;
   while (!my.skill2) wait (1);
   wait (1);
   ptr_remove (me);
}

Greets

Last edited by rayp; 07/25/13 20:09.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Dumb question [Re: rayp] #426611
07/25/13 20:13
07/25/13 20:13
Joined: Jul 2010
Posts: 283
Germany
J
jenGs Offline OP
Member
jenGs  Offline OP
Member
J

Joined: Jul 2010
Posts: 283
Germany
Thank you. I just forgot to put in the wait. Thank you for pointing that out. Sometimes I am stuck on the easiest things.

Case closed laugh


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