Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Drawing variables in text with GML, And drawing times
United States
Ziso
Posted: Nov 12 2007, 04:52 PM
Quote Post


Should I be concerned?
[*]

Group Icon
Group: Members
Posts: 992
Member No.: 3387
Joined: 2-March 07

Status: (0d) [--]


When I type this code, it returns an error
CODE
draw_text(32,32,global.yourname)
draw_text(32,64,global.date)
draw_text(32,96,global.hour+":"+global.time)

However, it works just fine when I do this
CODE
draw_text(32,32,global.yourname)
draw_text(32,64,global.date)
draw_text(32,96,global.hour)

Here's the error message
user posted image
does anyone know the problem?

EDIT: as well as this, i need help drawing times. I can't work with GMs funky numbers it generates for the date and time.

This post has been edited by Zisomek on Nov 12 2007, 05:06 PM


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
Unspecified
rabbitears
Posted: Nov 12 2007, 05:13 PM
Quote Post


Epic battle
[*][*][*]

Group Icon
Group: Members
Posts: 609
Member No.: 2911
Joined: 5-November 06

Status: (0d) [--]


I think it might have something to do with the fact that you used ":".
Puncuation is better off not being used for variables and GML.
I'm not sure how to bypass this, though.


--------------------
user posted imageuser posted image
My Reference
People who sprote or drew me: LakiPlant Neopolis(old ref)
PMEmail Poster
Top
United States
Ziso
Posted: Nov 12 2007, 05:38 PM
Quote Post


Should I be concerned?
[*]

Group Icon
Group: Members
Posts: 992
Member No.: 3387
Joined: 2-March 07

Status: (0d) [--]


I'm trying to make the colon between the hour and minutes.


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
Unspecified
rabbitears
Posted: Nov 12 2007, 08:00 PM
Quote Post


Epic battle
[*][*][*]

Group Icon
Group: Members
Posts: 609
Member No.: 2911
Joined: 5-November 06

Status: (0d) [--]


Yeah, I understand that. It's just that using any puncuation in GML causes an error like that, whether it's : ; , . or ' (like putting a period at the end of a sentence messes it up). So I'm not sure on how to fix it, but that must be the problem.

But maybe this will work: instead of using +, remove it altogether:

global.hour":"global.time

It might work, but then it might not.


--------------------
user posted imageuser posted image
My Reference
People who sprote or drew me: LakiPlant Neopolis(old ref)
PMEmail Poster
Top
Togo
Razz
Posted: Nov 12 2007, 08:23 PM
Quote Post



[*][*][*]

Group Icon
Group: Members
Posts: 6007
Member No.: 4259
Joined: 13-August 07

Status: (0d) [--]


or try "global.hour+string(":")+global.time"

That may not work though ...


--------------------
Allusion - [||--------] 25% complete
GridLocked - [||||------] 45% complete
my blog
PMEmail PosterAOL
Top
United Kingdom
hazmeister
Posted: Nov 13 2007, 03:12 AM
Quote Post


ITT CATZ!!!
[*]

Group Icon
Group: Members
Posts: 1425
Member No.: 3802
Joined: 21-May 07

Status: (0d) [--]


A full stop might work better if all else fails, and you could then draw two of them. A little more work but the same effect.


--------------------
PMEmail PosterUsers WebsiteMSN
Top
United States
Littlink
Posted: Nov 13 2007, 10:12 AM
Quote Post


hip 2b square
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 5146
Member No.: 2010
Joined: 11-April 06

Status: (0d) [--]


draw_text(32,32,global.yourname)
draw_text(32,64,global.date)
draw_text(32,96,string(global.hour)+":"+string(global.time))

??


--------------------
[████████░░] 80%

user posted image
PMUsers WebsiteMSN
Top
India
Char
Posted: Nov 14 2007, 06:17 AM
Quote Post


fad was bad
[M][*][*]

Group Icon
Group: Admins
Posts: 2123
Member No.: 2856
Joined: 25-October 06

Status: (0d) [--]


Littlink's code will work.
Just fyi, GML can't draw a real value (meaning a number) and a string (ascii characters) together. To make a real value a string, just put it in string(x).
(global.hour and global.time are numbers, so they are real values)


--------------------
aa this broke


Make your own | If a level is breaking the rules, note the ID and PM me.
Reference (thanks Frogjester!)
PMEmail PosterUsers WebsiteAOLYahooMSN
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.0604 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.43 ]