Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, 7th_zorro, VoroneTZ, Quad), 912 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
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 | chip programmers | 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