textNumber...problem(possibly resolved)

Non-platform specific questions.

textNumber...problem(possibly resolved)

Postby equinox » Tue Mar 17, 2009 2:32 pm

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.
Attachments
Image1.jpg
Last edited by equinox on Wed Mar 18, 2009 7:29 pm, edited 1 time in total.
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: textNumber...problem

Postby makslane » Tue Mar 17, 2009 3:18 pm

if "at" is a text actor, the follow code must works:

Code: Select all
at.textNumber = POS_VIVO[0];
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: textNumber...problem

Postby equinox » Tue Mar 17, 2009 3:38 pm

..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");
}
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: textNumber...problem

Postby skydereign » Wed Mar 18, 2009 12:09 am

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];
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: textNumber...problem

Postby equinox » Wed Mar 18, 2009 3:08 pm

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].
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: textNumber...problem(possibly resolved)

Postby skydereign » Thu Mar 19, 2009 1:02 am

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?
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: textNumber...problem(possibly resolved)

Postby equinox » Thu Mar 19, 2009 12:59 pm

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;
}
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: textNumber...problem(possibly resolved)

Postby skydereign » Thu Mar 19, 2009 7:24 pm

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;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: textNumber...problem(possibly resolved)

Postby equinox » Fri Mar 20, 2009 5:07 pm

...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.
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron