Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, kzhao), 1,354 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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