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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 972 guests, and 3 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
question on removing entity #269263
06/02/09 12:56
06/02/09 12:56
Joined: Mar 2009
Posts: 276
Cebu City, Philippines
boyax Offline OP
Member
boyax  Offline OP
Member

Joined: Mar 2009
Posts: 276
Cebu City, Philippines
Hi,

I'm putting many obstacle objects in my game to collect points.
Once the player collides with the obstacle object it will appear some particle effects, then, remove/hide the obstacle object. The obstacle objects have only a single action implemented.

Code:
function HandleEventImpact()
{
	if (event_type == EVENT_IMPACT)
	{		
		ptr_remove(entWaterBottle);
	}
}

action actWaterBottles()
{
	entWaterBottle = my;
	my.emask |= ENABLE_IMPACT;
	my.event = HandleEventImpact;
}


Any idea how i could remove the single entity object?

Thanks

Re: question on removing entity [Re: boyax] #269277
06/02/09 13:43
06/02/09 13:43
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Code:
function HandleEventImpact()
{
	if (event_type == EVENT_IMPACT)
	{		
		my.skill1 = 1;
	}
}

action actWaterBottles()
{
	my.emask |= ENABLE_IMPACT;
	my.event = HandleEventImpact;

	while(my.skill1 == 0) { wait(1); }
	ptr_remove(my);
}


there, that should work.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: question on removing entity [Re: Helghast] #269285
06/02/09 14:30
06/02/09 14:30
Joined: Mar 2009
Posts: 276
Cebu City, Philippines
boyax Offline OP
Member
boyax  Offline OP
Member

Joined: Mar 2009
Posts: 276
Cebu City, Philippines
Thanks for the reply Helghast. smile

I've try your suggestion but not working.. it remove all the obstacle objects even the player doesn't collide. By the way, just a side-note question, I've already assigned the "my" pointer to player. Would it not get conflict re-assigning the "my" pointer to the obstacle object...? Because as you see in the action code for the obstacle object (actWaterBottles) i'm still using the "my" pointer.. confused

Back to my problem... As i've observed, when you add model/object to WED (just the same object you've added for obstacle), WED would name it like XXXX_mdl_0, XXX_mdl_1, etc. (XXX=any file name) but this all objects are pointing to one action in which I enable the EVENT_IMPACT, so, when the player collides with the obstacle object I just remove the specific obstacle object (XXX_mdl_0, XXX_mdl_1, etc.) but i don't know how to remove it one by one for a specific obstacle object?
Using ptr_remove() and ent_remove() will remove all obstacle obect...

One solution approach I can think of, is to separate the obstacle object action but the action code would function the same.. but this isn't a generic solution approach..

Any idea how I could treat it?

Thanks


Last edited by boyax; 06/02/09 14:31.
Re: question on removing entity [Re: boyax] #269293
06/02/09 14:42
06/02/09 14:42
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Instead of using EVENT_IMPACT, use vec_dist. smile

Re: question on removing entity [Re: Cowabanga] #269307
06/02/09 15:50
06/02/09 15:50
Joined: Mar 2009
Posts: 276
Cebu City, Philippines
boyax Offline OP
Member
boyax  Offline OP
Member

Joined: Mar 2009
Posts: 276
Cebu City, Philippines
Why? I think EVENT_IMPACT is working... the only problem I have is how to remove or hide a single obstacle object/entity.

Anyone could advise me. I try to seach in AUM seems can't find any related topic I encountered...so, darn me.. crazy

Thanks

Re: question on removing entity [Re: boyax] #269483
06/03/09 09:16
06/03/09 09:16
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
entWaterBottle is a global entity pointer, every
obstacle pointed by this pointer will be removed.

Try ptr_remove(my) or ent_remove(my).


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