Page 1 of 1
textNumber...problem(possibly resolved)
Posted:
Tue Mar 17, 2009 2:32 pm
by equinox
Hi,
I can not in any way to print the global var int SAVE group POS_VIVO[0]...help me,please?
at.textNumber = POS_VIVO[0];
getclone("at")->textNumber = POS_VIVO[0];
no errror...but not print.
Re: textNumber...problem
Posted:
Tue Mar 17, 2009 3:18 pm
by makslane
if "at" is a text actor, the follow code must works:
- Code: Select all
at.textNumber = POS_VIVO[0];
Re: textNumber...problem
Posted:
Tue Mar 17, 2009 3:38 pm
by equinox
..does not work.
I once again, changing the new actor name... but does not print.
WRITE.textNumber = POS_VIVO[0];<--not print
//==================================
Actor *Item;
if(strcmp(collide.name,"PP") == 0){
//DestroyActor("Collide Actor");
collide.IO_sono = 1;
// facio volare HP guadagnato
Item = CreateActor("VEDO_HP", "icon", "(none)", "(none)", -8, 0, false);
//sprintf(getclone("VEDO_HP")->text,"Tipo-> %s: %d:",collide.DO_TIPO,collide.DO_HP);
sprintf(Item->text,"Tipo-> %s: %d:",collide.DO_TIPO,collide.DO_HP);
if(strcmp(collide.DO_TIPO,"HP +") == 0){
hp += collide.DO_HP;
ATTORE[cloneindex]->HP += collide.DO_HP;
getclone("Z1")->textNumber = collide.IO_sono;// work
WRITE.textNumber = POS_VIVO[0];
//=================
DRAW SCRIPT ACTOR PP
//if(IO_sono == 1 && cloneindex == 0){
if(IO_sono == 1){
DestroyActor("Event Actor");
POS_VIVO[cloneindex] = IO_sono;
//if(POS_VIVO[0] == 1) DestroyActor("Event Actor");
//saveVars("DATI.txt", "DATI");
}
Re: textNumber...problem
Posted:
Wed Mar 18, 2009 12:09 am
by skydereign
I am going to assume your {}s are not off, but the code you show is not balanced. I can't determine what is going wrong from what is given... What you want is to save the variable array, or display it? You wanted to save it on your first post I think. Is there an error, as the variable types could be conflicting? Also are there multiple occurrences of WRITE? And the following is from a collide actor, neh?
WRITE.textNumber = POS_VIVO[0];<--not print
//==================================
Actor *Item;
if(strcmp(collide.name,"PP") == 0){
//DestroyActor("Collide Actor");
collide.IO_sono = 1;
// facio volare HP guadagnato
Item = CreateActor("VEDO_HP", "icon", "(none)", "(none)", -8, 0, false);
//sprintf(getclone("VEDO_HP")->text,"Tipo-> %s: %d:",collide.DO_TIPO,collide.DO_HP);
sprintf(Item->text,"Tipo-> %s: %d:",collide.DO_TIPO,collide.DO_HP);
if(strcmp(collide.DO_TIPO,"HP +") == 0){
hp += collide.DO_HP;
ATTORE[cloneindex]->HP += collide.DO_HP;
getclone("Z1")->textNumber = collide.IO_sono;// work
WRITE.textNumber = POS_VIVO[0];
Re: textNumber...problem
Posted:
Wed Mar 18, 2009 3:08 pm
by equinox
What you want is to save the variable array, or display it?
I want to see on the screen the value and then save it;
And the following is from a collide actor, neh?
Yes.
WRITE.textNumber = POS_VIVO[0];
I have to see him, put this line of code in script DRAW actor.
the only way I see the POS [n].
if I leave in script in collide, i dnot see the POS[N].
Re: textNumber...problem(possibly resolved)
Posted:
Thu Mar 19, 2009 1:02 am
by skydereign
Maybe you got it to work, I am not sure. I don't really see why this is failing, the only reasons I could see that it would not do what you want is if the types conflicted, there is more than one WRITE actor, POS_VIVO[0] is not what you want it to be, or the actor is getting a command to write text, or other. What happens? Does it not show any text?
Re: textNumber...problem(possibly resolved)
Posted:
Thu Mar 19, 2009 12:59 pm
by equinox
there is ONLY 1 actor WRITE.
POS_VIVIO[n] == global,integer, save in DATI
PP == heart actor , 2 actor PP.0,PP.1
IO_sono == actor int
EROE actor collide script(any actor):
if(strcmp(collide.name,"PP") == 0){
collide.IO_sono = collide.cloneindex;
getCloneIdx("WRITE", 0)->textNumber = POS_VIVO[0];<<<<< NOT PRINT...but...
...if this code in DRAW EROE:
EROE actor DRAW:
getCloneIdx("WRITE", 0)->textNumber = POS_VIVO[0];<<<<< PRINT!!!![/color]...WHY?????
PP create:
if(cloneindex == 0){
DO_HP = 10;
strcpy(DO_TIPO,"HP +");
IO_sono = -1;
}else{
if(cloneindex == 1){
DO_HP = 300;
strcpy(DO_TIPO,"HP_MAX +");
IO_sono = -1;
}
}
PP->DRAW
if(IO_sono == cloneindex){// cloneindex == ZERO
DestroyActor("Event Actor");
POS_VIVO[cloneindex] = IO_sono;
}
if(IO_sono == cloneindex){// cloneindex == 1
DestroyActor("Event Actor");
POS_VIVO[cloneindex] = IO_sono;
}
Re: textNumber...problem(possibly resolved)
Posted:
Thu Mar 19, 2009 7:24 pm
by skydereign
Hmm... That is weird. Have you tried eliminating the getCloneIdx? If there is only one WRITE actor this may work...
- Code: Select all
WRITE.textNumber=POS_VIVO[0];
The only reason I can see that it would not work, is if WRITE has text. The text will have priority over textNumber, but that does not explain what is happening for you... Another circumstance that would cause this, is it is not reading this line of code. If the above does not work, then try changing the set to a constant, ie.
- Code: Select all
WRITE.textNumber=3;
Re: textNumber...problem(possibly resolved)
Posted:
Fri Mar 20, 2009 5:07 pm
by equinox
...vereey strange, and certainly this.
yes, I have deleted and remade all, ... but nothing changed. The result is always the same. I hope that does not give problems. Otherwise, write the code for anything.
Tnk1000 for yuor help.