Jump to content


Photo

Code Problem (Probably quick fix)


  • Please log in to reply
2 replies to this topic

#1 Zealot644

Zealot644

    GMC Member

  • New Member
  • 266 posts
  • Version:GM8

Posted 26 February 2012 - 08:58 PM

I turned:
draw_text(x+64,y,string(show)+ ' ' + string(alpha)+'#'+tower_text[(select+1)mod 10])

Which drew some numbers that would show whether a menu was scrolled over (0 or 1 for no or yes) and the alpha of it between 0-1.0 ... I dont need these anymore because everything is working, so I have tried changing it to draw text from another variable that I set within a script that is loaded called player_money.

Into:
draw_text(x+64,y,string(show)+ ' ' + string(alpha)+'#'+global.player_money)

It is supposed to draw the value of player_money to the right.

And got:
___________________________________________
ERROR in
action number 1
of Draw Event
for object obj_button:

Error in code at line 7:
   draw_text(x+64,y,string(show)+ ' ' + string(alpha)+'#'+global.player_money)
                                                                 ^
at position 64: Wrong type of arguments to +.

I feel stupid for having to ask what the problem is when it clearly points me to where... But I suck with draw events and cant figure it out despite experimenting with the removal or changing of different code.

Edited by Zealot644, 27 February 2012 - 03:20 AM.

  • 0

#2 GameGeisha

GameGeisha

    GameGeisha

  • GMC Member
  • 2747 posts
  • Version:GM:Studio

Posted 26 February 2012 - 09:11 PM

draw_text(x+64,y,string(show)+ ' ' + string(alpha)+'#'+global.player_money)
Why did you put string() around show and alpha, but not global.player_money?

draw_text(x+64, y, string(show) + " " + string(alpha) + "#" + string(global.player_money));

GameGeisha
  • 1

#3 Zealot644

Zealot644

    GMC Member

  • New Member
  • 266 posts
  • Version:GM8

Posted 26 February 2012 - 09:13 PM

Added the proper brackets and received the same error :(

Nevermind.

Thank you! +1'd.

Edited by Zealot644, 26 February 2012 - 09:14 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users