Just a question

Non-platform specific questions.

Just a question

Postby akr » Thu Jan 27, 2011 1:05 pm

Why does the following not work when its put into a global code function:

strcpy(someactor.text,"debug output");

or

someactor.textNumber=1000;

Any ideas?

thx
Co-Developer of GE engine

If u are interrested in new features of apple or android ge engines check the engine support website game-editor.net regulary.
akr
 
Posts: 453
Joined: Thu Feb 25, 2010 7:56 pm
Location: Germany, Ulm
Score: 40 Give a positive score

Re: Just a question

Postby Game A Gogo » Thu Jan 27, 2011 1:16 pm

I guess global code gets run before the game starts?
So all actors are reseted afterwards, containing the values you have in the ged
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Just a question

Postby akr » Thu Jan 27, 2011 1:53 pm

I cant get this to work. The global function does nothing but

test()
{
someactor.textNumber=1000;

}

And I call it from another actor's Draw() event. But cant get it to work.


I wanted to have some handy debug printf() functions.
Co-Developer of GE engine

If u are interrested in new features of apple or android ge engines check the engine support website game-editor.net regulary.
akr
 
Posts: 453
Joined: Thu Feb 25, 2010 7:56 pm
Location: Germany, Ulm
Score: 40 Give a positive score

Re: Just a question

Postby Hblade » Thu Jan 27, 2011 1:56 pm

I have also had the same bug, akr.

I'm thinking it's a glitch within the global code it's self. Try looking at the source code of GE and modding it a bit to get it to work.

My theory:
The global code doesnt "get the text actors" of the game. From what I udnerstand, text actors are far different than normal actors right? Just change the code a bit to get it to work with Text actors too.

Theory 2:
Or perhaps, it's a bug within the string handling.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Just a question

Postby Game A Gogo » Thu Jan 27, 2011 3:00 pm

you can always use
Code: Select all
void testf(int num)
{
    sprintf(someactor.text,"%d",num);
}
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Just a question

Postby akr » Thu Jan 27, 2011 5:22 pm

Game A Gogo wrote:you can always use
Code: Select all
void testf(int num)
{
    sprintf(someactor.text,"%d",num);
}

Does not work too.

I tried

strcpy(someactor.text, "Hello");

So how do you debug global code? I want to have some debug printf.
Co-Developer of GE engine

If u are interrested in new features of apple or android ge engines check the engine support website game-editor.net regulary.
akr
 
Posts: 453
Joined: Thu Feb 25, 2010 7:56 pm
Location: Germany, Ulm
Score: 40 Give a positive score

Re: Just a question

Postby Game A Gogo » Thu Jan 27, 2011 5:34 pm

Oh, I didn't test it running on a different actor... here's another way then, I tested it and it works
Code: Select all
void testf(int num)
{
    Actor*tact;
    tact=getclone("someactor");
    tact->textNumber=num;
}

pretty much taking a longer course of action because of the bug...
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Just a question

Postby akr » Thu Jan 27, 2011 6:39 pm

Game A Gogo, thank you very much! This seems to be a great workaround. Will test it soon.
Co-Developer of GE engine

If u are interrested in new features of apple or android ge engines check the engine support website game-editor.net regulary.
akr
 
Posts: 453
Joined: Thu Feb 25, 2010 7:56 pm
Location: Germany, Ulm
Score: 40 Give a positive score

Re: Just a question

Postby Game A Gogo » Thu Jan 27, 2011 6:51 pm

no problem, I'm sure you would of though about it after a while too :)
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Just a question

Postby Hblade » Thu Jan 27, 2011 7:10 pm

Wow, game! Exelent idead dude! :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest