collide.MY new problem.(RESOLVED)

Non-platform specific questions.

Re: collide.MY new problem.

Postby equinox » Sat Mar 28, 2009 10:36 pm

There is 2 Actor--> HERO.0 - HERO.1
ATTORE[0] = create HERO.O
ATTORE[1] = create HERO.1

there is 1 Actor ENEMY.0
ENEMY script-->collide any actor:

if(strcmp(collide.name,ATTORE[0].name) == 0)<--- error !!

if(strcmp(collide.name,ATTORE[0]->name) == 0){<---work...but collide with any ATTORE[0] and ATTORE[1], but i want it to collide only with ATTORE[0]<--(HERO.O) and not collide with HERO.1...n
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: collide.MY new problem.

Postby skydereign » Sat Mar 28, 2009 10:41 pm

Okay, that is what you want. It is doing exactly as you are telling it as both have the same name. Change name to clonename, because they have different clonenames this will work.
Code: Select all
if(strcmp(collide.clonename,ATTORE[0]->clonename) == 0){

Clonename uses the cloneindex and the name.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: collide.MY new problem.(RESOLVED)

Postby equinox » Sun Mar 29, 2009 10:43 am

Perfect !!!!

Tnk1000 for the nuovo help me.

In the meantime, I tried this solution:

if(strcmp(collide.name,"EROE_1") == 0){
if(collide.cloneindex == 0 && ContITEM < MAXITEM){...but

...if(strcmp(collide.clonename,ATTORE[0]->clonename) == 0){<--- i prefer this. :o)
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron