Gamestudio Links
Zorro Links
Newest Posts
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
1 registered members (AndrewAMD), 1,014 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Problems with entity [Re: TripleX] #117706
03/18/07 18:26
03/18/07 18:26
Joined: Mar 2007
Posts: 27
P
PeterM Offline OP
Newbie
PeterM  Offline OP
Newbie
P

Joined: Mar 2007
Posts: 27
tnx TripleX

Why do i get an error when i want to delete entity? I wanted to remove entity when it touched the ground or another entity...

function hit()
{
if (event_type==event_block || event_type==event_entity)
{
ent_remove(my);

}
}

i did everithing Germanunkol wrote (i just replaced the name event_rock with hit)... but everytime rock hits the ground or another entity msgbox pops up saying "invalid arguments in hit: ent_remove(my)"

And another thing. i got another entity created in the room by pressing c key now when a rock hits the entity i want it to disapere. This is what i did...
I attached an action to it and with my.event=disapear;
called on disapear function. in that function i had
if (event_type==event_entity)
{
ent_remove(my);
}

i think i know why that doesnt work... I read in manual that it senses if entity hits another entity while moving... and my entity isnt moving when it is hit. is that right?

what should i use so it would detect entity hitting it?

Re: Problems with entity [Re: PeterM] #117707
03/18/07 18:58
03/18/07 18:58
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Don't now if it's going to solve your problem but you better add a wait(1); instruction after all of your ent_remove(ent) commands to avoid engine errors/messages

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Problems with entity [Re: frazzle] #117708
03/18/07 19:03
03/18/07 19:03
Joined: Mar 2007
Posts: 27
P
PeterM Offline OP
Newbie
PeterM  Offline OP
Newbie
P

Joined: Mar 2007
Posts: 27
No it didnt solve it tnx any way

Re: Problems with entity [Re: PeterM] #117709
03/18/07 19:05
03/18/07 19:05
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Quote:

No it didnt solve it tnx any way




Hmm, well I knew it probably wouldn't solve it but al least you're save from all those mean nasty engine ent_remove(ent) errors/messages

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Problems with entity [Re: frazzle] #117710
03/19/07 12:24
03/19/07 12:24
Joined: Mar 2007
Posts: 27
P
PeterM Offline OP
Newbie
PeterM  Offline OP
Newbie
P

Joined: Mar 2007
Posts: 27
I still havent solved my problem, any one??

Re: Problems with entity [Re: PeterM] #117711
03/19/07 14:15
03/19/07 14:15
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Add wait(1) before ent_remove should work :

Code:

function removeRock()
{
if (event_type==event_entity)
{
wait(1);
ent_remove(my);
}
}



Also, make sure the rock is moved using c_move function
and enable_entity is turned on :

Code:

action moveRock
{
my.enable_entity = on;
my.event = removeRock;
while(1)
{
c_move(.....);
wait(1);
}
}



If it still doesn't work, post your "rock" action codes here,
otherwise we never know what's your problem.

Re: Problems with entity [Re: vlau] #117712
03/20/07 11:55
03/20/07 11:55
Joined: Aug 2006
Posts: 128
Papua New Guinea
I
Impaler Offline
Member
Impaler  Offline
Member
I

Joined: Aug 2006
Posts: 128
Papua New Guinea
Of course ent_remove is going to cause an error if while(1) is set!
change while(1) to while(my)!


Murphey's Law:
<< if anything can go wrong, it will >>

(Murphey was an optimist).
Re: Problems with entity [Re: Impaler] #117713
03/20/07 17:07
03/20/07 17:07
Joined: Mar 2007
Posts: 27
P
PeterM Offline OP
Newbie
PeterM  Offline OP
Newbie
P

Joined: Mar 2007
Posts: 27
Vlau it worked i had wait(1) after ent_remove. thats why it didnt know.

I Got a new question now.
I created a new entity named snowman... He has no action yet becouse i dont know how to do this:
i want that snowman disaperes when he gets hit (or loses health or something else, it doesnt matter). i dont want whole code i just want to know what function should i use for detecting if he was hit by a rock... i cant use event_entity becouse he isnt moving. he is a static target.

Please help and tnx for your help so far.

Re: Problems with entity [Re: PeterM] #117714
03/20/07 17:34
03/20/07 17:34
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
You always need an action to control, testing
entity movement, collision. To detect an entity
hit by another objects without event_entity,
event_impact or whatever, you may try trace_hit :

Code:

action snowMan
{
while(my != NULL)
{
c_move(...); // it's a must
if (trace_hit)
{
wait(1);
ent_remove(my);
}
wait(1);
}
}



By the way, you have to add some "ignore_" options in c_move
if the snowman is on the ground for example.

Hope this help!

Last edited by vlau; 03/20/07 18:12.
Re: Problems with entity [Re: vlau] #117715
03/20/07 19:29
03/20/07 19:29
Joined: Mar 2007
Posts: 27
P
PeterM Offline OP
Newbie
PeterM  Offline OP
Newbie
P

Joined: Mar 2007
Posts: 27
Ok works tnx.

Last edited by PeterM; 03/20/07 19:33.
Page 2 of 2 1 2

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