Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> GM7 coding help
United States
Weston404
Posted: Jun 5 2009, 05:07 AM
Quote Post


Cool beans
[*]

Group Icon
Group: Members
Posts: 956
Member No.: 3784
Joined: 19-May 07

Status: (0d) [--]


___________________________________________
FATAL ERROR in
action number 4
of Draw Event
for object obj_camera:

COMPILATION ERROR in code action
Error in code at line 25:
and if global.rankscore > 201

at position 6: Unexpected symbol in expression.

Okay, if you've been keeping updated with my game, I'm adding ranks. I am having issues with this.

It says there is an unexpected symbol here, but I see nothing wrong with the code. Do you...?


--------------------
user posted image
If a pokemon breaks it's legs, does that mean it can't sleep?
PMEmail PosterAOL
Top
Unspecified
Miaxis
Posted: Jun 5 2009, 05:31 AM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


Remove the "if". When using and/or conditions, you don't need to put ifs.


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
United States
Doodle
Posted: Jun 5 2009, 05:38 AM
Quote Post


D:
[*]

Group Icon
Group: Members
Posts: 635
Member No.: 4862
Joined: 23-December 07

Status: (0d) [--]


Oh, yeah.
Take out "if."
You can have if, and, or, etc. back to back like that.


--------------------
user posted image
PMEmail PosterAOLYahoo
Top
United States
OniLink10
Posted: Jun 5 2009, 05:43 AM
Quote Post


C++ Programmer, Unofficial Physicist, and Unofficial Chemist
[*][*]

Group Icon
Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08

Status: (0d) [--]


And don't forget to use proper Parenthesis to ensure that everything works right!


--------------------
QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM)
did you try hello's engine

make sure to not ****ing change anything before using it!
PMEmail PosterUsers WebsiteYahoo
Top
United States
Weston404
Posted: Jun 5 2009, 05:13 PM
Quote Post


Cool beans
[*]

Group Icon
Group: Members
Posts: 956
Member No.: 3784
Joined: 19-May 07

Status: (0d) [--]


I'm still getting errors...

CODE

___________________________________________
FATAL ERROR in
action number 8
of Draw Event
for object obj_camera:

COMPILATION ERROR in code action
Error in code at line 26:
  if global.rankscore > 201

at position 2: Unexpected symbol in expression.


The full code is:
CODE
//Rank box
draw_sprite_ext(spr_rankbox,-1,view_xview[0]+147,view_yview[0]+2,1,1,0,c_white,0.7)
if global.rankscore > 100
draw_sprite_ext(spr_rank,0,view_xview[0]+152,view_yview[0]+7,1,1,0,c_white,0.7)
if global.rankscore < 100
and global.rankscore > 201
draw_sprite_ext(spr_rank,1,view_xview[0]+152,view_yview[0]+7,1,1,0,c_white,0.7)
if global.rankscore < 200
and global.rankscore > 301
draw_sprite_ext(spr_rank,2,view_xview[0]+152,view_yview[0]+7,1,1,0,c_white,0.7)
if global.rankscore < 300
and global.rankscore > 401
draw_sprite_ext(spr_rank,3,view_xview[0]+152,view_yview[0]+7,1,1,0,c_white,0.7)
if global.rankscore < 400
and global.rankscore > 501
draw_sprite_ext(spr_rank,4,view_xview[0]+152,view_yview[0]+7,1,1,0,c_white,0.7)
if global.rankscore < 500
and global.rankscore > 601
draw_sprite_ext(spr_rank,5,view_xview[0]+152,view_yview[0]+7,1,1,0,c_white,0.7)
if global.rankscore < 600
and global.rankscore > 701
draw_sprite_ext(spr_rank,6,view_xview[0]+152,view_yview[0]+7,1,1,0,c_white,0.7)
if global.rankscore < 700
and global.rankscore > 801
draw_sprite_ext(spr_rank,7,view_xview[0]+152,view_yview[0]+7,1,1,0,c_white,0.7)
if global.rankscore < 800
and global.rankscore > 901
draw_sprite_ext(spr_rank,8,view_xview[0]+152,view_yview[0]+7,1,1,0,c_white,0.7)
if global.rankscore < 900
draw_sprite_ext(spr_rank,9,view_xview[0]+152,view_yview[0]+7,1,1,0,c_white,0.7)


--------------------
user posted image
If a pokemon breaks it's legs, does that mean it can't sleep?
PMEmail PosterAOL
Top
Sweden
Alex
Posted: Jun 5 2009, 05:19 PM
Quote Post


In Donaldismo Veritas
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 1678
Member No.: 5509
Joined: 9-July 08

Status: (0d) [--]


When using if, make sure that you use { and }, like this:

CODE
if variable = value {
/*stuff to do*/
}


--------------------
user posted image
--------------------
My character has been drawn by:
NICKtendo DS
Jazz
Tek
PM
Top
United States
Weston404
Posted: Jun 5 2009, 06:10 PM
Quote Post


Cool beans
[*]

Group Icon
Group: Members
Posts: 956
Member No.: 3784
Joined: 19-May 07

Status: (0d) [--]


I got it working, thanks everyone!

I also made a huge fail in coding. That code I posted earlier, I got the < and > symbols mixed up, but it all worked out!


--------------------
user posted image
If a pokemon breaks it's legs, does that mean it can't sleep?
PMEmail PosterAOL
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0548 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.97 ]