String

Game Editor comments and discussion.

String

Postby ingsan » Fri Jun 11, 2004 4:32 pm

:oops: I have a little string problem :oops:

On runtime (on CreateEvent on any actor), I have a string called Stop.
On Collision of Follow_mouse (actor that follows mouse) with actor L_screen, I have string named Left.
On Collision Finish, Script :
    !Left;
On Collision of Follow_mouse (actor that follows mouse) with actor R_screen, I have string named Right.
On Collsion Finish, Script :
    !Right;
Then, on any actor :
    if ( Stop ) view.x = view.x ;
    if ( Left ) view.x --;
    if ( Right ) view.x ++;


Aim : When I place mouse on L_screen, the view moves right. When I place mouse on R_screen, the view moves left.

But I can get no success :cry:
And when I remove this line from my code if ( Stop ) view.x = view.x ; the view moves Right, as if it was reading this first line if ( Left ) view.x --; without considering my collision conditions :?

Could someone help me ? Please ? :(
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby jazz_e_bob » Fri Jun 11, 2004 8:06 pm

I want to help, but first, some questions:

There is some C shorthand here:

if ( Stop ) view.x = view.x ;

Is this the same as if ( Stop == 1 ) view.x = view.x ; ?

Also:

!Left;

What does this do?

A.

Image
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ingsan » Fri Jun 11, 2004 9:00 pm

Hi Jazz, how are you my friend ? :P

It's the first time I'm using Strings, following the precious advice you gave me in this post :
http://www.game-editor.com/forum/viewtopic.php?t=326 and maybe I'm not totally right with the code I wrote.

For me, a string is like an integer variable, but you do not have to put "==1" to call it.
For string Stop, it's just the same as int Stop == 1;

And !Left, does this not mean "Different from Left" ?

See you very soon 8)
I.
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby jazz_e_bob » Sat Jun 12, 2004 4:28 am

I made a demo. No strings attached.

http://www.maybanana.com/pantzboi/game_editor/screenscroller.zip

Image

Also see:

http://www.iota-six.co.uk/c/g4_strcpy_strncpy_strcmp.asp

For more stuff on how to use strings. You cannot treat them like integers.
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ingsan » Sun Jun 13, 2004 11:55 am

This site is so cool ! I'm learning new things :oops: Thanks, man :wink:
I got to tell you also how amazing you are when you come out with so clear solutions concerning EVERYTHING ! I'm talking of the little tutorial you post. Sometimes I tell myself that I should STOP thinking too much and look just beneath my nose to see the solution that is right in front of me :oops:
Hey, I forgot to tell you that MicroFooty is back in the move ... :wink: So see you very soon !!!

I.
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby jazz_e_bob » Sun Jun 13, 2004 12:06 pm

I have been doing work on microFooty AI system. A bit tricky but I am getting good results. I am SO happy with the graphics so far. :-)

The new GE has been brilliant too. Not a single crash since I have been using it. Nice and stable. Love it!

I hope you are well. xxx ooo

A.
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby makslane » Sun Jun 13, 2004 7:11 pm

When the microFooty will be published? :D
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jazz_e_bob » Sun Jun 13, 2004 9:38 pm

Hmmm

Couple of months perhaps. ( Depends on how much time I can spend coding. :wink: )

:)

Image

Image
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby makslane » Mon Jun 14, 2004 12:56 pm

good
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron